/*! For license information please see component---src-pages-index-tsx-e9841f60244f992a6cff.js.LICENSE.txt */ (self.webpackChunkchainlist=self.webpackChunkchainlist||[]).push([[691],{3877:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8677).Buffer}catch(R){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(R){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,R=0|s[6],I=8191&R,P=R>>>13,C=0|s[7],T=8191&C,O=C>>>13,N=0|s[8],B=8191&N,L=N>>>13,j=0|s[9],q=8191&j,U=j>>>13,F=0|a[0],D=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,Z=W>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(h,D)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,z))+Math.imul(m,D)|0,o=Math.imul(m,z);var yt=(c+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,D),i=(i=Math.imul(y,z))+Math.imul(v,D)|0,o=Math.imul(v,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,z))+Math.imul(_,D)|0,o=Math.imul(_,z),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,z))+Math.imul(E,D)|0,o=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Q)|0;var wt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,D),i=(i=Math.imul(k,z))+Math.imul(S,D)|0,o=Math.imul(S,z),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,z))+Math.imul(P,D)|0,o=Math.imul(P,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(c+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,D),i=(i=Math.imul(T,z))+Math.imul(O,D)|0,o=Math.imul(O,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var At=(c+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,D),i=(i=Math.imul(B,z))+Math.imul(L,D)|0,o=Math.imul(L,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Q)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Et=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,D),i=(i=Math.imul(q,z))+Math.imul(U,D)|0,o=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,K),i=(i=Math.imul(q,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(y,ft)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ht)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(q,V),i=(i=Math.imul(q,Z))+Math.imul(U,V)|0,o=Math.imul(U,Z),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Q)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(q,Y),i=(i=Math.imul(q,Q))+Math.imul(U,Y)|0,o=Math.imul(U,Q),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,$),i=(i=Math.imul(q,tt))+Math.imul(U,$)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,ht)|0;var It=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,rt),i=(i=Math.imul(q,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,ot),i=(i=Math.imul(q,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ht)|0;var Ct=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(q,ut),i=(i=Math.imul(q,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0;var Tt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,ft),i=(i=Math.imul(q,ht))+Math.imul(U,ft)|0,o=Math.imul(U,ht);var Ot=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(q,pt))|0)+((8191&(i=(i=Math.imul(q,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Rt,u[13]=It,u[14]=Pt,u[15]=Ct,u[16]=Tt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(t,e,r){return y(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):v(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(M,_),M.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},M.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new M;else if("p224"===t)e=new A;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return w[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},2500:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2808).Buffer}catch(R){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(R){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,R=0|s[6],I=8191&R,P=R>>>13,C=0|s[7],T=8191&C,O=C>>>13,N=0|s[8],B=8191&N,L=N>>>13,j=0|s[9],q=8191&j,U=j>>>13,F=0|a[0],D=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,Z=W>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(h,D)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,z))+Math.imul(m,D)|0,o=Math.imul(m,z);var yt=(c+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,D),i=(i=Math.imul(y,z))+Math.imul(v,D)|0,o=Math.imul(v,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,z))+Math.imul(_,D)|0,o=Math.imul(_,z),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,z))+Math.imul(E,D)|0,o=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Q)|0;var wt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,D),i=(i=Math.imul(k,z))+Math.imul(S,D)|0,o=Math.imul(S,z),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,z))+Math.imul(P,D)|0,o=Math.imul(P,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(c+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,D),i=(i=Math.imul(T,z))+Math.imul(O,D)|0,o=Math.imul(O,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var At=(c+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,D),i=(i=Math.imul(B,z))+Math.imul(L,D)|0,o=Math.imul(L,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Q)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Et=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,D),i=(i=Math.imul(q,z))+Math.imul(U,D)|0,o=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,K),i=(i=Math.imul(q,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(y,ft)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ht)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(q,V),i=(i=Math.imul(q,Z))+Math.imul(U,V)|0,o=Math.imul(U,Z),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Q)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(q,Y),i=(i=Math.imul(q,Q))+Math.imul(U,Y)|0,o=Math.imul(U,Q),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,$),i=(i=Math.imul(q,tt))+Math.imul(U,$)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,ht)|0;var It=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,rt),i=(i=Math.imul(q,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,ot),i=(i=Math.imul(q,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ht)|0;var Ct=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(q,ut),i=(i=Math.imul(q,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0;var Tt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,ft),i=(i=Math.imul(q,ht))+Math.imul(U,ft)|0,o=Math.imul(U,ht);var Ot=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(q,pt))|0)+((8191&(i=(i=Math.imul(q,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Rt,u[13]=It,u[14]=Pt,u[15]=Ct,u[16]=Tt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(t,e,r){return y(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):v(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(M,_),M.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},M.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new M;else if("p224"===t)e=new A;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return w[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},9394:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7187);function i(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout((()=>{throw n}))}}class o extends n.EventEmitter{emit(t,...e){let r="error"===t;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let t;if(e.length>0&&([t]=e),t instanceof Error)throw t;const r=new Error("Unhandled error."+(t?` (${t.message})`:""));throw r.context=t,r}const o=n[t];if(void 0===o)return!1;if("function"==typeof o)i(o,this,e);else{const t=o.length,r=function(t){const e=t.length,r=new Array(e);for(let n=0;n1)}function M(){return!!b()&&(w()||_())}function A(){const t=v();return!(!t||!t.name)&&"node"===t.name.toLowerCase()}function E(){return!A()&&!!P()}const x=i.getFromWindow,k=i.getFromWindowOrThrow,S=i.getDocumentOrThrow,R=i.getDocument,I=i.getNavigatorOrThrow,P=i.getNavigator,C=i.getLocationOrThrow,T=i.getLocation,O=i.getCryptoOrThrow,N=i.getCrypto,B=i.getLocalStorageOrThrow,L=i.getLocalStorage;function j(){return n.D()}const q=function(t){if("string"!=typeof t)throw new Error("Cannot safe json parse value of type "+typeof t);try{return JSON.parse(t)}catch(e){return t}},U=function(t){return"string"==typeof t?t:JSON.stringify(t)};function F(t,e){const r=U(e),n=L();n&&n.setItem(t,r)}function D(t){let e=null,r=null;const n=L();return n&&(r=n.getItem(t)),e=r?q(r):r,e}function z(t){const e=L();e&&e.removeItem(t)}const H="WALLETCONNECT_DEEPLINK_CHOICE";function K(t,e){const r=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${r}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function G(t){const e=t.href.split("?")[0];F(H,Object.assign(Object.assign({},t),{href:e}))}function W(t,e){return t.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())))[0]}function V(t,e){let r=t;return e&&(r=e.map((e=>W(t,e))).filter(Boolean)),r}const Z="https://registry.walletconnect.com";function J(){return Z+"/api/v2/wallets"}function Y(){return Z+"/api/v2/dapps"}function Q(t,e="mobile"){var r;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:null!==(r=t.image_url.sm)&&void 0!==r?r:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function X(t,e="mobile"){return Object.values(t).filter((t=>!!t[e].universal||!!t[e].native)).map((t=>Q(t,e)))}},926:function(t,e,r){"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){const t=n();return t.subtle||t.webkitSubtle}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowserCryptoAvailable=e.getSubtleCrypto=e.getBrowerCrypto=void 0,e.getBrowerCrypto=n,e.getSubtleCrypto=i,e.isBrowserCryptoAvailable=function(){return!!n()&&!!i()}},8618:function(t,e){"use strict";function r(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function n(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node}Object.defineProperty(e,"__esModule",{value:!0}),e.isBrowser=e.isNode=e.isReactNative=void 0,e.isReactNative=r,e.isNode=n,e.isBrowser=function(){return!r()&&!n()}},1468:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4308);n.__exportStar(r(926),e),n.__exportStar(r(8618),e)},4308:function(t,e,r){"use strict";r.r(e),r.d(e,{__assign:function(){return o},__asyncDelegator:function(){return w},__asyncGenerator:function(){return b},__asyncValues:function(){return _},__await:function(){return v},__awaiter:function(){return l},__classPrivateFieldGet:function(){return x},__classPrivateFieldSet:function(){return k},__createBinding:function(){return h},__decorate:function(){return a},__exportStar:function(){return d},__extends:function(){return i},__generator:function(){return f},__importDefault:function(){return E},__importStar:function(){return A},__makeTemplateObject:function(){return M},__metadata:function(){return c},__param:function(){return u},__read:function(){return m},__rest:function(){return s},__spread:function(){return g},__spreadArrays:function(){return y},__values:function(){return p}});var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},n(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var o=function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function u(t,e){return function(r,n){e(r,n,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function f(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(r=i[t](e)).value instanceof v?Promise.resolve(r.value.v).then(u,c):l(o[0][2],r)}catch(n){l(o[0][3],n)}var r}function u(t){a("next",t)}function c(t){a("throw",t)}function l(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function w(t){var e,r;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,i){e[n]=t[n]?function(e){return(r=!r)?{value:v(t[n](e)),done:"return"===n}:i?i(e):e}:i}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,i){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,i,(e=t[r](e)).done,e.value)}))}}}function M(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function A(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function E(t){return t&&t.__esModule?t:{default:t}}function x(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function k(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}},4337:function(t,e,r){function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var i=r(5522),o=n(r(2592)),s=n(r(640)),a=r(5776);var u=':root {\n --animation-duration: 300ms;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#walletconnect-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n\n.walletconnect-modal__headerLogo {\n height: 21px;\n}\n\n.walletconnect-modal__header p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n align-items: flex-start;\n display: flex;\n flex: 1;\n margin-left: 5px;\n}\n\n.walletconnect-modal__close__wrapper {\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 10000;\n background: white;\n border-radius: 26px;\n padding: 6px;\n box-sizing: border-box;\n width: 26px;\n height: 26px;\n cursor: pointer;\n}\n\n.walletconnect-modal__close__icon {\n position: relative;\n top: 7px;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: rotate(45deg);\n}\n\n.walletconnect-modal__close__line1 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n}\n\n.walletconnect-modal__close__line2 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n transform: rotate(90deg);\n}\n\n.walletconnect-qrcode__base {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n background: rgba(37, 41, 46, 0.95);\n height: 100%;\n left: 0;\n pointer-events: auto;\n position: fixed;\n top: 0;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n width: 100%;\n will-change: opacity;\n padding: 40px;\n box-sizing: border-box;\n}\n\n.walletconnect-qrcode__text {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 10px 0 20px 0;\n text-align: center;\n width: 100%;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-qrcode__text {\n font-size: 4vw;\n }\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-qrcode__text {\n font-size: 14px;\n }\n}\n\n.walletconnect-qrcode__image {\n width: calc(100% - 30px);\n box-sizing: border-box;\n cursor: none;\n margin: 0 auto;\n}\n\n.walletconnect-qrcode__notification {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n font-size: 16px;\n padding: 16px 20px;\n border-radius: 16px;\n text-align: center;\n transition: all 0.1s ease-in-out;\n background: white;\n color: black;\n margin-bottom: -60px;\n opacity: 0;\n}\n\n.walletconnect-qrcode__notification.notification__show {\n opacity: 1;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__header {\n height: 130px;\n }\n .walletconnect-modal__base {\n overflow: auto;\n }\n}\n\n@media only screen and (min-device-width: 415px) and (max-width: 768px) {\n #content {\n max-width: 768px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 375px) and (max-width: 415px) {\n #content {\n max-width: 414px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 320px) and (max-width: 375px) {\n #content {\n max-width: 375px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (max-width: 320px) {\n #content {\n max-width: 320px;\n box-sizing: border-box;\n }\n}\n\n.walletconnect-modal__base {\n -webkit-font-smoothing: antialiased;\n background: #ffffff;\n border-radius: 24px;\n box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);\n font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,\n -apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,\n "Open Sans", "Helvetica Neue", sans-serif;\n margin-top: 41px;\n padding: 24px 24px 22px;\n pointer-events: auto;\n position: relative;\n text-align: center;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n will-change: transform;\n overflow: visible;\n transform: translateY(-50%);\n top: 50%;\n max-width: 500px;\n margin: auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__base {\n padding: 24px 12px;\n }\n}\n\n.walletconnect-modal__base .hidden {\n transform: translateY(150%);\n transition: 0.125s cubic-bezier(0.4, 0, 1, 1);\n}\n\n.walletconnect-modal__header {\n align-items: center;\n display: flex;\n height: 26px;\n left: 0;\n justify-content: space-between;\n position: absolute;\n top: -42px;\n width: 100%;\n}\n\n.walletconnect-modal__base .wc-logo {\n align-items: center;\n display: flex;\n height: 26px;\n margin-top: 15px;\n padding-bottom: 15px;\n pointer-events: auto;\n}\n\n.walletconnect-modal__base .wc-logo div {\n background-color: #3399ff;\n height: 21px;\n margin-right: 5px;\n mask-image: url("images/wc-logo.svg") center no-repeat;\n width: 32px;\n}\n\n.walletconnect-modal__base .wc-logo p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n}\n\n.walletconnect-modal__base h2 {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 0 0 19px 0;\n text-align: center;\n width: 100%;\n}\n\n.walletconnect-modal__base__row {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n align-items: center;\n border-radius: 20px;\n cursor: pointer;\n display: flex;\n height: 56px;\n justify-content: space-between;\n padding: 0 15px;\n position: relative;\n margin: 0px 0px 8px;\n text-align: left;\n transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n will-change: transform;\n text-decoration: none;\n}\n\n.walletconnect-modal__base__row:hover {\n background: rgba(60, 66, 82, 0.06);\n}\n\n.walletconnect-modal__base__row:active {\n background: rgba(60, 66, 82, 0.06);\n transform: scale(0.975);\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n}\n\n.walletconnect-modal__base__row__h3 {\n color: #25292e;\n font-size: 20px;\n font-weight: 700;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.walletconnect-modal__base__row__right {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.walletconnect-modal__base__row__right__app-icon {\n border-radius: 8px;\n height: 34px;\n margin: 0 11px 2px 0;\n width: 34px;\n background-size: 100%;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-modal__base__row__right__caret {\n height: 18px;\n opacity: 0.3;\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n width: 8px;\n will-change: opacity;\n}\n\n.walletconnect-modal__base__row:hover .caret,\n.walletconnect-modal__base__row:active .caret {\n opacity: 0.6;\n}\n\n.walletconnect-modal__mobile__toggle {\n width: 80%;\n display: flex;\n margin: 0 auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n margin-bottom: 18px;\n background: #d4d5d9;\n}\n\n.walletconnect-modal__single_wallet {\n display: flex;\n justify-content: center;\n margin-top: 7px;\n margin-bottom: 18px;\n}\n\n.walletconnect-modal__single_wallet a {\n cursor: pointer;\n color: rgb(64, 153, 255);\n font-size: 21px;\n font-weight: 800;\n text-decoration: none !important;\n margin: 0 auto;\n}\n\n.walletconnect-modal__mobile__toggle_selector {\n width: calc(50% - 8px);\n background: white;\n position: absolute;\n border-radius: 5px;\n height: calc(100% - 8px);\n top: 4px;\n transition: all 0.2s ease-in-out;\n transform: translate3d(4px, 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {\n transform: translate3d(calc(100% + 12px), 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle a {\n font-size: 12px;\n width: 50%;\n text-align: center;\n padding: 8px;\n margin: 0;\n font-weight: 600;\n z-index: 1;\n}\n\n.walletconnect-modal__footer {\n display: flex;\n justify-content: center;\n margin-top: 20px;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__footer {\n margin-top: 5vw;\n }\n}\n\n.walletconnect-modal__footer a {\n cursor: pointer;\n color: #898d97;\n font-size: 15px;\n margin: 0 auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__footer a {\n font-size: 14px;\n }\n}\n\n.walletconnect-connect__buttons__wrapper {\n max-height: 44vh;\n}\n\n.walletconnect-connect__buttons__wrapper__android {\n margin: 50% 0;\n}\n\n.walletconnect-connect__buttons__wrapper__wrap {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n margin: 10px 0;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__buttons__wrapper__wrap {\n margin-top: 40px;\n }\n}\n\n.walletconnect-connect__button {\n background-color: rgb(64, 153, 255);\n padding: 12px;\n border-radius: 8px;\n text-decoration: none;\n color: rgb(255, 255, 255);\n font-weight: 500;\n}\n\n.walletconnect-connect__button__icon_anchor {\n cursor: pointer;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 8px;\n width: 42px;\n justify-self: center;\n flex-direction: column;\n text-decoration: none !important;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-connect__button__icon_anchor {\n margin: 4px;\n }\n}\n\n.walletconnect-connect__button__icon {\n border-radius: 10px;\n height: 42px;\n margin: 0;\n width: 42px;\n background-size: cover !important;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-connect__button__text {\n color: #424952;\n font-size: 2.7vw;\n text-decoration: none !important;\n padding: 0;\n margin-top: 1.8vw;\n font-weight: 600;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__button__text {\n font-size: 16px;\n margin-top: 12px;\n }\n}\n\n.walletconnect-search__input {\n border: none;\n background: #d4d5d9;\n border-style: none;\n padding: 8px 16px;\n outline: none;\n font-style: normal;\n font-stretch: normal;\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: left;\n border-radius: 8px;\n width: calc(100% - 16px);\n margin: 0;\n margin-bottom: 8px;\n}\n';"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var c="data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",l="WalletConnect",f=300,h="rgb(64, 153, 255)",d="walletconnect-wrapper",p="walletconnect-style-sheet",m="walletconnect-qrcode-modal",g="walletconnect-qrcode-close",y="walletconnect-qrcode-text",v="walletconnect-connect-button";function b(t){return a.createElement("div",{className:"walletconnect-modal__header"},a.createElement("img",{src:c,className:"walletconnect-modal__headerLogo"}),a.createElement("p",null,l),a.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:t.onClose},a.createElement("div",{id:g,className:"walletconnect-modal__close__icon"},a.createElement("div",{className:"walletconnect-modal__close__line1"}),a.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function w(t){return a.createElement("a",{className:"walletconnect-connect__button",href:t.href,id:v+"-"+t.name,onClick:t.onClick,rel:"noopener noreferrer",style:{backgroundColor:t.color},target:"_blank"},t.name)}var _="data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E";function M(t){var e=t.color,r=t.href,n=t.name,i=t.logo,o=t.onClick;return a.createElement("a",{className:"walletconnect-modal__base__row",href:r,onClick:o,rel:"noopener noreferrer",target:"_blank"},a.createElement("h3",{className:"walletconnect-modal__base__row__h3"},n),a.createElement("div",{className:"walletconnect-modal__base__row__right"},a.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+i+"') "+e,backgroundSize:"100%"}}),a.createElement("img",{src:_,className:"walletconnect-modal__base__row__right__caret"})))}function A(t){var e=t.color,r=t.href,n=t.name,i=t.logo,o=t.onClick,s=window.innerWidth<768?(n.length>8?2.5:2.7)+"vw":"inherit";return a.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:r,onClick:o,rel:"noopener noreferrer",target:"_blank"},a.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+i+"') "+e,backgroundSize:"100%"}}),a.createElement("div",{style:{fontSize:s},className:"walletconnect-connect__button__text"},n))}var E=5,x=12;function k(t){var e=i.isAndroid(),r=a.useState(""),n=r[0],o=r[1],s=a.useState(""),u=s[0],c=s[1],l=a.useState(1),f=l[0],d=l[1],p=u?t.links.filter((function(t){return t.name.toLowerCase().includes(u.toLowerCase())})):t.links,m=t.errorMessage,g=u||p.length>E,v=Math.ceil(p.length/x),b=[(f-1)*x+1,f*x],_=p.length?p.filter((function(t,e){return e+1>=b[0]&&e+1<=b[1]})):[],k=!(e||!(v>1)),S=void 0;return a.createElement("div",null,a.createElement("p",{id:y,className:"walletconnect-qrcode__text"},e?t.text.connect_mobile_wallet:t.text.choose_preferred_wallet),!e&&a.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:n,onChange:function(t){o(t.target.value),clearTimeout(S),t.target.value?S=setTimeout((function(){c(t.target.value),d(1)}),1e3):(o(""),c(""),d(1))}}),a.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(e?"__android":g&&p.length?"__wrap":"")},e?a.createElement(w,{name:t.text.connect,color:h,href:t.uri,onClick:a.useCallback((function(){i.saveMobileLinkInfo({name:"Unknown",href:t.uri})}),[])}):_.length?_.map((function(e){var r=e.color,n=e.name,o=e.shortName,s=e.logo,u=i.formatIOSMobile(t.uri,e),c=a.useCallback((function(){i.saveMobileLinkInfo({name:n,href:u})}),[_]);return g?a.createElement(A,{color:r,href:u,name:o||n,logo:s,onClick:c}):a.createElement(M,{color:r,href:u,name:n,logo:s,onClick:c})})):a.createElement(a.Fragment,null,a.createElement("p",null,m.length?t.errorMessage:t.links.length&&!p.length?t.text.no_wallets_found:t.text.loading))),k&&a.createElement("div",{className:"walletconnect-modal__footer"},Array(v).fill(0).map((function(t,e){var r=e+1,n=f===r;return a.createElement("a",{style:{margin:"auto 10px",fontWeight:n?"bold":"normal"},onClick:function(){return d(r)}},r)}))))}function S(t){var e=!!t.message.trim();return a.createElement("div",{className:"walletconnect-qrcode__notification"+(e?" notification__show":"")},t.message)}var R=function(t){try{var e="";return Promise.resolve(o.toString(t,{margin:0,type:"svg"})).then((function(t){return"string"==typeof t&&(e=t.replace("0||a.useEffect((function(){!function(){try{if(e)return Promise.resolve();u(!0);var o=function(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}((function(){var e=t.qrcodeModalOptions&&t.qrcodeModalOptions.registryUrl?t.qrcodeModalOptions.registryUrl:i.getWalletRegistryUrl();return Promise.resolve(fetch(e)).then((function(e){return Promise.resolve(e.json()).then((function(e){var o=e.listings,s=r?"mobile":"desktop",a=i.getMobileLinkRegistry(i.formatMobileRegistry(o,s),n);u(!1),f(!0),C(a.length?"":t.text.no_supported_wallets),S(a);var c=1===a.length;c&&(w(i.formatIOSMobile(t.uri,a[0])),p(!0)),A(c)}))}))}),(function(e){u(!1),f(!0),C(t.text.something_went_wrong),console.error(e)}));return Promise.resolve(o&&o.then?o.then((function(){})):void 0)}catch(s){return Promise.reject(s)}}()}))};T();var O=r?d:!d;return a.createElement("div",{id:m,className:"walletconnect-qrcode__base animated fadeIn"},a.createElement("div",{className:"walletconnect-modal__base"},a.createElement(b,{onClose:t.onClose}),M&&d?a.createElement("div",{className:"walletconnect-modal__single_wallet"},a.createElement("a",{onClick:function(){return i.saveMobileLinkInfo({name:x[0].name,href:v})},href:v,rel:"noopener noreferrer",target:"_blank"},t.text.connect_with+" "+(M?x[0].name:"")+" ›")):e||s||!s&&x.length?a.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(O?" right__selected":"")},a.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),r?a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return p(!1),T()}},t.text.mobile),a.createElement("a",{onClick:function(){return p(!0)}},t.text.qrcode)):a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return p(!0)}},t.text.qrcode),a.createElement("a",{onClick:function(){return p(!1),T()}},t.text.desktop))):null,a.createElement("div",null,d||!e&&!s&&!x.length?a.createElement(I,Object.assign({},g)):a.createElement(k,Object.assign({},g,{links:x,errorMessage:P})))))}var C={de:{choose_preferred_wallet:"Wähle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterstützten Wallet",no_wallets_found:"keine Wallet gefunden"},en:{choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},es:{choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera móvil",scan_qrcode_with_wallet:"Escanea el código QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo salió mal",no_supported_wallets:"Todavía no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},fr:{choose_preferred_wallet:"Choisissez votre portefeuille préféré",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copié!",connect_with:"Connectez-vous à l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourné",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouvé"},ko:{choose_preferred_wallet:"원하는 지갑을 선택하세요",connect_mobile_wallet:"모바일 지갑과 연결",scan_qrcode_with_wallet:"WalletConnect 지원 지갑에서 QR코드를 스캔하세요",connect:"연결",qrcode:"QR 코드",mobile:"모바일",desktop:"데스크탑",copy_to_clipboard:"클립보드에 복사",copied_to_clipboard:"클립보드에 복사되었습니다!",connect_with:"와 연결하다",loading:"로드 중...",something_went_wrong:"문제가 발생했습니다.",no_supported_wallets:"아직 지원되는 지갑이 없습니다",no_wallets_found:"지갑을 찾을 수 없습니다"},pt:{choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se à carteira móvel",scan_qrcode_with_wallet:"Ler o código QR com uma carteira compatível com WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda não há carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},zh:{choose_preferred_wallet:"选择你的钱包",connect_mobile_wallet:"连接至移动端钱包",scan_qrcode_with_wallet:"使用兼容 WalletConnect 的钱包扫描二维码",connect:"连接",qrcode:"二维码",mobile:"移动",desktop:"桌面",copy_to_clipboard:"复制到剪贴板",copied_to_clipboard:"复制到剪贴板成功!",connect_with:"通过以下方式连接",loading:"正在加载...",something_went_wrong:"出了问题",no_supported_wallets:"目前还没有支持的钱包",no_wallets_found:"没有找到钱包"},fa:{choose_preferred_wallet:"کیف پول مورد نظر خود را انتخاب کنید",connect_mobile_wallet:"به کیف پول موبایل وصل شوید",scan_qrcode_with_wallet:"کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",connect:"اتصال",qrcode:"کد QR",mobile:"سیار",desktop:"دسکتاپ",copy_to_clipboard:"کپی به کلیپ بورد",copied_to_clipboard:"در کلیپ بورد کپی شد!",connect_with:"ارتباط با",loading:"...بارگذاری",something_went_wrong:"مشکلی پیش آمد",no_supported_wallets:"هنوز هیچ کیف پول پشتیبانی شده ای وجود ندارد",no_wallets_found:"هیچ کیف پولی پیدا نشد"}};function T(){var t=i.getDocumentOrThrow(),e=t.getElementById(m);e&&(e.className=e.className.replace("fadeIn","fadeOut"),setTimeout((function(){var e=t.getElementById(d);e&&t.body.removeChild(e)}),f))}function O(t){return function(){T(),t&&t()}}function N(t,e,r){!function(){var t=i.getDocumentOrThrow(),e=t.getElementById(p);e&&t.head.removeChild(e);var r=t.createElement("style");r.setAttribute("id",p),r.innerText=u,t.head.appendChild(r)}();var n,o=function(){var t=i.getDocumentOrThrow(),e=t.createElement("div");return e.setAttribute("id",d),t.body.appendChild(e),e}();a.render(a.createElement(P,{text:(n=i.getNavigatorOrThrow().language.split("-")[0]||"en",C[n]||C.en),uri:t,onClose:O(e),qrcodeModalOptions:r}),o)}var B=function(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node};var L={open:function(t,e,r){console.log(t),B()?function(t){o.toString(t,{type:"terminal"}).then(console.log)}(t):N(t,e,r)},close:function(){B()||T()}};t.exports=L},8007:function(t){"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},1460:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(6563).Buffer}catch(E){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],d=f[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,R=0|s[6],I=8191&R,P=R>>>13,C=0|s[7],T=8191&C,O=C>>>13,N=0|s[8],B=8191&N,L=N>>>13,j=0|s[9],q=8191&j,U=j>>>13,F=0|a[0],D=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,Z=W>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(h,D)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,z))+Math.imul(m,D)|0,o=Math.imul(m,z);var yt=(c+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,D),i=(i=Math.imul(y,z))+Math.imul(v,D)|0,o=Math.imul(v,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,z))+Math.imul(_,D)|0,o=Math.imul(_,z),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,z))+Math.imul(E,D)|0,o=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Q)|0;var wt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,D),i=(i=Math.imul(k,z))+Math.imul(S,D)|0,o=Math.imul(S,z),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,z))+Math.imul(P,D)|0,o=Math.imul(P,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(c+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,D),i=(i=Math.imul(T,z))+Math.imul(O,D)|0,o=Math.imul(O,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var At=(c+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,D),i=(i=Math.imul(B,z))+Math.imul(L,D)|0,o=Math.imul(L,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Q)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Et=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,D),i=(i=Math.imul(q,z))+Math.imul(U,D)|0,o=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,K),i=(i=Math.imul(q,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(y,ft)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ht)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(q,V),i=(i=Math.imul(q,Z))+Math.imul(U,V)|0,o=Math.imul(U,Z),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Q)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(q,Y),i=(i=Math.imul(q,Q))+Math.imul(U,Y)|0,o=Math.imul(U,Q),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,$),i=(i=Math.imul(q,tt))+Math.imul(U,$)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,ht)|0;var It=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,rt),i=(i=Math.imul(q,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,ot),i=(i=Math.imul(q,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ht)|0;var Ct=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(q,ut),i=(i=Math.imul(q,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0;var Tt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,ft),i=(i=Math.imul(q,ht))+Math.imul(U,ft)|0,o=Math.imul(U,ht);var Ot=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(q,pt))|0)+((8191&(i=(i=Math.imul(q,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Rt,u[13]=It,u[14]=Pt,u[15]=Ct,u[16]=Tt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=h),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?d(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e),r},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,M),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},2873:function(t,e){"use strict";function r(t){let e;return"undefined"!=typeof window&&void 0!==window[t]&&(e=window[t]),e}function n(t){const e=r(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.getLocalStorage=e.getLocalStorageOrThrow=e.getCrypto=e.getCryptoOrThrow=e.getLocation=e.getLocationOrThrow=e.getNavigator=e.getNavigatorOrThrow=e.getDocument=e.getDocumentOrThrow=e.getFromWindowOrThrow=e.getFromWindow=void 0,e.getFromWindow=r,e.getFromWindowOrThrow=n,e.getDocumentOrThrow=function(){return n("document")},e.getDocument=function(){return r("document")},e.getNavigatorOrThrow=function(){return n("navigator")},e.getNavigator=function(){return r("navigator")},e.getLocationOrThrow=function(){return n("location")},e.getLocation=function(){return r("location")},e.getCryptoOrThrow=function(){return n("crypto")},e.getCrypto=function(){return r("crypto")},e.getLocalStorageOrThrow=function(){return n("localStorage")},e.getLocalStorage=function(){return r("localStorage")}},5755:function(t,e,r){"use strict";e.D=void 0;const n=r(2873);e.D=function(){let t,e;try{t=n.getDocumentOrThrow(),e=n.getLocationOrThrow()}catch(o){return null}function r(...e){const r=t.getElementsByTagName("meta");for(let t=0;tn.getAttribute(t))).filter((t=>!!t&&e.includes(t)));if(i.length&&i){const t=n.getAttribute("content");if(t)return t}}return""}const i=function(){let e=r("name","og:site_name","og:title","twitter:title");return e||(e=t.title),e}();return{description:r("description","og:description","twitter:description","keywords"),url:e.origin,icons:function(){const r=t.getElementsByTagName("link"),n=[];for(let t=0;t-1){const t=i.getAttribute("href");if(t)if(-1===t.toLowerCase().indexOf("https:")&&-1===t.toLowerCase().indexOf("http:")&&0!==t.indexOf("//")){let r=e.protocol+"//"+e.host;if(0===t.indexOf("/"))r+=t;else{const n=e.pathname.split("/");n.pop();r+=n.join("/")+"/"+t}n.push(r)}else if(0===t.indexOf("//")){const r=e.protocol+t;n.push(r)}else n.push(t)}}return n}(),name:i}}},9282:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i,o,s=r(2136).codes,a=s.ERR_AMBIGUOUS_ARGUMENT,u=s.ERR_INVALID_ARG_TYPE,c=s.ERR_INVALID_ARG_VALUE,l=s.ERR_INVALID_RETURN_VALUE,f=s.ERR_MISSING_ARGS,h=r(5961),d=r(9539).inspect,p=r(9539).types,m=p.isPromise,g=p.isRegExp,y=Object.assign?Object.assign:r(8091).assign,v=Object.is?Object.is:r(609);new Map;function b(){var t=r(9158);i=t.isDeepEqual,o=t.isDeepStrictEqual}var w=!1,_=t.exports=x,M={};function A(t){if(t.message instanceof Error)throw t.message;throw new h(t)}function E(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new h({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function x(){for(var t=arguments.length,e=new Array(t),r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;it.length)&&(r=t.length),t.substring(r-e.length,r)===e}var m="",g="",y="",v="",b={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function _(t){return h(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(t,e,r){var n="",i="",o=0,s="",a=!1,u=_(t),c=u.split("\n"),l=_(e).split("\n"),h=0,d="";if("strictEqual"===r&&"object"===f(t)&&"object"===f(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===c.length&&1===l.length&&c[0]!==l[0]){var w=c[0].length+l[0].length;if(w<=10){if(!("object"===f(t)&&null!==t||"object"===f(e)&&null!==e||0===t&&0===e))return"".concat(b[r],"\n\n")+"".concat(c[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(w<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;c[0][h]===l[0][h];)h++;h>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",h),"^"),h=0)}}}for(var M=c[c.length-1],A=l[l.length-1];M===A&&(h++<2?s="\n ".concat(M).concat(s):n=M,c.pop(),l.pop(),0!==c.length&&0!==l.length);)M=c[c.length-1],A=l[l.length-1];var E=Math.max(c.length,l.length);if(0===E){var x=u.split("\n");if(x.length>30)for(x[26]="".concat(m,"...").concat(v);x.length>27;)x.pop();return"".concat(b.notIdentical,"\n\n").concat(x.join("\n"),"\n")}h>3&&(s="\n".concat(m,"...").concat(v).concat(s),a=!0),""!==n&&(s="\n ".concat(n).concat(s),n="");var k=0,S=b[r]+"\n".concat(g,"+ actual").concat(v," ").concat(y,"- expected").concat(v),R=" ".concat(m,"...").concat(v," Lines skipped");for(h=0;h1&&h>2&&(I>4?(i+="\n".concat(m,"...").concat(v),a=!0):I>3&&(i+="\n ".concat(l[h-2]),k++),i+="\n ".concat(l[h-1]),k++),o=h,n+="\n".concat(y,"-").concat(v," ").concat(l[h]),k++;else if(l.length1&&h>2&&(I>4?(i+="\n".concat(m,"...").concat(v),a=!0):I>3&&(i+="\n ".concat(c[h-2]),k++),i+="\n ".concat(c[h-1]),k++),o=h,i+="\n".concat(g,"+").concat(v," ").concat(c[h]),k++;else{var P=l[h],C=c[h],T=C!==P&&(!p(C,",")||C.slice(0,-1)!==P);T&&p(P,",")&&P.slice(0,-1)===C&&(T=!1,C+=","),T?(I>1&&h>2&&(I>4?(i+="\n".concat(m,"...").concat(v),a=!0):I>3&&(i+="\n ".concat(c[h-2]),k++),i+="\n ".concat(c[h-1]),k++),o=h,i+="\n".concat(g,"+").concat(v," ").concat(C),n+="\n".concat(y,"-").concat(v," ").concat(P),k+=2):(i+=n,n="",1!==I&&0!==h||(i+="\n ".concat(C),k++))}if(k>20&&h30)for(A[26]="".concat(m,"...").concat(v);A.length>27;)A.pop();r=1===A.length?o(this,l(e).call(this,"".concat(p," ").concat(A[0]))):o(this,l(e).call(this,"".concat(p,"\n\n").concat(A.join("\n"),"\n")))}else{var E=_(u),x="",k=b[i];"notDeepEqual"===i||"notEqual"===i?(E="".concat(b[i],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(x="".concat(_(c)),E.length>512&&(E="".concat(E.slice(0,509),"...")),x.length>512&&(x="".concat(x.slice(0,509),"...")),"deepEqual"===i||"equal"===i?E="".concat(k,"\n\n").concat(E,"\n\nshould equal\n\n"):x=" ".concat(i," ").concat(x)),r=o(this,l(e).call(this,"".concat(E).concat(x)))}return Error.stackTraceLimit=h,r.generatedMessage=!n,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=c,r.operator=i,Error.captureStackTrace&&Error.captureStackTrace(s(r),a),r.stack,r.name="AssertionError",o(r)}var r,a,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(e,t),r=e,a=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:h.custom,value:function(t,e){return h(this,function(t){for(var e=1;e2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,s,u,c;if(void 0===a&&(a=r(9282)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(!u||u<0?0:+u,s.length)===s)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))c="The ".concat(t," ").concat(o," ").concat(f(e,"type"));else{var l=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";c='The "'.concat(t,'" ').concat(l," ").concat(o," ").concat(f(e,"type"))}return c+=". Received type ".concat(n(i))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===u&&(u=r(9539));var i=u.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=c},9158:function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(u){i=!0,o=u}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=void 0!==/a/g.flags,s=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},a=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(609),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(360);function f(t){return t.call.bind(t)}var h=f(Object.prototype.hasOwnProperty),d=f(Object.prototype.propertyIsEnumerable),p=f(Object.prototype.toString),m=r(9539).types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,b=m.isMap,w=m.isRegExp,_=m.isSet,M=m.isNativeError,A=m.isBoxedPrimitive,E=m.isNumberObject,x=m.isStringObject,k=m.isBooleanObject,S=m.isBigIntObject,R=m.isSymbolObject,I=m.isFloat32Array,P=m.isFloat64Array;function C(t){if(0===t.length||t.length>10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function T(t){return Object.keys(t).filter(C).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function O(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},t.prototype._dispatch=function(){var t=this,e=this._queue.shift();if(e){var r=!1;this._currentReleaser=function(){r||(r=!0,t._value++,t._dispatch())},e([this._value--,this._currentReleaser])}},t}();e.default=i},8125:function(t,e,r){"use strict";e.WU=void 0;var n=r(5078);Object.defineProperty(e,"WU",{enumerable:!0,get:function(){return n.default}});var i=r(2403);var o=r(1960)},1960:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=void 0;var n=r(655);e.withTimeout=function(t,e,r){var i=this;return void 0===r&&(r=new Error("timeout")),{acquire:function(){return new Promise((function(o,s){return n.__awaiter(i,void 0,void 0,(function(){var i,a;return n.__generator(this,(function(n){switch(n.label){case 0:return i=!1,setTimeout((function(){i=!0,s(r)}),e),[4,t.acquire()];case 1:return a=n.sent(),i?(Array.isArray(a)?a[1]:a)():o(a),[2]}}))}))}))},runExclusive:function(t){return n.__awaiter(this,void 0,void 0,(function(){var e,r;return n.__generator(this,(function(n){switch(n.label){case 0:e=function(){},n.label=1;case 1:return n.trys.push([1,,7,8]),[4,this.acquire()];case 2:return r=n.sent(),Array.isArray(r)?(e=r[1],[4,t(r[0])]):[3,4];case 3:return[2,n.sent()];case 4:return e=r,[4,t()];case 5:return[2,n.sent()];case 6:return[3,8];case 7:return e(),[7];case 8:return[2]}}))}))},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}},4409:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return(0,i.default)((function(e,r){var i;try{i=t.apply(this,e)}catch(o){return r(o)}(0,n.default)(i)&&"function"==typeof i.then?i.then((function(t){a(r,null,t)}),(function(t){a(r,t.message?t:new Error(t))})):r(null,i)}))};var n=s(r(3218)),i=s(r(3519)),o=s(r(3111));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e,r){try{t(e,r)}catch(n){(0,o.default)(u,n)}}function u(t){throw t}t.exports=e.default},4338:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,s){(0,n.default)(e)(t,(0,i.default)((0,o.default)(r)),s)};var n=s(r(6954)),i=s(r(6529)),o=s(r(8993));function s(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},1846:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r){((0,n.default)(t)?h:d)(t,(0,l.default)(e),r)};var n=f(r(1240)),i=f(r(1605)),o=f(r(7388)),s=f(r(3875)),a=f(r(308)),u=f(r(6979)),c=f(r(3362)),l=f(r(8993));function f(t){return t&&t.__esModule?t:{default:t}}function h(t,e,r){r=(0,u.default)(r||a.default);var n=0,o=0,s=t.length;function l(t,e){t?r(t):++o!==s&&e!==i.default||r(null)}for(0===s&&r(null);n2&&(n=(0,o.default)(arguments,1)),a[e]=n,r(t)}))}),(function(t){r(t,a)}))};var n=a(r(308)),i=a(r(1240)),o=a(r(3033)),s=a(r(8993));function a(t){return t&&t.__esModule?t:{default:t}}t.exports=e.default},3111:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasNextTick=e.hasSetImmediate=void 0,e.fallback=c,e.wrap=l;var n,i=r(3033),o=(n=i)&&n.__esModule?n:{default:n};var s,a=e.hasSetImmediate="function"==typeof setImmediate&&setImmediate,u=e.hasNextTick="object"==typeof process&&"function"==typeof process.nextTick;function c(t){setTimeout(t,0)}function l(t){return function(e){var r=(0,o.default)(arguments,1);t((function(){e.apply(null,r)}))}}s=a?setImmediate:u?process.nextTick:c,e.default=l(s)},3033:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){e|=0;for(var r=Math.max(t.length-e,0),n=Array(r),i=0;i0?s-4:s;for(r=0;r>16&255,c[l++]=e>>8&255,c[l++]=255&e;2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e);1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3173:function(t){"use strict";for(var e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<32;n++){var i=e.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function o(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=o(e)^n>>5}for(e=o(e),r=0;re)return"Exceeds length limit";var n=t.toLowerCase(),i=t.toUpperCase();if(t!==n&&t!==i)return"Mixed-case string "+t;var a=(t=n).lastIndexOf("1");if(-1===a)return"No separator character for "+t;if(0===a)return"Missing prefix for "+t;var u=t.slice(0,a),c=t.slice(a+1);if(c.length<6)return"Data too short";var l=s(u);if("string"==typeof l)return l;for(var f=[],h=0;h=c.length||f.push(p)}return 1!==l?"Invalid checksum for "+t:{prefix:u,words:f}}function u(t,e,r,n){for(var i=0,o=0,s=(1<=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<=e)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var i=s(t=t.toLowerCase());if("string"==typeof i)throw new Error(i);for(var a=t+"1",u=0;u>5!=0)throw new Error("Non 5-bit word");i=o(i)^c,a+=e.charAt(c)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){a+=e.charAt(i>>5*(5-u)&31)}return a},toWordsUnsafe:function(t){var e=u(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=u(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=u(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=u(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},3550:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(x){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:l[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,c=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,R=0|s[6],I=8191&R,P=R>>>13,C=0|s[7],T=8191&C,O=C>>>13,N=0|s[8],B=8191&N,L=N>>>13,j=0|s[9],q=8191&j,U=j>>>13,F=0|a[0],D=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,Z=W>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(h,D)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,z))+Math.imul(m,D)|0,o=Math.imul(m,z);var yt=(c+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,D),i=(i=Math.imul(y,z))+Math.imul(v,D)|0,o=Math.imul(v,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,z))+Math.imul(_,D)|0,o=Math.imul(_,z),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,z))+Math.imul(E,D)|0,o=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Q)|0;var wt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,D),i=(i=Math.imul(k,z))+Math.imul(S,D)|0,o=Math.imul(S,z),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,z))+Math.imul(P,D)|0,o=Math.imul(P,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(c+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,D),i=(i=Math.imul(T,z))+Math.imul(O,D)|0,o=Math.imul(O,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var At=(c+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,D),i=(i=Math.imul(B,z))+Math.imul(L,D)|0,o=Math.imul(L,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Q)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Et=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,D),i=(i=Math.imul(q,z))+Math.imul(U,D)|0,o=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,K),i=(i=Math.imul(q,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(y,ft)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ht)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(q,V),i=(i=Math.imul(q,Z))+Math.imul(U,V)|0,o=Math.imul(U,Z),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Q)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(q,Y),i=(i=Math.imul(q,Q))+Math.imul(U,Y)|0,o=Math.imul(U,Q),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,$),i=(i=Math.imul(q,tt))+Math.imul(U,$)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,ht)|0;var It=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,rt),i=(i=Math.imul(q,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,ot),i=(i=Math.imul(q,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ht)|0;var Ct=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(q,ut),i=(i=Math.imul(q,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0;var Tt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,ft),i=(i=Math.imul(q,ht))+Math.imul(U,ft)|0,o=Math.imul(U,ht);var Ot=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(q,pt))|0)+((8191&(i=(i=Math.imul(q,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Rt,u[13]=It,u[14]=Pt,u[15]=Ct,u[16]=Tt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new A(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(b,v),b.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new b;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return y[t]=e,e},A.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,A),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},7376:function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;rs)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),n=a(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(D(t,Uint8Array)){var e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return h(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(D(t,ArrayBuffer)||t&&D(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(D(t,SharedArrayBuffer)||t&&D(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var i=function(t){if(u.isBuffer(t)){var e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||z(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(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 f(t){return l(t),a(t<0?0:0|p(t))}function h(t){for(var e=t.length<0?0:0|p(t.length),r=a(e),n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||D(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 r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(t).length;default:if(i)return n?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return k(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function k(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return function(t){var e=t.length;if(e<=S)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nn.length?u.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.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 e=0;er&&(t+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(D(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),l=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return M(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function N(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function D(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function z(t){return t!=t}var H=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},584:function(t){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},1924:function(t,e,r){"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},5559:function(t,e,r){"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(h){c=null}t.exports=function(t){var e=a(n,s,arguments);u&&c&&(u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}));return e};var f=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},1027:function(t,e,r){var n=r(9509).Buffer,i=r(2830).Transform,o=r(6941).s;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(5717)(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},7866:function(t,e){!function(){"use strict";function t(e,r,n,i){return this instanceof t?(this.domain=e||void 0,this.path=r||"/",this.secure=!!n,this.script=!!i,this):new t(e,r,n,i)}function r(t,e,n){return t instanceof r?t:this instanceof r?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(n||"/"),this.explicit_path=!1,this.domain=e||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,t&&this.parse(t,e,n),this):new r(t,e,n)}t.All=Object.freeze(Object.create(null)),e.CookieAccessInfo=t,e.Cookie=r,r.prototype.toString=function(){var t=[this.name+"="+this.value];return this.expiration_date!==1/0&&t.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&t.push("domain="+this.domain),this.path&&t.push("path="+this.path),this.secure&&t.push("secure"),this.noscript&&t.push("httponly"),t.join("; ")},r.prototype.toValueString=function(){return this.name+"="+this.value};var n=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function i(){var t,e;return this instanceof i?(t=Object.create(null),this.setCookie=function(n,i,o){var s,a;if(s=(n=new r(n,i,o)).expiration_date<=Date.now(),void 0!==t[n.name]){for(e=t[n.name],a=0;a32768)return void console.warn("Cookie too long for parsing (>32768 characters)");var i,o=t.split(";").filter((function(t){return!!t})),s=o[0].match(/([^=]+)=([\s\S]*)/);if(!s)return void console.warn("Invalid cookie header encountered. Header: '"+t+"'");var a=s[1],u=s[2];if("string"!=typeof a||0===a.length||"string"!=typeof u)return void console.warn("Unable to extract values from cookie header. Cookie: '"+t+"'");for(this.name=a,this.value=u,i=1;i2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;af)&&(o[u]=f,d.push(u,f),i[u]=a));if(void 0!==n&&void 0===o[n]){var p=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,r,n){var i=e.single_source_shortest_paths(t,r,n);return e.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(t){var r,n=e.PriorityQueue,i={};for(r in t=t||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=t.sorter||n.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e},6266:function(t,e,r){"use strict";var n=e;n.version=r(8597).i8,n.utils=r(953),n.rand=r(7376),n.curve=r(8254),n.curves=r(5427),n.ec=r(7954),n.eddsa=r(5980)},4918:function(t,e,r){"use strict";var n=r(3550),i=r(953),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=s;l--)u=(u<<1)+n[l];c.push(u)}for(var f=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s=0;c--){for(var l=0;c>=0&&0===s[c];c--)l++;if(c>=0&&l++,u=u.dblp(l),c<0)break;var f=s[c];a(0!==f),u="affine"===t.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,c,l=this._wnafT1,f=this._wnafT2,h=this._wnafT3,d=0;for(a=0;a=1;a-=2){var m=a-1,g=a;if(1===l[m]&&1===l[g]){var y=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(y[1]=e[m].add(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].add(e[g].neg())):(y[1]=e[m].toJ().mixedAdd(e[g]),y[2]=e[m].toJ().mixedAdd(e[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=s(r[m],r[g]);for(d=Math.max(b[0].length,d),h[m]=new Array(d),h[g]=new Array(d),u=0;u=0;a--){for(var E=0;a>=0;){var x=!0;for(u=0;u=0&&E++,M=M.dblp(E),a<0)break;for(u=0;u0?c=f[u][k-1>>1]:k<0&&(c=f[u][-k-1>>1].neg()),M="affine"===c.type?M.mixedAdd(c):M.add(c))}}for(a=0;a=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),u=i.redMul(s),c=o.redMul(a),l=i.redMul(a),f=s.redMul(o);return this.curve.point(u,c,f,l)},c.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),e=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),t=s.redSub(a).redISub(u).redMul(o),e=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(e),c=o.redMul(s),l=a.redMul(u),f=o.redMul(u),h=s.redMul(a);return this.curve.point(c,l,h,f)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),f=n.redMul(u).redMul(l);return this.curve.twisted?(e=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(e=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(f,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},8254:function(t,e,r){"use strict";var n=e;n.base=r(4918),n.short=r(6673),n.mont=r(2881),n.edwards=r(1138)},2881:function(t,e,r){"use strict";var n=r(3550),i=r(5717),o=r(4918),s=r(953);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},6673:function(t,e,r){"use strict";var n=r(953),i=r(3550),o=r(5717),s=r(4918),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,c,l,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,d=this.n.clone(),p=new i(1),m=new i(0),g=new i(0),y=new i(1),v=0;0!==h.cmpn(0);){var b=d.div(h);c=d.sub(b.mul(h)),l=g.sub(b.mul(p));var w=y.sub(b.mul(m));if(!n&&c.cmp(f)<0)e=u.neg(),r=p,n=c.neg(),o=l;else if(n&&2==++v)break;u=c,d=h,h=c,g=p,p=l,y=m,m=w}s=c.neg(),a=l;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(c).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new l(this,t,e,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),f=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),l=r.redMul(u),f=a.redSqr().redIAdd(c).redISub(l).redISub(l),h=a.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},5427:function(t,e,r){"use strict";var n,i=e,o=r(3715),s=r(8254),a=r(953).assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(1037)}catch(l){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},7954:function(t,e,r){"use strict";var n=r(3550),i=r(2156),o=r(953),s=r(5427),a=r(7376),u=o.assert,c=r(1251),l=r(611);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new c(this,t)},f.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),c=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),f=this.n.sub(new n(1)),h=0;;h++){var d=o.k?o.k(h):new n(c.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(f)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var y=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new l({r:g,s:y,recoveryParam:v})}}}}}},f.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new l(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),c=u.mul(t).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new l(e,i);var o=this.n,s=new n(t),a=e.r,c=e.s,f=1&r,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=c.mul(d).umod(o);return this.g.mulAdd(p,a,m)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new l(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},1251:function(t,e,r){"use strict";var n=r(3550),i=r(953).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},611:function(t,e,r){"use strict";var n=r(3550),i=r(953),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;var c=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var l=u(t,r);if(!1===l)return!1;if(t.length!==l+r.place)return!1;var f=t.slice(r.place,l+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];l(n,e.length),(n=n.concat(e)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,t)}},5980:function(t,e,r){"use strict";var n=r(3715),i=r(5427),o=r(953),s=o.assert,a=o.parseBytes,u=r(9087),c=r(3622);function l(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof l))return new l(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=l,l.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},l.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var t=this.hash(),e=0;e(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,c=e.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0==(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},8091:function(t){"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;nt+e,o=["sync","latest"];function s(t){return Number.parseInt(t,16)}t.exports=class extends n{constructor(t={}){super(),this._blockResetDuration=t.blockResetDuration||2e4,this._blockResetTimeout,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){if(this._currentBlock)return this._currentBlock;return await new Promise((t=>this.once("latest",t)))}removeAllListeners(t){t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t,e){o.includes(t)&&this._maybeStart()}_onRemoveListener(t,e){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return o.map((t=>this.listenerCount(t))).reduce(i)}_newPotentialLatest(t){const e=this._currentBlock;e&&s(t)<=s(e)||this._setCurrentBlock(t)}_setCurrentBlock(t){const e=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:e,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}},5012:function(t,e,r){const n=r(2352),i=r(2696);function o(t,e){return new Promise((r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()}))}t.exports=class extends i{constructor(t={}){if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");const e=t.pollingInterval||2e4,r=t.retryTimeout||e/10,n=void 0===t.keepEventLoopActive||t.keepEventLoopActive,i=t.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:e},t)),this._provider=t.provider,this._pollingInterval=e,this._retryTimeout=r,this._keepEventLoopActive=n,this._setSkipCacheFlag=i}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch((t=>this.emit("error",t)))}async _performSync(){for(;this._isRunning;)try{await this._updateLatestBlock(),await o(this._pollingInterval,!this._keepEventLoopActive)}catch(t){const r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${t.stack}`);try{this.emit("error",r)}catch(e){console.error(r)}await o(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0);const e=await n((e=>this._provider.sendAsync(t,e)))();if(e.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${e.error}`);return e.result}}},3256:function(t,e,r){const n=r(6622);t.exports=class extends n{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}}},6622:function(t,e,r){const n=r(9394).default;t.exports=class extends n{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach((t=>this.emit("update",t)))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}}},2785:function(t,e,r){const n=r(6622),i=r(207),{incrementHexInt:o}=r(8112);t.exports=class extends n{constructor({provider:t,params:e}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:e}){const r=e,n=o(t),s=(await i({provider:this.provider,fromBlock:n,toBlock:r})).map((t=>t.hash));this.addResults(s)}}},207:function(t){function e(t){return null==t?t:Number.parseInt(t,16)}function r(t){if(null==t)return t;return"0x"+t.toString(16)}t.exports=async function({provider:t,fromBlock:n,toBlock:i}){n||(n=i);const o=e(n),s=e(i),a=Array(s-o+1).fill().map(((t,e)=>o+e)).map(r);return await Promise.all(a.map((e=>function(t,e,r){return new Promise(((n,i)=>{t.sendAsync({id:1,jsonrpc:"2.0",method:e,params:r},((t,e)=>{if(t)return i(t);n(e.result)}))}))}(t,"eth_getBlockByNumber",[e,!1]))))}},8112:function(t){function e(t){return t.sort(((t,e)=>"latest"===t||"earliest"===e?1:"latest"===e||"earliest"===t?-1:r(t)-r(e)))}function r(t){return null==t?t:Number.parseInt(t,16)}function n(t){if(null==t)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function i(){return Math.floor(16*Math.random()).toString(16)}t.exports={minBlockRef:function(...t){return e(t)[0]},maxBlockRef:function(...t){const r=e(t);return r[r.length-1]},sortBlockRefs:e,bnToHex:function(t){return"0x"+t.toString(16)},blockRefIsNumber:function(t){return t&&!["earliest","latest","pending"].includes(t)},hexToInt:r,incrementHexInt:function(t){if(null==t)return t;return n(r(t)+1)},intToHex:n,unsafeRandomBytes:function(t){let e="0x";for(let r=0;r{const r=await t(...e);return c(r.id)}))}function h(t){return i((async(e,r)=>{const n=await t.apply(null,e.params);r.result=n}))}function d(t,e){const r=[];for(let n in t)r.push(t[n]);return r}t.exports=function({blockTracker:t,provider:e}){let r=0,i={};const p=new n,m=function({mutex:t}){return e=>async(r,n,i,o)=>{(await t.acquire())(),e(r,n,i,o)}}({mutex:p}),g=o({eth_newFilter:m(f(v)),eth_newBlockFilter:m(f(b)),eth_newPendingTransactionFilter:m(f(w)),eth_uninstallFilter:m(h(A)),eth_getFilterChanges:m(h(_)),eth_getFilterLogs:m(h(M))}),y=async({oldBlock:t,newBlock:e})=>{if(0===i.length)return;const r=await p.acquire();try{await Promise.all(d(i).map((async r=>{try{await r.update({oldBlock:t,newBlock:e})}catch(n){console.error(n)}})))}catch(n){console.error(n)}r()};return g.newLogFilter=v,g.newBlockFilter=b,g.newPendingTransactionFilter=w,g.uninstallFilter=A,g.getFilterChanges=_,g.getFilterLogs=M,g.destroy=()=>{!async function(){const t=d(i).length;i={},x({prevFilterCount:t,newFilterCount:0})}()},g;async function v(t){const r=new s({provider:e,params:t});await E(r);return r}async function b(){const t=new a({provider:e});await E(t);return t}async function w(){const t=new u({provider:e});await E(t);return t}async function _(t){const e=l(t),r=i[e];if(!r)throw new Error(`No filter for index "${e}"`);return r.getChangesAndClear()}async function M(t){const e=l(t),r=i[e];if(!r)throw new Error(`No filter for index "${e}"`);return"log"===r.type?results=r.getAllResults():results=[],results}async function A(t){const e=l(t),r=i[e],n=Boolean(r);return n&&await async function(t){const e=d(i).length;delete i[t];const r=d(i).length;x({prevFilterCount:e,newFilterCount:r})}(e),n}async function E(e){const n=d(i).length,o=await t.getLatestBlock();await e.initialize({currentBlock:o}),r++,i[r]=e,e.id=r,e.idHex=c(r);return x({prevFilterCount:n,newFilterCount:d(i).length}),r}function x({prevFilterCount:e,newFilterCount:r}){0===e&&r>0?t.on("sync",y):e>0&&0===r&&t.removeListener("sync",y)}}},1663:function(t,e,r){const n=r(5682),i=r(6417),o=r(3256),{bnToHex:s,hexToInt:a,incrementHexInt:u,minBlockRef:c,blockRefIsNumber:l}=r(8112);t.exports=class extends o{constructor({provider:t,params:e}){super(),this.type="log",this.ethQuery=new n(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},e),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((t=>t.toLowerCase())))}async initialize({currentBlock:t}){let e=this.params.fromBlock;["latest","pending"].includes(e)&&(e=t),"earliest"===e&&(e="0x0"),this.params.fromBlock=e;const r=c(this.params.toBlock,t),n=Object.assign({},this.params,{toBlock:r}),i=await this._fetchLogs(n);this.addInitialResults(i)}async update({oldBlock:t,newBlock:e}){const r=e;let n;n=t?u(t):e;const i=Object.assign({},this.params,{fromBlock:n,toBlock:r}),o=(await this._fetchLogs(i)).filter((t=>this.matchLog(t)));this.addResults(o)}async _fetchLogs(t){return await i((e=>this.ethQuery.getLogs(t,e)))()}matchLog(t){if(a(this.params.fromBlock)>=a(t.blockNumber))return!1;if(l(this.params.toBlock)&&a(this.params.toBlock)<=a(t.blockNumber))return!1;const e=t.address&&t.address.toLowerCase();if(this.params.address&&e&&!this.params.address.includes(e))return!1;return this.params.topics.every(((e,r)=>{let n=t.topics[r];if(!n)return!1;n=n.toLowerCase();let i=Array.isArray(e)?e:[e];if(i.includes(null))return!0;i=i.map((t=>t.toLowerCase()));return i.includes(n)}))}}},5232:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EthereumProviderError=e.EthereumRpcError=void 0;const n=r(4445);class i extends Error{constructor(t,e,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=t,void 0!==r&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return n.default(this.serialize(),o,2)}}e.EthereumRpcError=i;function o(t,e){if("[Circular]"!==e)return e}e.EthereumProviderError=class extends i{constructor(t,e,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,r)}}},4971:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.errorValues=e.errorCodes=void 0,e.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},e.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},6339:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ethErrors=void 0;const n=r(5232),i=r(1299),o=r(4971);function s(t,e){const[r,o]=u(e);return new n.EthereumRpcError(t,r||i.getMessageFromCode(t),o)}function a(t,e){const[r,o]=u(e);return new n.EthereumProviderError(t,r||i.getMessageFromCode(t),o)}function u(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}e.ethErrors={rpc:{parse:t=>s(o.errorCodes.rpc.parse,t),invalidRequest:t=>s(o.errorCodes.rpc.invalidRequest,t),invalidParams:t=>s(o.errorCodes.rpc.invalidParams,t),methodNotFound:t=>s(o.errorCodes.rpc.methodNotFound,t),internal:t=>s(o.errorCodes.rpc.internal,t),server:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(e,t)},invalidInput:t=>s(o.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>s(o.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>s(o.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>s(o.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>s(o.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>s(o.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>a(o.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>a(o.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>a(o.errorCodes.provider.unsupportedMethod,t),disconnected:t=>a(o.errorCodes.provider.disconnected,t),chainDisconnected:t=>a(o.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:i}=t;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(e,r,i)}}}},9313:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const n=r(5232);Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const i=r(1299);Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});const o=r(6339);Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const s=r(4971);Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})},1299:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(4971),i=r(5232),o=n.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",a={code:o,message:u(o)};function u(t,r=s){if(Number.isInteger(t)){const r=t.toString();if(h(n.errorValues,r))return n.errorValues[r].message;if(l(t))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function c(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!n.errorValues[e]||!!l(t)}function l(t){return t>=-32099&&t<=-32e3}function f(t){return t&&"object"==typeof t&&!Array.isArray(t)?Object.assign({},t):t}function h(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=u,e.isValidCode=c,e.serializeError=function(t,{fallbackError:e=a,shouldIncludeStack:r=!1}={}){var n,o;if(!e||!Number.isInteger(e.code)||"string"!=typeof e.message)throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof i.EthereumRpcError)return t.serialize();const s={};if(t&&"object"==typeof t&&!Array.isArray(t)&&h(t,"code")&&c(t.code)){const e=t;s.code=e.code,e.message&&"string"==typeof e.message?(s.message=e.message,h(e,"data")&&(s.data=e.data)):(s.message=u(s.code),s.data={originalError:f(t)})}else{s.code=e.code;const r=null===(n=t)||void 0===n?void 0:n.message;s.message=r&&"string"==typeof r?r:e.message,s.data={originalError:f(t)}}const l=null===(o=t)||void 0===o?void 0:o.stack;return r&&t&&l&&"string"==typeof l&&(s.stack=l),s}},6739:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.JsonRpcEngine=void 0;const i=n(r(9394)),o=r(9313);class s extends i.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,e){if(e&&"function"!=typeof e)throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?e?this._handleBatch(t,e):this._handleBatch(t):e?this._handle(t,e):this._promiseHandle(t)}asMiddleware(){return async(t,e,r,n)=>{try{const[i,o,a]=await s._runAllMiddleware(t,e,this._middleware);return o?(await s._runReturnHandlers(a),n(i)):r((async t=>{try{await s._runReturnHandlers(a)}catch(e){return t(e)}return t()}))}catch(i){return n(i)}}}async _handleBatch(t,e){try{const r=await Promise.all(t.map(this._promiseHandle.bind(this)));return e?e(null,r):r}catch(r){if(e)return e(r);throw r}}_promiseHandle(t){return new Promise((e=>{this._handle(t,((t,r)=>{e(r)}))}))}async _handle(t,e){if(!t||Array.isArray(t)||"object"!=typeof t){const r=new o.EthereumRpcError(o.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof t,{request:t});return e(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!=typeof t.method){const r=new o.EthereumRpcError(o.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof t.method,{request:t});return e(r,{id:t.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},t),n={id:r.id,jsonrpc:r.jsonrpc};let i=null;try{await this._processRequest(r,n)}catch(s){i=s}return i&&(delete n.result,n.error||(n.error=o.serializeError(i))),e(i,n)}async _processRequest(t,e){const[r,n,i]=await s._runAllMiddleware(t,e,this._middleware);if(s._checkForCompletion(t,e,n),await s._runReturnHandlers(i),r)throw r}static async _runAllMiddleware(t,e,r){const n=[];let i=null,o=!1;for(const a of r)if([i,o]=await s._runMiddleware(t,e,a,n),o)break;return[i,o,n.reverse()]}static _runMiddleware(t,e,r,n){return new Promise((i=>{const s=t=>{const r=t||e.error;r&&(e.error=o.serializeError(r)),i([r,!0])},u=r=>{e.error?s(e.error):(r&&("function"!=typeof r&&s(new o.EthereumRpcError(o.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${a(t)}`,{request:t})),n.push(r)),i([null,!1]))};try{r(t,e,u,s)}catch(c){s(c)}}))}static async _runReturnHandlers(t){for(const e of t)await new Promise(((t,r)=>{e((e=>e?r(e):t()))}))}static _checkForCompletion(t,e,r){if(!("result"in e)&&!("error"in e))throw new o.EthereumRpcError(o.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${a(t)}`,{request:t});if(!r)throw new o.EthereumRpcError(o.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${a(t)}`,{request:t})}}function a(t){return JSON.stringify(t,null,2)}e.JsonRpcEngine=s},1152:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAsyncMiddleware=void 0,e.createAsyncMiddleware=function(t){return async(e,r,n,i)=>{let o;const s=new Promise((t=>{o=t}));let a=null,u=!1;const c=async()=>{u=!0,n((t=>{a=t,o()})),await s};try{await t(e,r,c),u?(await s,a(null)):i(null)}catch(l){a?a(l):i(l)}}}},4980:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createScaffoldMiddleware=void 0,e.createScaffoldMiddleware=function(t){return(e,r,n,i)=>{const o=t[e.method];return void 0===o?n():"function"==typeof o?o(e,r,n,i):(r.result=o,i())}}},1084:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getUniqueId=void 0;const r=4294967295;let n=Math.floor(Math.random()*r);e.getUniqueId=function(){return n=(n+1)%r,n}},8104:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createIdRemapMiddleware=void 0;const n=r(1084);e.createIdRemapMiddleware=function(){return(t,e,r,i)=>{const o=t.id,s=n.getUniqueId();t.id=s,e.id=s,r((r=>{t.id=o,e.id=o,r()}))}}},8320:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8104),e),i(r(1152),e),i(r(4980),e),i(r(1084),e),i(r(6739),e),i(r(8175),e)},8175:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mergeMiddleware=void 0;const n=r(6739);e.mergeMiddleware=function(t){const e=new n.JsonRpcEngine;return t.forEach((t=>e.push(t))),e.asMiddleware()}},6417:function(t){"use strict";const e=(t,e,r,n)=>function(...i){return new(0,e.promiseModule)(((o,s)=>{e.multiArgs?i.push(((...t)=>{e.errorFirst?t[0]?s(t):(t.shift(),o(t)):o(t)})):e.errorFirst?i.push(((t,e)=>{t?s(t):o(e)})):i.push(o);const a=this===r?n:this;Reflect.apply(t,a,i)}))},r=new WeakMap;t.exports=(t,n)=>{n={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...n};const i=typeof t;if(null===t||"object"!==i&&"function"!==i)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===t?"null":i}\``);const o=new WeakMap,s=new Proxy(t,{apply(t,r,i){const a=o.get(t);if(a)return Reflect.apply(a,r,i);const u=n.excludeMain?t:e(t,n,s,t);return o.set(t,u),Reflect.apply(u,r,i)},get(t,i){const a=t[i];if(!((t,e)=>{let i=r.get(t);if(i||(i={},r.set(t,i)),e in i)return i[e];const o=t=>"string"==typeof t||"symbol"==typeof e?e===t:t.test(e),s=Reflect.getOwnPropertyDescriptor(t,e),a=void 0===s||s.writable||s.configurable,u=(n.include?n.include.some(o):!n.exclude.some(o))&&a;return i[e]=u,u})(t,i)||a===Function.prototype[i])return a;const u=o.get(a);if(u)return u;if("function"==typeof a){const r=e(a,n,s,t);return o.set(a,r),r}return a}});return s}},8961:function(t,e,r){const n=r(9394).default,i=r(7688),{createAsyncMiddleware:o}=r(8320),s=r(8406),{unsafeRandomBytes:a,incrementHexInt:u}=r(8112),c=r(207);function l(t){return{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}t.exports=function({blockTracker:t,provider:e}){const r={},f=s({blockTracker:t,provider:e});let h=!1;const d=new n,p=i({eth_subscribe:o((async function(n,i){if(h)throw new Error("SubscriptionManager - attempting to use after destroying");const o=n.params[0],s=a(16);let d;switch(o){case"newHeads":d=p({subId:s});break;case"logs":const t=n.params[1];d=g({subId:s,filter:await f.newLogFilter(t)});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${o}"`)}return r[s]=d,void(i.result=s);function p({subId:r}){const n={type:o,destroy:async()=>{t.removeListener("sync",n.update)},update:async({oldBlock:t,newBlock:n})=>{const i=n,o=u(t);(await c({provider:e,fromBlock:o,toBlock:i})).map(l).forEach((t=>{m(r,t)}))}};return t.on("sync",n.update),n}function g({subId:t,filter:e}){e.on("update",(e=>m(t,e)));return{type:o,destroy:async()=>await f.uninstallFilter(e.idHex)}}})),eth_unsubscribe:o((async function(t,e){if(h)throw new Error("SubscriptionManager - attempting to use after destroying");const n=t.params[0],i=r[n];if(!i)return void(e.result=!1);delete r[n],await i.destroy(),e.result=!0}))});return p.destroy=function(){d.removeAllListeners();for(const t in r)r[t].destroy(),delete r[t];h=!0},{events:d,middleware:p};function m(t,e){d.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:t,result:e}})}}},5792:function(t,e,r){const n=r(6622),i=r(207),{incrementHexInt:o}=r(8112);t.exports=class extends n{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const e=t,r=o(t),n=await i({provider:this.provider,fromBlock:r,toBlock:e}),s=[];for(const i of n)s.push(...i.transactions);this.addResults(s)}}},7870:function(t,e,r){const n=r(1625),i=r(1497),o=[void 0,null,""];t.exports=function(t={}){const{blockTracker:e}=t;if(!e)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");const r=new s,o={perma:r,block:r,fork:r};return i((async(t,i,s)=>{if(t.skipCache)return s();const a=n.cacheTypeForPayload(t),u=o[a];if(!u)return s();if(!u.canCacheRequest(t))return s();let c,l=n.blockTagForPayload(t);if(l||(l="latest"),"earliest"===l)c="0x00";else if("latest"===l){const t=await e.getLatestBlock();r.clearBefore(t),c=t}else c=l;const f=await u.get(t,c);void 0===f?(await s(),await u.set(t,c,i.result)):i.result=f}))};class s{constructor(){this.cache={}}getBlockCacheForPayload(t,e){const r=Number.parseInt(e,16);let n=this.cache[r];if(!n){const t={};this.cache[r]=t,n=t}return n}async get(t,e){const r=this.getBlockCacheForPayload(t,e);if(!r)return;return r[n.cacheIdentifierForPayload(t,!0)]}async set(t,e,r){if(!this.canCacheResult(t,r))return;this.getBlockCacheForPayload(t,e)[n.cacheIdentifierForPayload(t,!0)]=r}canCacheRequest(t){if(!n.canCache(t))return!1;return"pending"!==n.blockTagForPayload(t)}canCacheResult(t,e){if(!o.includes(e))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(t.method)||e&&e.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==e.blockHash)}clearBefore(t){const e=this,r=Number.parseInt(t,16);Object.keys(e.cache).map(Number).filter((t=>tdelete e.cache[t]))}}},1625:function(t,e,r){const n=r(7266);function i(t){return"never"!==a(t)}function o(t){const e=s(t);return e>=t.params.length?t.params:"eth_getBlockByNumber"===t.method?t.params.slice(1):t.params.slice(0,e)}function s(t){switch(t.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function a(t){switch(t.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}t.exports={cacheIdentifierForPayload:function(t,e){const r=e?o(t):t.params;return i(t)?t.method+":"+n(r):null},canCache:i,blockTagForPayload:function(t){let e=s(t);if(e>=t.params.length)return null;return t.params[e]},paramsWithoutBlockTag:o,blockTagParamIndex:s,cacheTypeForPayload:a}},7688:function(t,e,r){t.exports=r(2121)},5682:function(t,e,r){const n=r(7529),i=r(3420)();function o(t){this.currentProvider=t}function s(t){return function(){var e=[].slice.call(arguments),r=e.pop();this.sendAsync({method:t,params:e},r)}}function a(t,e){return function(){var r=[].slice.call(arguments),n=r.pop();r.length0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]r)throw new Error("Elements exceed array size: "+r);for(h in a=[],t=t.slice(0,t.lastIndexOf("[")),"string"==typeof e&&(e=JSON.parse(e)),e)a.push(d(t,e[h]));if("dynamic"===r){var p=d("uint256",e.length);a.unshift(p)}return n.concat(a)}if("bytes"===t)return e=n.from(e),a=n.concat([d("uint256",e.length),e]),e.length%32!=0&&(a=n.concat([a,i.zeros(32-e.length%32)])),a;if(t.startsWith("bytes")){if((r=u(t))<1||r>32)throw new Error("Invalid bytes width: "+r);return i.setLengthRight(e,32)}if(t.startsWith("uint")){if((r=u(t))%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if((s=f(e)).bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+s.bitLength());if(s<0)throw new Error("Supplied uint is negative");return s.toArrayLike(n,"be",32)}if(t.startsWith("int")){if((r=u(t))%8||r<8||r>256)throw new Error("Invalid int width: "+r);if((s=f(e)).bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+s.bitLength());return s.toTwos(256).toArrayLike(n,"be",32)}if(t.startsWith("ufixed")){if(r=c(t),(s=f(e))<0)throw new Error("Supplied ufixed is negative");return d("uint256",s.mul(new o(2).pow(new o(r[1]))))}if(t.startsWith("fixed"))return r=c(t),d("int256",f(e).mul(new o(2).pow(new o(r[1]))));throw new Error("Unsupported or invalid type: "+t)}function p(t,e,r){var i,s,a,u;if("string"==typeof t&&(t=m(t)),"address"===t.name)return p(t.rawType,e,r).toArrayLike(n,"be",20).toString("hex");if("bool"===t.name)return p(t.rawType,e,r).toString()===new o(1).toString();if("string"===t.name){var c=p(t.rawType,e,r);return n.from(c,"utf8").toString()}if(t.isArray){for(a=[],i=t.size,"dynamic"===t.size&&(r=p("uint256",e,r).toNumber(),i=p("uint256",e,r).toNumber(),r+=32),u=0;ut.size)throw new Error("Decoded int exceeds width: "+t.size+" vs "+s.bitLength());return s}if(t.name.startsWith("int")){if((s=new o(e.slice(r,r+32),16,"be").fromTwos(256)).bitLength()>t.size)throw new Error("Decoded uint exceeds width: "+t.size+" vs "+s.bitLength());return s}if(t.name.startsWith("ufixed")){if(i=new o(2).pow(new o(t.size[1])),!(s=p("uint256",e,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return s.div(i)}if(t.name.startsWith("fixed")){if(i=new o(2).pow(new o(t.size[1])),!(s=p("int256",e,r)).mod(i).isZero())throw new Error("Decimals not supported yet");return s.div(i)}throw new Error("Unsupported or invalid type: "+t.name)}function m(t){var e,r,n;if(y(t)){e=l(t);var i=t.slice(0,t.lastIndexOf("["));return i=m(i),r={isArray:!0,name:t,size:e,memoryUsage:"dynamic"===e?32:i.memoryUsage*e,subArray:i}}switch(t){case"address":n="uint160";break;case"bool":n="uint8";break;case"string":n="bytes"}if(r={rawType:n,name:t,memoryUsage:32},t.startsWith("bytes")&&"bytes"!==t||t.startsWith("uint")||t.startsWith("int")?r.size=u(t):(t.startsWith("ufixed")||t.startsWith("fixed"))&&(r.size=c(t)),t.startsWith("bytes")&&"bytes"!==t&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((t.startsWith("uint")||t.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function g(t){return"string"===t||"bytes"===t||"dynamic"===l(t)}function y(t){return t.lastIndexOf("]")===t.length-1}function v(t,e){return t.startsWith("address")||t.startsWith("bytes")?"0x"+e.toString("hex"):e.toString()}s.eventID=function(t,e){var r=t+"("+e.map(a).join(",")+")";return i.keccak256(n.from(r))},s.methodID=function(t,e){return s.eventID(t,e).slice(0,4)},s.rawEncode=function(t,e){var r=[],i=[],o=0;t.forEach((function(t){if(y(t)){var e=l(t);o+="dynamic"!==e?32*e:32}else o+=32}));for(var s=0;sh)throw new Error("Elements exceed array size: "+h)}var d=e.map((function(t){return s.solidityHexValue(c,t,256)}));return n.concat(d)}if("bytes"===t)return e;if("string"===t)return n.from(e,"utf8");if("bool"===t){r=r||8;var p=Array(r/4).join("0");return n.from(e?p+"1":p+"0","hex")}if("address"===t){var m=20;return r&&(m=r/8),i.setLengthLeft(e,m)}if(t.startsWith("bytes")){if((o=u(t))<1||o>32)throw new Error("Invalid bytes width: "+o);return i.setLengthRight(e,o)}if(t.startsWith("uint")){if((o=u(t))%8||o<8||o>256)throw new Error("Invalid uint width: "+o);if((a=f(e)).bitLength()>o)throw new Error("Supplied uint exceeds width: "+o+" vs "+a.bitLength());return r=r||o,a.toArrayLike(n,"be",r/8)}if(t.startsWith("int")){if((o=u(t))%8||o<8||o>256)throw new Error("Invalid int width: "+o);if((a=f(e)).bitLength()>o)throw new Error("Supplied int exceeds width: "+o+" vs "+a.bitLength());return r=r||o,a.toTwos(o).toArrayLike(n,"be",r/8)}throw new Error("Unsupported or invalid type: "+t)},s.solidityPack=function(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r=[],i=0;i="0"&&e<="9");)o+=t[s]-"0",s++;n=s-1,r.push(o)}else if("i"===i)r.push("int256");else{if("a"!==i)throw new Error("Unsupported or invalid type: "+i);r.push("int256[]")}}return r},s.toSerpent=function(t){for(var e=[],r=0;r=8?i+=t[s].toUpperCase():i+=t[s];return i},e.isValidChecksumAddress=function(t,r){return e.isValidAddress(t)&&e.toChecksumAddress(t,r)===t},e.generateAddress=function(t,e){t=u.toBuffer(t);var r=new a(e);return r.isZero()?c.rlphash([t,null]).slice(-20):c.rlphash([t,n.from(r.toArray())]).slice(-20)},e.generateAddress2=function(t,e,r){var o=u.toBuffer(t),s=u.toBuffer(e),a=u.toBuffer(r);return i(20===o.length),i(32===s.length),c.keccak256(n.concat([n.from("ff","hex"),o,s,c.keccak256(a)])).slice(-20)},e.isPrecompiled=function(t){var e=u.unpad(t);return 1===e.length&&e[0]>=1&&e[0]<=8},e.isValidPrivate=function(t){return s.privateKeyVerify(t)},e.isValidPublic=function(t,e){return void 0===e&&(e=!1),64===t.length?s.publicKeyVerify(n.concat([n.from([4]),t])):!!e&&s.publicKeyVerify(t)},e.pubToAddress=function(t,e){return void 0===e&&(e=!1),t=u.toBuffer(t),e&&64!==t.length&&(t=s.publicKeyConvert(t,!1).slice(1)),i(64===t.length),c.keccak(t).slice(-20)},e.publicToAddress=e.pubToAddress,e.privateToAddress=function(t){return e.publicToAddress(e.privateToPublic(t))},e.privateToPublic=function(t){return t=u.toBuffer(t),s.publicKeyCreate(t,!1).slice(1)},e.importPublic=function(t){return 64!==(t=u.toBuffer(t)).length&&(t=s.publicKeyConvert(t,!1).slice(1)),t}},7124:function(t,e,r){"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.baToJSON=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToHex=e.bufferToInt=e.toBuffer=e.stripZeros=e.unpad=e.setLengthRight=e.setLength=e.setLengthLeft=e.zeros=void 0;var i=r(884),o=r(3550);e.zeros=function(t){return n.allocUnsafe(t).fill(0)},e.setLengthLeft=function(t,r,n){void 0===n&&(n=!1);var i=e.zeros(r);return t=e.toBuffer(t),n?t.length0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t},e.stripZeros=e.unpad,e.toBuffer=function(t){if(!n.isBuffer(t))if(Array.isArray(t))t=n.from(t);else if("string"==typeof t){if(!i.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=n.from(i.padToEven(i.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=i.intToBuffer(t);else if(null==t)t=n.allocUnsafe(0);else if(o.isBN(t))t=t.toArrayLike(n);else{if(!t.toArray)throw new Error("invalid type");t=n.from(t.toArray())}return t},e.bufferToInt=function(t){return new o(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new o(t).fromTwos(256)},e.toUnsigned=function(t){return n.from(t.toTwos(256).toArray())},e.addHexPrefix=function(t){return"string"!=typeof t||i.isHexPrefixed(t)?t:"0x"+t},e.baToJSON=function(t){if(n.isBuffer(t))return"0x"+t.toString("hex");if(t instanceof Array){for(var r=[],i=0;i=o.length,"The field "+e.name+" must not have more "+e.length+" bytes")):e.allowZero&&0===o.length||!e.length||i(e.length===o.length,"The field "+e.name+" must have byte length of "+e.length),t.raw[r]=o}t._fields.push(e.name),Object.defineProperty(t,e.name,{enumerable:!0,configurable:!0,get:o,set:s}),e.default&&(t[e.name]=e.default),e.alias&&Object.defineProperty(t,e.alias,{enumerable:!1,configurable:!0,set:s,get:o})})),r)if("string"==typeof r&&(r=n.from(o.stripHexPrefix(r),"hex")),n.isBuffer(r)&&(r=s.decode(r)),Array.isArray(r)){if(r.length>t._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(e,r){t[t._fields[r]]=a.toBuffer(e)}))}else{if("object"!=typeof r)throw new Error("invalid data");var u=Object.keys(r);e.forEach((function(e){-1!==u.indexOf(e.name)&&(t[e.name]=r[e.name]),-1!==u.indexOf(e.alias)&&(t[e.alias]=r[e.alias])}))}}},3230:function(t,e,r){"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.ecdhUnsafe=e.ecdh=e.recover=e.verify=e.sign=e.signatureImportLax=e.signatureImport=e.signatureExport=e.signatureNormalize=e.publicKeyCombine=e.publicKeyTweakMul=e.publicKeyTweakAdd=e.publicKeyVerify=e.publicKeyConvert=e.publicKeyCreate=e.privateKeyTweakMul=e.privateKeyTweakAdd=e.privateKeyModInverse=e.privateKeyNegate=e.privateKeyImport=e.privateKeyExport=e.privateKeyVerify=void 0;var i=r(5053),o=r(8427),s=r(3646);e.privateKeyVerify=function(t){return 32===t.length&&i.privateKeyVerify(Uint8Array.from(t))},e.privateKeyExport=function(t,e){if(32!==t.length)throw new RangeError("private key length is invalid");var r=o.privateKeyExport(t,e);return s.privateKeyExport(t,r,e)},e.privateKeyImport=function(t){if(null!==(t=s.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error("couldn't import from DER format")},e.privateKeyNegate=function(t){return n.from(i.privateKeyNegate(Uint8Array.from(t)))},e.privateKeyModInverse=function(t){if(32!==t.length)throw new Error("private key length is invalid");return n.from(o.privateKeyModInverse(Uint8Array.from(t)))},e.privateKeyTweakAdd=function(t,e){return n.from(i.privateKeyTweakAdd(Uint8Array.from(t),e))},e.privateKeyTweakMul=function(t,e){return n.from(i.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(e)))},e.publicKeyCreate=function(t,e){return n.from(i.publicKeyCreate(Uint8Array.from(t),e))},e.publicKeyConvert=function(t,e){return n.from(i.publicKeyConvert(Uint8Array.from(t),e))},e.publicKeyVerify=function(t){return(33===t.length||65===t.length)&&i.publicKeyVerify(Uint8Array.from(t))},e.publicKeyTweakAdd=function(t,e,r){return n.from(i.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(e),r))},e.publicKeyTweakMul=function(t,e,r){return n.from(i.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(e),r))},e.publicKeyCombine=function(t,e){var r=[];return t.forEach((function(t){r.push(Uint8Array.from(t))})),n.from(i.publicKeyCombine(r,e))},e.signatureNormalize=function(t){return n.from(i.signatureNormalize(Uint8Array.from(t)))},e.signatureExport=function(t){return n.from(i.signatureExport(Uint8Array.from(t)))},e.signatureImport=function(t){return n.from(i.signatureImport(Uint8Array.from(t)))},e.signatureImportLax=function(t){if(0===t.length)throw new RangeError("signature length is invalid");var e=s.signatureImportLax(t);if(null===e)throw new Error("couldn't parse DER signature");return o.signatureImport(e)},e.sign=function(t,e,r){if(null===r)throw new TypeError("options should be an Object");var o=void 0;if(r){if(o={},null===r.data)throw new TypeError("options.data should be a Buffer");if(r.data){if(32!=r.data.length)throw new RangeError("options.data length is invalid");o.data=new Uint8Array(r.data)}if(null===r.noncefn)throw new TypeError("options.noncefn should be a Function");r.noncefn&&(o.noncefn=function(t,e,i,o,s){var a=null!=i?n.from(i):null,u=null!=o?n.from(o):null,c=n.from("");return r.noncefn&&(c=r.noncefn(n.from(t),n.from(e),a,u,s)),new Uint8Array(c)})}var s=i.ecdsaSign(Uint8Array.from(t),Uint8Array.from(e),o);return{signature:n.from(s.signature),recovery:s.recid}},e.verify=function(t,e,r){return i.ecdsaVerify(Uint8Array.from(e),Uint8Array.from(t),r)},e.recover=function(t,e,r,o){return n.from(i.ecdsaRecover(Uint8Array.from(e),r,Uint8Array.from(t),o))},e.ecdh=function(t,e){return n.from(i.ecdh(Uint8Array.from(t),Uint8Array.from(e),{}))},e.ecdhUnsafe=function(t,e,r){if(33!==t.length&&65!==t.length)throw new RangeError("public key length is invalid");if(32!==e.length)throw new RangeError("private key length is invalid");return n.from(o.ecdhUnsafe(Uint8Array.from(t),Uint8Array.from(e),r))}},3646:function(t,e,r){"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var i=n.from([48,129,211,2,1,1,4,32,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,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,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]),o=n.from([48,130,1,19,2,1,1,4,32,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,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,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,0,0]);e.privateKeyExport=function(t,e,r){void 0===r&&(r=!0);var s=n.from(r?i:o);return t.copy(s,r?8:9),e.copy(s,r?181:214),s},e.privateKeyImport=function(t){var e=t.length,r=0;if(e2)return null;if(e<(r+=1)+n)return null;var i=t[r+n-1]|(n>1?t[r+n-2]<<8:0);return e<(r+=n)+i||e32||ei)return null;if(2!==t[o++])return null;var a=t[o++];if(128&a){if(o+(s=a-128)>i)return null;for(;s>0&&0===t[o];o+=1,s-=1);for(a=0;s>0;o+=1,s-=1)a=(a<<8)+t[o]}if(a>i-o)return null;var u=o;if(o+=a,2!==t[o++])return null;var c=t[o++];if(128&c){if(o+(s=c-128)>i)return null;for(;s>0&&0===t[o];o+=1,s-=1);for(c=0;s>0;o+=1,s-=1)c=(c<<8)+t[o]}if(c>i-o)return null;var l=o;for(o+=c;a>0&&0===t[u];a-=1,u+=1);if(a>32)return null;var f=t.slice(u,u+a);for(f.copy(e,32-f.length);c>0&&0===t[l];c-=1,l+=1);if(c>32)return null;var h=t.slice(l,l+c);return h.copy(r,32-h.length),{r:e,s:r}}},8427:function(t,e,r){"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0});var i=r(3550),o=new(0,r(6266).ec)("secp256k1"),s=o.curve;e.privateKeyExport=function(t,e){void 0===e&&(e=!0);var r=new i(t);if(r.ucmp(s.n)>=0)throw new Error("couldn't export to DER format");var n=o.g.mul(r);return a(n.getX(),n.getY(),e)},e.privateKeyModInverse=function(t){var e=new i(t);if(e.ucmp(s.n)>=0||e.isZero())throw new Error("private key range is invalid");return e.invm(s.n).toArrayLike(n,"be",32)},e.signatureImport=function(t){var e=new i(t.r);e.ucmp(s.n)>=0&&(e=new i(0));var r=new i(t.s);return r.ucmp(s.n)>=0&&(r=new i(0)),n.concat([e.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},e.ecdhUnsafe=function(t,e,r){void 0===r&&(r=!0);var n=o.keyFromPublic(t),u=new i(e);if(u.ucmp(s.n)>=0||u.isZero())throw new Error("scalar was invalid (zero or overflow)");var c=n.pub.mul(u);return a(c.getX(),c.getY(),r)};var a=function(t,e,r){var i;return r?((i=n.alloc(33))[0]=e.isOdd()?3:2,t.toArrayLike(n,"be",32).copy(i,1)):((i=n.alloc(65))[0]=4,t.toArrayLike(n,"be",32).copy(i,1),e.toArrayLike(n,"be",32).copy(i,33)),i}},6232:function(t,e,r){"use strict";var n=r(8764).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;var i=r(3230),o=r(3550),s=r(7124),a=r(1550);function u(t,e){return e?t-(2*e+35):t-27}function c(t){return 0===t||1===t}e.ecsign=function(t,e,r){var n=i.sign(t,e),o=n.recovery;return{r:n.signature.slice(0,32),s:n.signature.slice(32,64),v:r?o+(2*r+35):o+27}},e.ecrecover=function(t,e,r,o,a){var l=n.concat([s.setLength(r,32),s.setLength(o,32)],64),f=u(e,a);if(!c(f))throw new Error("Invalid signature v value");var h=i.recover(t,l,f);return i.publicKeyConvert(h,!1).slice(1)},e.toRpcSig=function(t,e,r,i){if(!c(u(t,i)))throw new Error("Invalid signature v value");return s.bufferToHex(n.concat([s.setLengthLeft(e,32),s.setLengthLeft(r,32),s.toBuffer(t)]))},e.fromRpcSig=function(t){var e=s.toBuffer(t);if(65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},e.isValidSignature=function(t,e,r,n,i){void 0===n&&(n=!0);var s=new o("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),a=new o("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==e.length||32!==r.length)return!1;if(!c(u(t,i)))return!1;var l=new o(e),f=new o(r);return!(l.isZero()||l.gt(a)||f.isZero()||f.gt(a))&&(!n||1!==f.cmp(s))},e.hashPersonalMessage=function(t){var e=n.from("Ethereum Signed Message:\n"+t.length.toString(),"utf-8");return a.keccak(n.concat([e,t]))}},9847:function(t,e,r){"use strict";var n=r(8764).Buffer;var i=r(1964),o=r(7381),s=i.BN,a=new s("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=e||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new n([])},{name:"gasPrice",length:32,allowLess:!0,default:new n([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new n([])},{name:"to",allowZero:!0,length:20,default:new n([])},{name:"value",length:32,allowLess:!0,default:new n([])},{name:"data",alias:"input",allowZero:!0,default:new n([])},{name:"v",allowZero:!0,default:new n([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new n([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new n([])}];i.defineProperties(this,r,e),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var o=i.bufferToInt(this.v),s=Math.floor((o-35)/2);s<0&&(s=0),this._chainId=s||e.chainId||0,this._homestead=!0}return t.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},t.prototype.hash=function(t){void 0===t&&(t=!0);var e=void 0;if(t)e=this.raw;else if(this._chainId>0){var r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,e=this.raw,this.raw=r}else e=this.raw.slice(0,6);return i.rlphash(e)},t.prototype.getChainId=function(){return this._chainId},t.prototype.getSenderAddress=function(){if(this._from)return this._from;var t=this.getSenderPublicKey();return this._from=i.publicToAddress(t),this._from},t.prototype.getSenderPublicKey=function(){if(!(this._senderPubKey&&this._senderPubKey.length||this.verifySignature()))throw new Error("Invalid Signature");return this._senderPubKey},t.prototype.verifySignature=function(){var t=this.hash(!1);if(this._homestead&&1===new s(this.s).cmp(a))return!1;try{var e=i.bufferToInt(this.v);this._chainId>0&&(e-=2*this._chainId+8),this._senderPubKey=i.ecrecover(t,e,this.r,this.s)}catch(r){return!1}return!!this._senderPubKey},t.prototype.sign=function(t){var e=this.hash(!1),r=i.ecsign(e,t);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},t.prototype.getDataFee=function(){for(var t=this.raw[5],e=new s(0),r=0;r0&&e.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===t||!1===t?0===e.length:e.join(" ")},t}();t.exports=u},1964:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=r(2192),o=i.keccak224,s=i.keccak384,a=i.keccak256,u=i.keccak512,c=r(4565),l=r(9282),f=r(1675),h=r(3550),d=r(3482),p=r(9509).Buffer;Object.assign(e,r(884)),e.MAX_INTEGER=new h("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),e.TWO_POW256=new h("10000000000000000000000000000000000000000000000000000000000000000",16),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.SHA3_NULL_S=e.KECCAK256_NULL_S,e.KECCAK256_NULL=p.from(e.KECCAK256_NULL_S,"hex"),e.SHA3_NULL=e.KECCAK256_NULL,e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.SHA3_RLP_ARRAY_S=e.KECCAK256_RLP_ARRAY_S,e.KECCAK256_RLP_ARRAY=p.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.SHA3_RLP_ARRAY=e.KECCAK256_RLP_ARRAY,e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.SHA3_RLP_S=e.KECCAK256_RLP_S,e.KECCAK256_RLP=p.from(e.KECCAK256_RLP_S,"hex"),e.SHA3_RLP=e.KECCAK256_RLP,e.BN=h,e.rlp=f,e.secp256k1=c,e.zeros=function(t){return p.allocUnsafe(t).fill(0)},e.zeroAddress=function(){var t=e.zeros(20);return e.bufferToHex(t)},e.setLengthLeft=e.setLength=function(t,r,n){var i=e.zeros(r);return t=e.toBuffer(t),n?t.length0&&"0"===r.toString();)r=(t=t.slice(1))[0];return t},e.toBuffer=function(t){if(!p.isBuffer(t))if(Array.isArray(t))t=p.from(t);else if("string"==typeof t)t=e.isHexString(t)?p.from(e.padToEven(e.stripHexPrefix(t)),"hex"):p.from(t);else if("number"==typeof t)t=e.intToBuffer(t);else if(null==t)t=p.allocUnsafe(0);else if(h.isBN(t))t=t.toArrayLike(p);else{if(!t.toArray)throw new Error("invalid type");t=p.from(t.toArray())}return t},e.bufferToInt=function(t){return new h(e.toBuffer(t)).toNumber()},e.bufferToHex=function(t){return"0x"+(t=e.toBuffer(t)).toString("hex")},e.fromSigned=function(t){return new h(t).fromTwos(256)},e.toUnsigned=function(t){return p.from(t.toTwos(256).toArray())},e.keccak=function(t,r){switch(t=e.toBuffer(t),r||(r=256),r){case 224:return o(t);case 256:return a(t);case 384:return s(t);case 512:return u(t);default:throw new Error("Invald algorithm: keccak"+r)}},e.keccak256=function(t){return e.keccak(t)},e.sha3=e.keccak,e.sha256=function(t){return t=e.toBuffer(t),d("sha256").update(t).digest()},e.ripemd160=function(t,r){t=e.toBuffer(t);var n=d("rmd160").update(t).digest();return!0===r?e.setLength(n,32):n},e.rlphash=function(t){return e.keccak(f.encode(t))},e.isValidPrivate=function(t){return c.privateKeyVerify(t)},e.isValidPublic=function(t,e){return 64===t.length?c.publicKeyVerify(p.concat([p.from([4]),t])):!!e&&c.publicKeyVerify(t)},e.pubToAddress=e.publicToAddress=function(t,r){return t=e.toBuffer(t),r&&64!==t.length&&(t=c.publicKeyConvert(t,!1).slice(1)),l(64===t.length),e.keccak(t).slice(-20)};var m=e.privateToPublic=function(t){return t=e.toBuffer(t),c.publicKeyCreate(t,!1).slice(1)};e.importPublic=function(t){return 64!==(t=e.toBuffer(t)).length&&(t=c.publicKeyConvert(t,!1).slice(1)),t},e.ecsign=function(t,e){var r=c.sign(t,e),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},e.hashPersonalMessage=function(t){var r=e.toBuffer("Ethereum Signed Message:\n"+t.length.toString());return e.keccak(p.concat([r,t]))},e.ecrecover=function(t,r,n,i){var o=p.concat([e.setLength(n,32),e.setLength(i,32)],64),s=r-27;if(0!==s&&1!==s)throw new Error("Invalid signature v value");var a=c.recover(t,o,s);return c.publicKeyConvert(a,!1).slice(1)},e.toRpcSig=function(t,r,n){if(27!==t&&28!==t)throw new Error("Invalid recovery id");return e.bufferToHex(p.concat([e.setLengthLeft(r,32),e.setLengthLeft(n,32),e.toBuffer(t-27)]))},e.fromRpcSig=function(t){if(65!==(t=e.toBuffer(t)).length)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}},e.privateToAddress=function(t){return e.publicToAddress(m(t))},e.isValidAddress=function(t){return/^0x[0-9a-fA-F]{40}$/.test(t)},e.isZeroAddress=function(t){return e.zeroAddress()===e.addHexPrefix(t)},e.toChecksumAddress=function(t){t=e.stripHexPrefix(t).toLowerCase();for(var r=e.keccak(t).toString("hex"),n="0x",i=0;i=8?n+=t[i].toUpperCase():n+=t[i];return n},e.isValidChecksumAddress=function(t){return e.isValidAddress(t)&&e.toChecksumAddress(t)===t},e.generateAddress=function(t,r){return t=e.toBuffer(t),r=(r=new h(r)).isZero()?null:p.from(r.toArray()),e.rlphash([t,r]).slice(-20)},e.isPrecompiled=function(t){var r=e.unpad(t);return 1===r.length&&r[0]>=1&&r[0]<=8},e.addHexPrefix=function(t){return"string"!=typeof t||e.isHexPrefixed(t)?t:"0x"+t},e.isValidSignature=function(t,e,r,n){var i=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===e.length&&32===r.length&&((27===t||28===t)&&(e=new h(e),r=new h(r),!(e.isZero()||e.gt(o)||r.isZero()||r.gt(o))&&(!1!==n||1!==new h(r).cmp(i))))},e.baToJSON=function(t){if(p.isBuffer(t))return"0x"+t.toString("hex");if(t instanceof Array){for(var r=[],n=0;n=i.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===i.length||!r.length||l(r.length===i.length,"The field "+r.name+" must have byte length of "+r.length),t.raw[n]=i}t._fields.push(r.name),Object.defineProperty(t,r.name,{enumerable:!0,configurable:!0,get:i,set:o}),r.default&&(t[r.name]=r.default),r.alias&&Object.defineProperty(t,r.alias,{enumerable:!1,configurable:!0,set:o,get:i})})),i)if("string"==typeof i&&(i=p.from(e.stripHexPrefix(i),"hex")),p.isBuffer(i)&&(i=f.decode(i)),Array.isArray(i)){if(i.length>t._fields.length)throw new Error("wrong number of fields in data");i.forEach((function(r,n){t[t._fields[n]]=e.toBuffer(r)}))}else{if("object"!==(void 0===i?"undefined":n(i)))throw new Error("invalid data");var o=Object.keys(i);r.forEach((function(e){-1!==o.indexOf(e.name)&&(t[e.name]=i[e.name]),-1!==o.indexOf(e.alias)&&(t[e.alias]=i[e.alias])}))}}},4565:function(t,e,r){"use strict";var n=r(8764).Buffer,i=r(5053),o=r(7587),s=r(5484),a=function(t){return 32===t.length&&i.privateKeyVerify(Uint8Array.from(t))};t.exports={privateKeyVerify:a,privateKeyExport:function(t,e){if(32!==t.length)throw new RangeError("private key length is invalid");var r=o.privateKeyExport(t,e);return s.privateKeyExport(t,r,e)},privateKeyImport:function(t){if(null!==(t=s.privateKeyImport(t))&&32===t.length&&a(t))return t;throw new Error("couldn't import from DER format")},privateKeyNegate:function(t){return n.from(i.privateKeyNegate(Uint8Array.from(t)))},privateKeyModInverse:function(t){if(32!==t.length)throw new Error("private key length is invalid");return n.from(o.privateKeyModInverse(Uint8Array.from(t)))},privateKeyTweakAdd:function(t,e){return n.from(i.privateKeyTweakAdd(Uint8Array.from(t),e))},privateKeyTweakMul:function(t,e){return n.from(i.privateKeyTweakMul(Uint8Array.from(t),Uint8Array.from(e)))},publicKeyCreate:function(t,e){return n.from(i.publicKeyCreate(Uint8Array.from(t),e))},publicKeyConvert:function(t,e){return n.from(i.publicKeyConvert(Uint8Array.from(t),e))},publicKeyVerify:function(t){return(33===t.length||65===t.length)&&i.publicKeyVerify(Uint8Array.from(t))},publicKeyTweakAdd:function(t,e,r){return n.from(i.publicKeyTweakAdd(Uint8Array.from(t),Uint8Array.from(e),r))},publicKeyTweakMul:function(t,e,r){return n.from(i.publicKeyTweakMul(Uint8Array.from(t),Uint8Array.from(e),r))},publicKeyCombine:function(t,e){var r=[];return t.forEach((function(t){r.push(Uint8Array.from(t))})),n.from(i.publicKeyCombine(r,e))},signatureNormalize:function(t){return n.from(i.signatureNormalize(Uint8Array.from(t)))},signatureExport:function(t){return n.from(i.signatureExport(Uint8Array.from(t)))},signatureImport:function(t){return n.from(i.signatureImport(Uint8Array.from(t)))},signatureImportLax:function(t){if(0===t.length)throw new RangeError("signature length is invalid");var e=s.signatureImportLax(t);if(null===e)throw new Error("couldn't parse DER signature");return o.signatureImport(e)},sign:function(t,e,r){if(null===r)throw new TypeError("options should be an Object");var o=void 0;if(r){if(o={},null===r.data)throw new TypeError("options.data should be a Buffer");if(r.data){if(32!==r.data.length)throw new RangeError("options.data length is invalid");o.data=new Uint8Array(r.data)}if(null===r.noncefn)throw new TypeError("options.noncefn should be a Function");r.noncefn&&(o.noncefn=function(t,e,i,o,s){var a=null!=i?n.from(i):null,u=null!=o?n.from(o):null,c=n.from("");return r.noncefn&&(c=r.noncefn(n.from(t),n.from(e),a,u,s)),Uint8Array.from(c)})}var s=i.ecdsaSign(Uint8Array.from(t),Uint8Array.from(e),o);return{signature:n.from(s.signature),recovery:s.recid}},verify:function(t,e,r){return i.ecdsaVerify(Uint8Array.from(e),Uint8Array.from(t),r)},recover:function(t,e,r,o){return n.from(i.ecdsaRecover(Uint8Array.from(e),r,Uint8Array.from(t),o))},ecdh:function(t,e){return n.from(i.ecdh(Uint8Array.from(t),Uint8Array.from(e),{}))},ecdhUnsafe:function(t,e,r){if(33!==t.length&&65!==t.length)throw new RangeError("public key length is invalid");if(32!==e.length)throw new RangeError("private key length is invalid");return n.from(o.ecdhUnsafe(Uint8Array.from(t),Uint8Array.from(e),r))}}},5484:function(t,e,r){"use strict";var n=r(8764).Buffer,i=n.from([48,129,211,2,1,1,4,32,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,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,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]),o=n.from([48,130,1,19,2,1,1,4,32,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,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,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,0,0]);e.privateKeyExport=function(t,e,r){var s=n.from(r?i:o);return t.copy(s,r?8:9),e.copy(s,r?181:214),s},e.privateKeyImport=function(t){var e=t.length,r=0;if(e2)return null;if(e<(r+=1)+n)return null;var i=t[r+n-1]|(n>1?t[r+n-2]<<8:0);return e<(r+=n)+i||e32||ei)return null;if(2!==t[o++])return null;var a=t[o++];if(128&a){if(o+(s=a-128)>i)return null;for(;s>0&&0===t[o];o+=1,s-=1);for(a=0;s>0;o+=1,s-=1)a=(a<<8)+t[o]}if(a>i-o)return null;var u=o;if(o+=a,2!==t[o++])return null;var c=t[o++];if(128&c){if(o+(s=c-128)>i)return null;for(;s>0&&0===t[o];o+=1,s-=1);for(c=0;s>0;o+=1,s-=1)c=(c<<8)+t[o]}if(c>i-o)return null;var l=o;for(o+=c;a>0&&0===t[u];a-=1,u+=1);if(a>32)return null;var f=t.slice(u,u+a);for(f.copy(e,32-f.length);c>0&&0===t[l];c-=1,l+=1);if(c>32)return null;var h=t.slice(l,l+c);return h.copy(r,32-h.length),{r:e,s:r}}},7587:function(t,e,r){"use strict";var n=r(8764).Buffer,i=r(3550),o=new(0,r(6266).ec)("secp256k1"),s=o.curve;e.privateKeyExport=function(t,e){var r=new i(t);if(r.ucmp(s.n)>=0)throw new Error("couldn't export to DER format");var n=o.g.mul(r);return a(n.getX(),n.getY(),e)},e.privateKeyModInverse=function(t){var e=new i(t);if(e.ucmp(s.n)>=0||e.isZero())throw new Error("private key range is invalid");return e.invm(s.n).toArrayLike(n,"be",32)},e.signatureImport=function(t){var e=new i(t.r);e.ucmp(s.n)>=0&&(e=new i(0));var r=new i(t.s);return r.ucmp(s.n)>=0&&(r=new i(0)),n.concat([e.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},e.ecdhUnsafe=function(t,e,r){var n=o.keyFromPublic(t),u=new i(e);if(u.ucmp(s.n)>=0||u.isZero())throw new Error("scalar was invalid (zero or overflow)");var c=n.pub.mul(u);return a(c.getX(),c.getY(),r)};var a=function(t,e,r){var i=void 0;return r?((i=n.alloc(33))[0]=e.isOdd()?3:2,t.toArrayLike(n,"be",32).copy(i,1)):((i=n.alloc(65))[0]=4,t.toArrayLike(n,"be",32).copy(i,1),e.toArrayLike(n,"be",32).copy(i,33)),i}},884:function(t,e,r){"use strict";var n=r(8764).Buffer,i=r(3944),o=r(9604);function s(t){var e=t;if("string"!=typeof e)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof e+", while padToEven.");return e.length%2&&(e="0"+e),e}function a(t){return"0x"+t.toString(16)}t.exports={arrayContainsArray:function(t,e,r){if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof t+"'");if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof e+"'");return e[Boolean(r)?"some":"every"]((function(e){return t.indexOf(e)>=0}))},intToBuffer:function(t){var e=a(t);return new n(s(e.slice(2)),"hex")},getBinarySize:function(t){if("string"!=typeof t)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof t+"'.");return n.byteLength(t,"utf8")},isHexPrefixed:i,stripHexPrefix:o,padToEven:s,intToHex:a,fromAscii:function(t){for(var e="",r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,c=l,console&&console.warn&&console.warn(c)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function h(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,l=p(u,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return h(this,t,!0)},o.prototype.rawListeners=function(t){return h(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},4445:function(t){t.exports=s,s.default=s,s.stable=l,s.stableStringify=l;var e="[...]",r="[Circular]",n=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(t,e,r,s){var a;void 0===s&&(s=o()),u(t,"",0,[],void 0,0,s);try{a=0===i.length?JSON.stringify(t,e,r):JSON.stringify(t,h(e),r)}catch(l){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function a(t,e,r,o){var s=Object.getOwnPropertyDescriptor(o,r);void 0!==s.get?s.configurable?(Object.defineProperty(o,r,{value:t}),n.push([o,r,e,s])):i.push([e,r,t]):(o[r]=t,n.push([o,r,e]))}function u(t,n,i,o,s,c,l){var f;if(c+=1,"object"==typeof t&&null!==t){for(f=0;fl.depthLimit)return void a(e,t,n,s);if(void 0!==l.edgesLimit&&i+1>l.edgesLimit)return void a(e,t,n,s);if(o.push(t),Array.isArray(t))for(f=0;fe?1:0}function l(t,e,r,s){void 0===s&&(s=o());var a,u=f(t,"",0,[],void 0,0,s)||t;try{a=0===i.length?JSON.stringify(u,e,r):JSON.stringify(u,h(e),r)}catch(l){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var c=n.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return a}function f(t,i,o,s,u,l,h){var d;if(l+=1,"object"==typeof t&&null!==t){for(d=0;dh.depthLimit)return void a(e,t,i,u);if(void 0!==h.edgesLimit&&o+1>h.edgesLimit)return void a(e,t,i,u);if(s.push(t),Array.isArray(t))for(d=0;d0)for(var n=0;n=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n=0||(i[r]=t[r]);return i}const u=()=>"undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;function c(t,e,r){const n={};let i="gatsby-image-wrapper";return"fixed"===r?(n.width=t,n.height=e):"constrained"===r&&(i="gatsby-image-wrapper gatsby-image-wrapper-constrained"),{className:i,"data-gatsby-image-wrapper":"",style:n}}function l(t,e,r,n,i){return void 0===i&&(i={}),s({},r,{loading:n,shouldLoad:t,"data-main-image":"",style:s({},i,{opacity:e?1:0})})}function f(t,e,r,n,i,o,a,u){const c={};o&&(c.backgroundColor=o,"fixed"===r?(c.width=n,c.height=i,c.backgroundColor=o,c.position="relative"):("constrained"===r||"fullWidth"===r)&&(c.position="absolute",c.top=0,c.left=0,c.bottom=0,c.right=0)),a&&(c.objectFit=a),u&&(c.objectPosition=u);const l=s({},t,{"aria-hidden":!0,"data-placeholder-image":"",style:s({opacity:e?0:1,transition:"opacity 500ms linear"},c)});return l}const h=["children"],d=function(t){let{layout:e,width:r,height:i}=t;return"fullWidth"===e?n.createElement("div",{"aria-hidden":!0,style:{paddingTop:i/r*100+"%"}}):"constrained"===e?n.createElement("div",{style:{maxWidth:r,display:"block"}},n.createElement("img",{alt:"",role:"presentation","aria-hidden":"true",src:"data:image/svg+xml;charset=utf-8,%3Csvg%20height='"+i+"'%20width='"+r+"'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E",style:{maxWidth:"100%",display:"block",position:"static"}})):null},p=function(t){let{children:e}=t,r=a(t,h);return n.createElement(n.Fragment,null,n.createElement(d,s({},r)),e,null)},m=["src","srcSet","loading","alt","shouldLoad"],g=["fallback","sources","shouldLoad"],y=function(t){let{src:e,srcSet:r,loading:i,alt:o="",shouldLoad:u}=t,c=a(t,m);return n.createElement("img",s({},c,{decoding:"async",loading:i,src:u?e:void 0,"data-src":u?void 0:e,srcSet:u?r:void 0,"data-srcset":u?void 0:r,alt:o}))},v=function(t){let{fallback:e,sources:r=[],shouldLoad:i=!0}=t,o=a(t,g);const u=o.sizes||(null==e?void 0:e.sizes),c=n.createElement(y,s({},o,e,{sizes:u,shouldLoad:i}));return r.length?n.createElement("picture",null,r.map((t=>{let{media:e,srcSet:r,type:o}=t;return n.createElement("source",{key:e+"-"+o+"-"+r,type:o,media:e,srcSet:i?r:void 0,"data-srcset":i?void 0:r,sizes:u})})),c):c};var b;y.propTypes={src:i.string.isRequired,alt:i.string.isRequired,sizes:i.string,srcSet:i.string,shouldLoad:i.bool},v.displayName="Picture",v.propTypes={alt:i.string.isRequired,shouldLoad:i.bool,fallback:i.exact({src:i.string.isRequired,srcSet:i.string,sizes:i.string}),sources:i.arrayOf(i.oneOfType([i.exact({media:i.string.isRequired,type:i.string,sizes:i.string,srcSet:i.string.isRequired}),i.exact({media:i.string,type:i.string.isRequired,sizes:i.string,srcSet:i.string.isRequired})]))};const w=["fallback"],_=function(t){let{fallback:e}=t,r=a(t,w);return e?n.createElement(v,s({},r,{fallback:{src:e},"aria-hidden":!0,alt:""})):n.createElement("div",s({},r))};_.displayName="Placeholder",_.propTypes={fallback:i.string,sources:null==(b=v.propTypes)?void 0:b.sources,alt:function(t,e,r){return t[e]?new Error("Invalid prop `"+e+"` supplied to `"+r+"`. Validation failed."):null}};const M=function(t){return n.createElement(n.Fragment,null,n.createElement(v,s({},t)),n.createElement("noscript",null,n.createElement(v,s({},t,{shouldLoad:!0}))))};M.displayName="MainImage",M.propTypes=v.propTypes;const A=["as","className","class","style","image","loading","imgClassName","imgStyle","backgroundColor","objectFit","objectPosition"],E=["style","className"],x=t=>t.replace(/\n/g,""),k=function(t,e,r){for(var n=arguments.length,i=new Array(n>3?n-3:0),s=3;sJSON.stringify(i.images)),[i.images]);h&&(f=h);const k=function(t,e,r){let n="";return"fullWidth"===t&&(n=''),"constrained"===t&&(n='
"),n}(b,y,v);return(0,n.useEffect)((()=>{C||(C=r.e(731).then(r.bind(r,6731)).then((t=>{let{renderImageToString:e,swapPlaceholderImage:r}=t;return T=e,{renderImageToString:e,swapPlaceholderImage:r}})));const t=E.current.querySelector("[data-gatsby-image-ssr]");if(t&&u())return t.complete?(null==d||d({wasCached:!0}),null==p||p({wasCached:!0}),setTimeout((()=>{t.removeAttribute("data-gatsby-image-ssr")}),0)):(null==d||d({wasCached:!0}),t.addEventListener("load",(function e(){t.removeEventListener("load",e),null==p||p({wasCached:!0}),setTimeout((()=>{t.removeAttribute("data-gatsby-image-ssr")}),0)}))),void P.add(x);if(T&&P.has(x))return;let e,n;return C.then((t=>{let{renderImageToString:r,swapPlaceholderImage:a}=t;E.current&&(E.current.innerHTML=r(s({isLoading:!0,isLoaded:P.has(x),image:i},g)),P.has(x)||(e=requestAnimationFrame((()=>{E.current&&(n=a(E.current,x,P,o,d,p,m))}))))})),()=>{e&&cancelAnimationFrame(e),n&&n()}}),[i]),(0,n.useLayoutEffect)((()=>{P.has(x)&&T&&(E.current.innerHTML=T(s({isLoading:P.has(x),isLoaded:P.has(x),image:i},g)),null==d||d({wasCached:!0}),null==p||p({wasCached:!0}))}),[i]),(0,n.createElement)(e,s({},A,{style:s({},_,o,{backgroundColor:l}),className:M+(f?" "+f:""),ref:E,dangerouslySetInnerHTML:{__html:k},suppressHydrationWarning:!0}))},N=(0,n.memo)((function(t){return t.image?(0,n.createElement)(O,t):null}));N.propTypes=S,N.displayName="GatsbyImage";const B=["src","__imageData","__error","width","height","aspectRatio","tracedSVGOptions","placeholder","formats","quality","transformOptions","jpgOptions","pngOptions","webpOptions","avifOptions","blurredOptions","breakpoints","outputPixelDensities"];function L(t){return function(e){let{src:r,__imageData:i,__error:o}=e,u=a(e,B);return o&&console.warn(o),i?n.createElement(t,s({image:i},u)):(console.warn("Image not loaded",r),null)}}const j=L((function(t){let{as:e="div",className:r,class:i,style:o,image:u,loading:h="lazy",imgClassName:d,imgStyle:m,backgroundColor:g,objectFit:y,objectPosition:v}=t,b=a(t,A);if(!u)return console.warn("[gatsby-plugin-image] Missing image prop"),null;i&&(r=i),m=s({objectFit:y,objectPosition:v,backgroundColor:g},m);const{width:w,height:k,layout:S,images:R,placeholder:I,backgroundColor:P}=u,C=c(w,k,S),{style:T,className:O}=C,N=a(C,E),B={fallback:void 0,sources:[]};return R.fallback&&(B.fallback=s({},R.fallback,{srcSet:R.fallback.srcSet?x(R.fallback.srcSet):void 0})),R.sources&&(B.sources=R.sources.map((t=>s({},t,{srcSet:x(t.srcSet)})))),n.createElement(e,s({},N,{style:s({},T,o,{backgroundColor:g}),className:O+(r?" "+r:"")}),n.createElement(p,{layout:S,width:w,height:k},n.createElement(_,s({},f(I,!1,S,w,k,P,y,v))),n.createElement(M,s({"data-gatsby-image-ssr":"",className:d},b,l("eager"===h,!1,B,h,m)))))})),q=function(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i{if(void 0!==t.layout&&!U.has(t.layout))return new Error("Invalid value "+t.layout+'" provided for prop "layout". Defaulting to "constrained". Valid values are "fixed", "fullWidth" or "constrained".')}};j.displayName="StaticImage",j.propTypes=F;const D=L(N);D.displayName="StaticImage",D.propTypes=F},2369:function(t){"use strict";const e=/[\p{Lu}]/u,r=/[\p{Ll}]/u,n=/^[\p{Lu}](?![\p{Lu}])/gu,i=/([\p{Alpha}\p{N}_]|$)/u,o=/[_.\- ]+/,s=new RegExp("^"+o.source),a=new RegExp(o.source+i.source,"gu"),u=new RegExp("\\d+"+i.source,"gu"),c=(t,i)=>{if("string"!=typeof t&&!Array.isArray(t))throw new TypeError("Expected the input to be `string | string[]`");if(i={pascalCase:!1,preserveConsecutiveUppercase:!1,...i},0===(t=Array.isArray(t)?t.map((t=>t.trim())).filter((t=>t.length)).join("-"):t.trim()).length)return"";const o=!1===i.locale?t=>t.toLowerCase():t=>t.toLocaleLowerCase(i.locale),c=!1===i.locale?t=>t.toUpperCase():t=>t.toLocaleUpperCase(i.locale);if(1===t.length)return i.pascalCase?c(t):o(t);return t!==o(t)&&(t=((t,n,i)=>{let o=!1,s=!1,a=!1;for(let u=0;u(n.lastIndex=0,t.replace(n,(t=>e(t)))))(t,o):o(t),i.pascalCase&&(t=c(t.charAt(0))+t.slice(1)),((t,e)=>(a.lastIndex=0,u.lastIndex=0,t.replace(a,((t,r)=>e(r))).replace(u,(t=>e(t)))))(t,c)};t.exports=c,t.exports.default=c},6038:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return nf}});var n={};r.r(n),r.d(n,{decrypt:function(){return fe},encrypt:function(){return le},generateKey:function(){return ue},verifyHmac:function(){return ce}});var i=r(3100),o=r(4160),s=r(7294),a=r(7462),u=r(5059),c=r(9931),l=r(5893),f=(0,u.G)((function(t,e){const{templateAreas:r,gap:n,rowGap:i,columnGap:o,column:s,row:a,autoFlow:u,autoRows:f,templateRows:h,autoColumns:d,templateColumns:p,...m}=t,g={display:"grid",gridTemplateAreas:r,gridGap:n,gridRowGap:i,gridColumnGap:o,gridAutoColumns:d,gridColumn:s,gridRow:a,gridAutoFlow:u,gridAutoRows:f,gridTemplateRows:h,gridTemplateColumns:p};return(0,l.jsx)(c.m.div,{ref:e,__css:g,...m})}));f.displayName="Grid";var h=r(5119),d=r(4629),p=r(5432);Object.freeze(["base","sm","md","lg","xl","2xl"]);function m(t,e){return Array.isArray(t)?t.map((t=>null===t?null:e(t))):(0,p.Kn)(t)?Object.keys(t).reduce(((r,n)=>(r[n]=e(t[n]),r)),{}):null!=t?e(t):null}var g=(0,u.G)((function(t,e){const{columns:r,spacingX:n,spacingY:i,spacing:o,minChildWidth:s,...a}=t,u=(0,h.F)(),c=s?function(t,e){return m(t,(t=>{const r=(0,d.LP)("sizes",t,"number"==typeof(n=t)?`${n}px`:n)(e);var n;return null===t?null:`repeat(auto-fit, minmax(${r}, 1fr))`}))}(s,u):m(r,(t=>null===t?null:`repeat(${t}, minmax(0, 1fr))`));return(0,l.jsx)(f,{ref:e,gap:o,columnGap:n,rowGap:i,templateColumns:c,...a})}));g.displayName="SimpleGrid";var y=(0,u.G)((function(t,e){const{direction:r,align:n,justify:i,wrap:o,basis:s,grow:a,shrink:u,...f}=t,h={display:"flex",flexDirection:r,alignItems:n,justifyContent:i,flexWrap:o,flexBasis:s,flexGrow:a,flexShrink:u};return(0,l.jsx)(c.m.div,{ref:e,__css:h,...f})}));y.displayName="Flex";var v=r(8911),b=(0,u.G)((function(t,e){return(0,l.jsx)(c.m.div,{...t,ref:e,role:"group",className:(0,p.cx)("chakra-stat__group",t.className),__css:{display:"flex",flexWrap:"wrap",justifyContent:"space-around",alignItems:"flex-start"}})}));b.displayName="StatGroup";var w=r(5227),_=r(1639),M=r(3179),[A,E]=(0,w.k)({name:"StatStylesContext",errorMessage:"useStatStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),x=(0,u.G)((function(t,e){const r=(0,_.jC)("Stat",t),n={position:"relative",flex:"1 1 0%",...r.container},{className:i,children:o,...s}=(0,M.Lr)(t);return(0,l.jsx)(A,{value:r,children:(0,l.jsx)(c.m.div,{ref:e,...s,className:(0,p.cx)("chakra-stat",i),__css:n,children:(0,l.jsx)("dl",{children:o})})})}));x.displayName="Stat";var k=(0,u.G)((function(t,e){const r=E();return(0,l.jsx)(c.m.dt,{ref:e,...t,className:(0,p.cx)("chakra-stat__label",t.className),__css:r.label})}));k.displayName="StatLabel";var S=(0,u.G)((function(t,e){const r=E();return(0,l.jsx)(c.m.dd,{ref:e,...t,className:(0,p.cx)("chakra-stat__number",t.className),__css:{...r.number,fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums"}})}));S.displayName="StatNumber";var R=r(7754);var[I,P]=(0,w.k)({strict:!1,name:"ButtonGroupContext"});function C(t){const{children:e,className:r,...n}=t,i=(0,s.isValidElement)(e)?(0,s.cloneElement)(e,{"aria-hidden":!0,focusable:!1}):e,o=(0,p.cx)("chakra-button__icon",r);return(0,l.jsx)(c.m.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...n,className:o,children:i})}C.displayName="ButtonIcon";var T=r(295);function O(t){const{label:e,placement:r,spacing:n="0.5rem",children:i=(0,l.jsx)(T.$,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...u}=t,f=(0,p.cx)("chakra-button__spinner",o),h="start"===r?"marginEnd":"marginStart",d=(0,s.useMemo)((()=>({display:"flex",alignItems:"center",position:e?"relative":"absolute",[h]:e?n:0,fontSize:"1em",lineHeight:"normal",...a})),[a,e,h,n]);return(0,l.jsx)(c.m.div,{className:f,...u,__css:d,children:i})}function N(...t){return e=>{t.forEach((t=>{!function(t,e){if(null!=t)if("function"!=typeof t)try{t.current=e}catch(r){throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}else t(e)}(t,e)}))}}function B(...t){return(0,s.useMemo)((()=>N(...t)),t)}O.displayName="ButtonSpinner";var L=(0,u.G)(((t,e)=>{const r=P(),n=(0,_.mq)("Button",{...r,...t}),{isDisabled:i=(null==r?void 0:r.isDisabled),isLoading:o,isActive:a,children:u,leftIcon:f,rightIcon:h,loadingText:d,iconSpacing:m="0.5rem",type:g,spinner:y,spinnerPlacement:v="start",className:b,as:w,...A}=(0,M.Lr)(t),E=(0,s.useMemo)((()=>{const t={...null==n?void 0:n._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...n,...!!r&&{_focus:t}}}),[n,r]),{ref:x,type:k}=function(t){const[e,r]=(0,s.useState)(!t);return{ref:(0,s.useCallback)((t=>{t&&r("BUTTON"===t.tagName)}),[]),type:e?"button":void 0}}(w),S={rightIcon:h,leftIcon:f,iconSpacing:m,children:u};return(0,l.jsxs)(c.m.button,{ref:B(e,x),as:w,type:null!=g?g:k,"data-active":(0,p.PB)(a),"data-loading":(0,p.PB)(o),__css:E,className:(0,p.cx)("chakra-button",b),...A,disabled:i||o,children:[o&&"start"===v&&(0,l.jsx)(O,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:m,children:y}),o?d||(0,l.jsx)(c.m.span,{opacity:0,children:(0,l.jsx)(j,{...S})}):(0,l.jsx)(j,{...S}),o&&"end"===v&&(0,l.jsx)(O,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:m,children:y})]})}));function j(t){const{leftIcon:e,rightIcon:r,children:n,iconSpacing:i}=t;return(0,l.jsxs)(l.Fragment,{children:[e&&(0,l.jsx)(C,{marginEnd:i,children:e}),n,r&&(0,l.jsx)(C,{marginStart:i,children:r})]})}L.displayName="Button";var q=r(5522);const U=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],F=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],D={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};var z=r(1460),H=r.n(z),K=(r(4501),r(5054)),G=r.n(K),W=r(8764).Buffer;const V="hex",Z="utf8",J="0";function Y(t){return new Uint8Array(t)}function Q(t,e=!1){const r=t.toString(V);return e?lt(r):r}function X(t){return t.toString(Z)}function $(t){return G()(t)}function tt(t,e=!1){return Q($(t),e)}function et(t){return X($(t))}function rt(t){return W.from(ct(t),V)}function nt(t){return Y(rt(t))}function it(t){return W.from(t,Z)}function ot(t){return Y(it(t))}function st(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}function at(...t){let e=[];return t.forEach((t=>e=e.concat(Array.from(t)))),new Uint8Array([...e])}function ut(t,e=8,r=J){return function(t,e,r=J){return ht(t,e,!0,r)}(t,function(t,e=8){const r=t%e;return r?(t-r)/e*e+e:t}(t.length,e),r)}function ct(t){return t.replace(/^0x/,"")}function lt(t){return t.startsWith("0x")?t:`0x${t}`}function ft(t){return(t=ut(t=ct(t),2))&&(t=lt(t)),t}function ht(t,e,r,n=J){const i=e-t.length;let o=t;if(i>0){const e=n.repeat(i);o=r?e+t:t+e}return o}function dt(t){return $(new Uint8Array(t))}function pt(t,e){return function(t,e=!1){return Q(it(t),e)}(t,!e)}function mt(t,e){const r=ct(ft(new(H())(t).toString(16)));return e?r:lt(r)}var gt=r(1094),yt=r.n(gt);var vt=r(1468);function bt(t=3){return Date.now()*Math.pow(10,t)+Math.floor(Math.random()*Math.pow(10,t))}function wt(t){return ft(t)}function _t(t){return function(t){const e=t.startsWith("0x");return t=(t=ct(t)).startsWith(J)?t.substring(1):t,e?lt(t):t}(lt(t))}const Mt=bt;function At(){return((t,e)=>{for(e=t="";t++<36;e+=51*t&52?(15^t?8^Math.random()*(20^t?16:4):4).toString(16):"-");return e})()}function Et(t,e){let r;const n=function(t,e){let r;const n=D[t];return n&&(r=`https://${n}.infura.io/v3/${e}`),r}(t,e.infuraId);return e.custom&&e.custom[t]?r=e.custom[t]:n&&(r=n),r}function xt(t,e){return st(t,e)}function kt(t){return void 0!==t.result}function St(t){return void 0!==t.error}function Rt(t){return void 0!==t.event}function It(t){t=ct(t.toLowerCase());const e=ct((0,gt.keccak_256)(it(t)));let r="";for(let n=0;n7?r+=t[n].toUpperCase():r+=t[n];return lt(r)}function Pt(t){var e;return(e=t)&&e.length&&!xt(t[0])&&(t[0]=pt(t[0])),t}function Ct(t){if(void 0!==t.type&&"0"!==t.type)return t;if(void 0===t.from||(!(e=t.from)||"0x"!==e.toLowerCase().substring(0,2)||!/^(0x)?[0-9a-f]{40}$/i.test(e)||!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e)&&e!==It(e)))throw new Error("Transaction object must include a valid 'from' value.");var e;function r(t){let e=t;return("number"==typeof t||"string"==typeof t&&!function(t){return""===t||"string"==typeof t&&""===t.trim()}(t))&&(xt(t)?"string"==typeof t&&(e=wt(t)):e=mt(t)),"string"==typeof e&&(e=_t(e)),e}const n={from:wt(t.from),to:void 0===t.to?void 0:wt(t.to),gasPrice:void 0===t.gasPrice?"":r(t.gasPrice),gas:void 0===t.gas?void 0===t.gasLimit?"":r(t.gasLimit):r(t.gas),value:void 0===t.value?"":r(t.value),nonce:void 0===t.nonce?"":r(t.nonce),data:void 0===t.data?"":wt(t.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach((t=>{(void 0===n[t]||"string"==typeof n[t]&&!n[t].trim().length)&&i.includes(t)&&delete n[t]})),n}var Tt=r(7563);function Ot(t,e){let r=Nt(t);return r=Object.assign(Object.assign({},r),e),t=function(t){return Tt.stringify(t)}(r),t}function Nt(t){return Tt.parse(t)}var Bt=class{constructor(){this._eventEmitters=[],"undefined"!=typeof window&&void 0!==window.addEventListener&&(window.addEventListener("online",(()=>this.trigger("online"))),window.addEventListener("offline",(()=>this.trigger("offline"))))}on(t,e){this._eventEmitters.push({event:t,callback:e})}trigger(t){let e=[];t&&(e=this._eventEmitters.filter((e=>e.event===t))),e.forEach((t=>{t.callback()}))}};const Lt=void 0!==r.g.WebSocket?r.g.WebSocket:r(8007);var jt=class{constructor(t){if(this.opts=t,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=t.protocol,this._version=t.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=t.subscriptions||[],this._netMonitor=t.netMonitor||new Bt,!t.url||"string"!=typeof t.url)throw new Error("Missing or invalid WebSocket url");this._url=t.url,this._netMonitor.on("online",(()=>this._socketCreate()))}set readyState(t){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(t){}get connecting(){return 0===this.readyState}set connected(t){}get connected(){return 1===this.readyState}set closing(t){}get closing(){return 2===this.readyState}set closed(t){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(t,e,r){if(!e||"string"!=typeof e)throw new Error("Missing or invalid topic field");this._socketSend({topic:e,type:"pub",payload:t,silent:!!r})}subscribe(t){this._socketSend({topic:t,type:"sub",payload:"",silent:!0})}on(t,e){this._events.push({event:t,callback:e})}_socketCreate(){if(this._nextSocket)return;const t=function(t,e,r){var n,i;const o=t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t,s=o.split("?"),a=(0,q.isBrowser)()?{protocol:e,version:r,env:"browser",host:(null===(n=(0,q.getLocation)())||void 0===n?void 0:n.host)||""}:{protocol:e,version:r,env:(null===(i=(0,q.detectEnv)())||void 0===i?void 0:i.name)||""},u=Ot(function(t){const e=-1!==t.indexOf("?")?t.indexOf("?"):void 0;return void 0!==e?t.substr(e):""}(s[1]||""),a);return s[0]+"?"+u}(this._url,this._protocol,this._version);if(this._nextSocket=new Lt(t),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=t=>this._socketReceive(t),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=t=>this._socketError(t),this._nextSocket.onclose=()=>{setTimeout((()=>{this._nextSocket=null,this._socketCreate()}),1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(t){const e=JSON.stringify(t);this._socket&&1===this._socket.readyState?this._socket.send(e):(this._setToQueue(t),this._socketCreate())}async _socketReceive(t){let e;try{e=JSON.parse(t.data)}catch(r){return}if(this._socketSend({topic:e.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){const t=this._events.filter((t=>"message"===t.event));t&&t.length&&t.forEach((t=>t.callback(e)))}}_socketError(t){const e=this._events.filter((t=>"error"===t.event));e&&e.length&&e.forEach((e=>e.callback(t)))}_queueSubscriptions(){this._subscriptions.forEach((t=>this._queue.push({topic:t,type:"sub",payload:"",silent:!0}))),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(t){this._queue.push(t)}_pushQueue(){this._queue.forEach((t=>this._socketSend(t))),this._queue=[]}};const qt="Session currently connected",Ut="Session currently disconnected",Ft="JSON RPC response format is invalid",Dt="User close QRCode Modal";var zt=class{constructor(){this._eventEmitters=[]}subscribe(t){this._eventEmitters.push(t)}unsubscribe(t){this._eventEmitters=this._eventEmitters.filter((e=>e.event!==t))}trigger(t){let e,r=[];e=void 0!==t.method?t.method:kt(t)||St(t)?`response:${t.id}`:Rt(t)?t.event:"",e&&(r=this._eventEmitters.filter((t=>t.event===e))),r&&r.length||function(t){return U.includes(t)||t.startsWith("wc_")}(e)||Rt(e)||(r=this._eventEmitters.filter((t=>"call_request"===t.event))),r.forEach((e=>{if(St(t)){const r=new Error(t.error.message);e.callback(r,null)}else e.callback(null,t)}))}};var Ht=class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null;const e=(0,q.getLocal)(this.storageId);return e&&void 0!==e.bridge&&(t=e),t}setSession(t){return(0,q.setLocal)(this.storageId,t),t}removeSession(){(0,q.removeLocal)(this.storageId)}};const Kt="walletconnect.org",Gt="abcdefghijklmnopqrstuvwxyz0123456789".split("").map((t=>`https://${t}.bridge.walletconnect.org`));function Wt(){return Gt[Math.floor(Math.random()*Gt.length)]}function Vt(t){return function(t){return function(t){return function(t){let e=t.indexOf("//")>-1?t.split("/")[2]:t.split("/")[0];return e=e.split(":")[0],e=e.split("?")[0],e}(t).split(".").slice(-2).join(".")}(t)===Kt}(t)?Wt():t}var Zt=class{constructor(t){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new zt,this._clientMeta=(0,q.getClientMeta)()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new Ht(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...F,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");t.connectorOpts.bridge&&(this.bridge=Vt(t.connectorOpts.bridge)),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);const e=t.connectorOpts.session||this._getStorageSession();e&&(this.session=e),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new jt({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),t.connectorOpts.uri&&this._subscribeToSessionRequest(),t.pushServerOpts&&this._registerPushServer(t.pushServerOpts)}set bridge(t){t&&(this._bridge=t)}get bridge(){return this._bridge}set key(t){if(!t)return;const e=nt(t).buffer;this._key=e}get key(){if(this._key){return t=this._key,e=!0,tt(new Uint8Array(t),!e)}var t,e;return""}set clientId(t){t&&(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=At()),this._clientId}set peerId(t){t&&(this._peerId=t)}get peerId(){return this._peerId}set clientMeta(t){}get clientMeta(){let t=this._clientMeta;return t||(t=this._clientMeta=(0,q.getClientMeta)()),t}set peerMeta(t){this._peerMeta=t}get peerMeta(){return this._peerMeta}set handshakeTopic(t){t&&(this._handshakeTopic=t)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(t){t&&(this._handshakeId=t)}get handshakeId(){return this._handshakeId}get uri(){return this._formatUri()}set uri(t){if(!t)return;const{handshakeTopic:e,bridge:r,key:n}=this._parseUri(t);this.handshakeTopic=e,this.bridge=r,this.key=n}set chainId(t){this._chainId=t}get chainId(){return this._chainId}set networkId(t){this._networkId=t}get networkId(){return this._networkId}set accounts(t){this._accounts=t}get accounts(){return this._accounts}set rpcUrl(t){this._rpcUrl=t}get rpcUrl(){return this._rpcUrl}set connected(t){}get connected(){return this._connected}set pending(t){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(t){t&&(this._connected=t.connected,this.accounts=t.accounts,this.chainId=t.chainId,this.bridge=t.bridge,this.key=t.key,this.clientId=t.clientId,this.clientMeta=t.clientMeta,this.peerId=t.peerId,this.peerMeta=t.peerMeta,this.handshakeId=t.handshakeId,this.handshakeTopic=t.handshakeTopic)}on(t,e){const r={event:t,callback:e};this._eventManager.subscribe(r)}off(t){this._eventManager.unsubscribe(t)}async createInstantRequest(t){this._key=await this._generateKey();const e=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(t)}]});this.handshakeId=e.id,this.handshakeTopic=At(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(()=>{throw new Error(Dt)}));const r=()=>{this.killSession()};try{const t=await this._sendCallRequest(e);return t&&r(),t}catch(n){throw r(),n}}async connect(t){if(!this._qrcodeModal)throw new Error("QRCode Modal not provided");return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(t),new Promise((async(t,e)=>{this.on("modal_closed",(()=>e(new Error(Dt)))),this.on("connect",((r,n)=>{if(r)return e(r);t(n.params[0])}))})))}async createSession(t){if(this._connected)throw new Error(qt);if(this.pending)return;this._key=await this._generateKey();const e=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:t&&t.chainId?t.chainId:null}]});this.handshakeId=e.id,this.handshakeTopic=At(),this._sendSessionRequest(e,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(t){if(this._connected)throw new Error(qt);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},r={id:this.handshakeId,jsonrpc:"2.0",result:e};this._sendResponse(r),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(t){if(this._connected)throw new Error(qt);const e=t&&t.message?t.message:"Session Rejected",r=this._formatResponse({id:this.handshakeId,error:{message:e}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession()}updateSession(t){if(!this._connected)throw new Error(Ut);this.chainId=t.chainId,this.accounts=t.accounts,this.networkId=t.networkId||0,this.rpcUrl=t.rpcUrl||"";const e={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},r=this._formatRequest({method:"wc_sessionUpdate",params:[e]});this._sendSessionRequest(r,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(t){const e=t?t.message:"Session Disconnected",r=this._formatRequest({method:"wc_sessionUpdate",params:[{approved:!1,chainId:null,networkId:null,accounts:null}]});await this._sendRequest(r),this._handleSessionDisconnect(e)}async sendTransaction(t){if(!this._connected)throw new Error(Ut);const e=Ct(t),r=this._formatRequest({method:"eth_sendTransaction",params:[e]});return await this._sendCallRequest(r)}async signTransaction(t){if(!this._connected)throw new Error(Ut);const e=Ct(t),r=this._formatRequest({method:"eth_signTransaction",params:[e]});return await this._sendCallRequest(r)}async signMessage(t){if(!this._connected)throw new Error(Ut);const e=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(e)}async signPersonalMessage(t){if(!this._connected)throw new Error(Ut);t=Pt(t);const e=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(e)}async signTypedData(t){if(!this._connected)throw new Error(Ut);const e=this._formatRequest({method:"eth_signTypedData",params:t});return await this._sendCallRequest(e)}async updateChain(t){if(!this._connected)throw new Error("Session currently disconnected");const e=this._formatRequest({method:"wallet_updateChain",params:[t]});return await this._sendCallRequest(e)}unsafeSend(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),new Promise(((e,r)=>{this._subscribeToResponse(t.id,((t,n)=>{if(t)r(t);else{if(!n)throw new Error("Missing JSON RPC response");e(n)}}))}))}async sendCustomRequest(t,e){if(!this._connected)throw new Error(Ut);switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return mt(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=Ct(t.params[0]));break;case"personal_sign":t.params&&(t.params=Pt(t.params))}const r=this._formatRequest(t);return await this._sendCallRequest(r,e)}approveRequest(t){if(!kt(t))throw new Error('JSON-RPC success response must include "result" field');{const e=this._formatResponse(t);this._sendResponse(e)}}rejectRequest(t){if(!St(t))throw new Error('JSON-RPC error response must include "error" field');{const e=this._formatResponse(t);this._sendResponse(e)}}transportClose(){this._transport.close()}async _sendRequest(t,e){const r=this._formatRequest(t),n=await this._encrypt(r),i=void 0!==(null==e?void 0:e.topic)?e.topic:this.peerId,o=JSON.stringify(n),s=void 0!==(null==e?void 0:e.forcePushNotification)?!e.forcePushNotification:function(t){return!!t.method.startsWith("wc_")||!F.includes(t.method)}(r);this._transport.send(o,i,s)}async _sendResponse(t){const e=await this._encrypt(t),r=this.peerId,n=JSON.stringify(e);this._transport.send(n,r,!0)}async _sendSessionRequest(t,e,r){this._sendRequest(t,r),this._subscribeToSessionResponse(t.id,e)}_sendCallRequest(t,e){return this._sendRequest(t,e),this._eventManager.trigger({event:"call_request_sent",params:[{request:t,options:e}]}),this._subscribeToCallResponse(t.id)}_formatRequest(t){if(void 0===t.method)throw new Error('JSON RPC request must have valid "method" value');return{id:void 0===t.id?Mt():t.id,jsonrpc:"2.0",method:t.method,params:void 0===t.params?[]:t.params}}_formatResponse(t){if(void 0===t.id)throw new Error('JSON RPC request must have valid "id" value');const e={id:t.id,jsonrpc:"2.0"};if(St(t)){const r=function(t){const e=t.message||"Failed or Rejected Request";let r=-32e3;if(t&&!t.code)switch(e){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3}const n={code:r,message:e};return t.data&&(n.data=t.data),n}(t.error);return Object.assign(Object.assign(Object.assign({},e),t),{error:r})}if(kt(t)){return Object.assign(Object.assign({},e),t)}throw new Error(Ft)}_handleSessionDisconnect(t){const e=t||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),(0,q.removeLocal)(q.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:e}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(t,e){e&&e.approved?(this._connected?(e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,e.chainId&&(this.chainId=e.chainId),e.accounts&&(this.accounts=e.accounts),e.peerId&&!this.peerId&&(this.peerId=e.peerId),e.peerMeta&&!this.peerMeta&&(this.peerMeta=e.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(t)}async _handleIncomingMessages(t){if(![this.clientId,this.handshakeTopic].includes(t.topic))return;let e;try{e=JSON.parse(t.payload)}catch(n){return}const r=await this._decrypt(e);r&&this._eventManager.trigger(r)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(t,e){this.on(`response:${t}`,e)}_subscribeToSessionResponse(t,e){this._subscribeToResponse(t,((t,r)=>{t?this._handleSessionResponse(t.message):kt(r)?this._handleSessionResponse(e,r.result):r.error&&r.error.message?this._handleSessionResponse(r.error.message):this._handleSessionResponse(e)}))}_subscribeToCallResponse(t){return new Promise(((e,r)=>{this._subscribeToResponse(t,((t,n)=>{t?r(t):kt(n)?e(n.result):n.error&&n.error.message?r(n.error):r(new Error(Ft))}))}))}_subscribeToInternalEvents(){this.on("display_uri",(()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,(()=>{this._eventManager.trigger({event:"modal_closed",params:[]})}),this._qrcodeModalOptions)})),this.on("connect",(()=>{this._qrcodeModal&&this._qrcodeModal.close()})),this.on("call_request_sent",((t,e)=>{const{request:r}=e.params[0];if((0,q.isMobile)()&&this._signingMethods.includes(r.method)){const t=(0,q.getLocal)(q.mobileLinkChoiceKey);t&&(window.location.href=t.href)}})),this.on("wc_sessionRequest",((t,e)=>{t&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:t.toString()}]}),this.handshakeId=e.id,this.peerId=e.params[0].peerId,this.peerMeta=e.params[0].peerMeta;const r=Object.assign(Object.assign({},e),{method:"session_request"});this._eventManager.trigger(r)})),this.on("wc_sessionUpdate",((t,e)=>{t&&this._handleSessionResponse(t.message),this._handleSessionResponse("Session disconnected",e.params[0])}))}_initTransport(){this._transport.on("message",(t=>this._handleIncomingMessages(t))),this._transport.on("open",(()=>this._eventManager.trigger({event:"transport_open",params:[]}))),this._transport.on("close",(()=>this._eventManager.trigger({event:"transport_close",params:[]}))),this._transport.on("error",(()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]}))),this._transport.open()}_formatUri(){return`${this.protocol}:${this.handshakeTopic}@${this.version}?bridge=${encodeURIComponent(this.bridge)}&key=${this.key}`}_parseUri(t){const e=function(t){const e=t.indexOf(":"),r=-1!==t.indexOf("?")?t.indexOf("?"):void 0,n=t.substring(0,e),i=function(t){const e=t.split("@");return{handshakeTopic:e[0],version:parseInt(e[1],10)}}(t.substring(e+1,r)),o=function(t){const e=Nt(t);return{key:e.key||"",bridge:e.bridge||""}}(void 0!==r?t.substr(r):"");return Object.assign(Object.assign({protocol:n},i),o)}(t);if(e.protocol===this.protocol){if(!e.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const t=e.handshakeTopic;if(!e.bridge)throw Error("Invalid or missing bridge url parameter value");const r=decodeURIComponent(e.bridge);if(!e.key)throw Error("Invalid or missing key parameter value");return{handshakeTopic:t,bridge:r,key:e.key}}throw new Error("URI format is invalid")}async _generateKey(){if(this._cryptoLib){return await this._cryptoLib.generateKey()}return null}async _encrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.encrypt(t,e)}return null}async _decrypt(t){const e=this._key;if(this._cryptoLib&&e){return await this._cryptoLib.decrypt(t,e)}return null}_getStorageSession(){let t=null;return this._sessionStorage&&(t=this._sessionStorage.getSession()),t}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(t){if(!t.url||"string"!=typeof t.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!t.type||"string"!=typeof t.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!t.token||"string"!=typeof t.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const e={bridge:this.bridge,topic:this.clientId,type:t.type,token:t.token,peerName:"",language:t.language||""};this.on("connect",(async(r,n)=>{if(r)throw r;if(t.peerMeta){const t=n.params[0].peerMeta.name;e.peerName=t}try{const r=await fetch(`${t.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)});if(!(await r.json()).success)throw Error("Failed to register in Push Server")}catch(r){throw Error("Failed to register in Push Server")}}))}};const Jt=256,Yt=256,Qt="AES-CBC",Xt=`SHA-${Jt}`,$t="HMAC",te="encrypt",ee="decrypt",re="sign",ne="verify";async function ie(t,e=Qt){return vt.getSubtleCrypto().importKey("raw",t,function(t){return t===Qt?{length:Jt,name:Qt}:{hash:{name:Xt},name:$t}}(e),!0,function(t){return t===Qt?[te,ee]:[re,ne]}(e))}function oe(t,e,r){return async function(t,e,r){const n=vt.getSubtleCrypto(),i=await ie(e,Qt),o=await n.encrypt({iv:t,name:Qt},i,r);return new Uint8Array(o)}(t,e,r)}function se(t,e,r){return async function(t,e,r){const n=vt.getSubtleCrypto(),i=await ie(e,Qt),o=await n.decrypt({iv:t,name:Qt},i,r);return new Uint8Array(o)}(t,e,r)}async function ae(t,e){const r=await async function(t,e){const r=vt.getSubtleCrypto(),n=await ie(t,$t),i=await r.sign({length:Yt,name:$t},n,e);return new Uint8Array(i)}(t,e);return r}async function ue(t){const e=function(t){return vt.getBrowerCrypto().getRandomValues(new Uint8Array(t))}((t||256)/8);return Y($(e)).buffer}async function ce(t,e){const r=nt(t.data),n=nt(t.iv),i=tt(nt(t.hmac),!1),o=at(r,n),s=tt(await ae(e,o),!1);return ct(i)===ct(s)}async function le(t,e,r){const n=Y(dt(e)),i=Y(dt(r||await ue(128))),o=tt(i,!1),s=ot(JSON.stringify(t)),a=await oe(i,n,s),u=tt(a,!1),c=at(a,i);return{data:u,hmac:tt(await ae(n,c),!1),iv:o}}async function fe(t,e){const r=Y(dt(e));if(!r)throw new Error("Missing key: required for decryption");if(!await ce(t,r))return null;const n=nt(t.data),i=nt(t.iv),o=et(await se(i,r,n));let s;try{s=JSON.parse(o)}catch(a){return null}return s}var he=class extends Zt{constructor(t,e){super({cryptoLib:n,connectorOpts:t,pushServerOpts:e})}},de=r(4337),pe=r.n(de),me=r(6729),ge=r.n(me),ye=r(9536);const ve=(0,q.getFromWindow)("XMLHttpRequest")||ye.XMLHttpRequest;class be extends(ge()){constructor(t){super(),this.url=t}formatError(t,e,r=-1){return{error:{message:e,code:r},id:t.id,jsonrpc:t.jsonrpc}}send(t,e){return new Promise((r=>{if("eth_subscribe"===t.method){const e=this.formatError(t,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",e),r(e)}const n=new ve;let i=!1;const o=(o,s)=>{if(!i)if(n.abort(),i=!0,e)e(o,s);else{const{id:e,jsonrpc:n}=t,i=o?{id:e,jsonrpc:n,error:{message:o.message,code:o.code}}:{id:e,jsonrpc:n,result:s};this.emit("payload",i),r(i)}};n.open("POST",this.url,!0),n.setRequestHeader("Content-Type","application/json"),n.timeout=6e4,n.onerror=o,n.ontimeout=o,n.onreadystatechange=()=>{if(4===n.readyState)try{const t=JSON.parse(n.responseText);o(t.error,t.result)}catch(t){o(t)}},n.send(JSON.stringify(t))}))}}var we=be;const _e=r(2906),Me=r(1955),Ae=r(2110),Ee=r(2455),xe=r(8747),ke=r(3621),Se=r(8191);var Re=class extends _e{constructor(t){if(super({pollingInterval:t.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=pe(),this.qrcodeModalOptions=void 0,this.rpc=null,this.infuraId="",this.http=null,this.isConnecting=!1,this.connected=!1,this.connectCallbacks=[],this.accounts=[],this.chainId=1,this.rpcUrl="",this.enable=async()=>{const t=await this.getWalletConnector();if(t)return this.start(),this.subscribeWalletConnector(),t.accounts;throw new Error("Failed to connect to WalleConnect")},this.request=async t=>this.send(t),this.send=async(t,e)=>{var r;if("string"==typeof t){const r=t;let n=e;return"personal_sign"===r&&(n=Pt(n)),this.sendAsyncPromise(r,n)}if("personal_sign"===(t=Object.assign({id:Mt(),jsonrpc:"2.0"},t)).method&&(t.params=Pt(t.params)),!e){if("eth_signTypedData_v4"===t.method&&"MetaMask"===(null===(r=this.walletMeta)||void 0===r?void 0:r.name)){const{result:e}=await this.handleOtherRequests(t);return e}return this.sendAsyncPromise(t.method,t.params)}this.sendAsync(t,e)},this.onConnect=t=>{this.connectCallbacks.push(t)},this.triggerConnect=t=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach((e=>e(t)))},this.bridge=t.connector?t.connector.bridge:t.bridge||"https://bridge.walletconnect.org",this.qrcode=void 0===t.qrcode||!1!==t.qrcode,this.qrcodeModal=t.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=t.qrcodeModalOptions,this.wc=t.connector||new he({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:null==t?void 0:t.storageId,signingMethods:null==t?void 0:t.signingMethods,clientMeta:null==t?void 0:t.clientMeta}),this.rpc=t.rpc||null,!(this.rpc||t.infuraId&&"string"==typeof t.infuraId&&t.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=t.infuraId||"",this.chainId=(null==t?void 0:t.chainId)||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}async disconnect(){this.close()}async close(){const t=await this.getWalletConnector({disableSessionCreation:!0});await t.killSession(),await this.onDisconnect()}async handleRequest(t){try{let e,r=null;const n=await this.getWalletConnector();switch(t.method){case"wc_killSession":await this.close(),r=null;break;case"eth_accounts":r=n.accounts;break;case"eth_coinbase":r=n.accounts[0];break;case"eth_chainId":case"net_version":r=n.chainId;break;case"eth_uninstallFilter":this.sendAsync(t,(t=>t)),r=!0;break;default:e=await this.handleOtherRequests(t)}return e||this.formatResponse(t,r)}catch(e){throw this.emit("error",e),e}}async handleOtherRequests(t){if(!F.includes(t.method)&&t.method.startsWith("eth_"))return this.handleReadRequests(t);const e=await this.getWalletConnector(),r=await e.sendCustomRequest(t);return this.formatResponse(t,r)}async handleReadRequests(t){if(!this.http){const t=new Error("HTTP Connection not available");throw this.emit("error",t),t}return this.http.send(t)}formatResponse(t,e){return{id:t.id,jsonrpc:t.jsonrpc,result:e}}getWalletConnector(t={}){const{disableSessionCreation:e=!1}=t;return new Promise(((t,r)=>{const n=this.wc;this.isConnecting?this.onConnect((e=>t(e))):n.connected||e?(this.connected||(this.connected=!0,this.updateState(n.session)),t(n)):(this.isConnecting=!0,n.on("modal_closed",(()=>{r(new Error("User closed modal"))})),n.createSession({chainId:this.chainId}).then((()=>{n.on("connect",((e,i)=>{if(e)return this.isConnecting=!1,r(e);this.isConnecting=!1,this.connected=!0,i&&this.updateState(i.params[0]),this.emit("connect"),this.triggerConnect(n),t(n)}))})).catch((t=>{this.isConnecting=!1,r(t)})))}))}async subscribeWalletConnector(){const t=await this.getWalletConnector();t.on("disconnect",(t=>{t?this.emit("error",t):this.onDisconnect()})),t.on("session_update",((t,e)=>{t?this.emit("error",t):this.updateState(e.params[0])}))}async onDisconnect(){await this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1}async updateState(t){const{accounts:e,chainId:r,networkId:n,rpcUrl:i}=t;(!this.accounts||e&&this.accounts!==e)&&(this.accounts=e,this.emit("accountsChanged",e)),(!this.chainId||r&&this.chainId!==r)&&(this.chainId=r,this.emit("chainChanged",r)),(!this.networkId||n&&this.networkId!==n)&&(this.networkId=n,this.emit("networkChanged",n)),this.updateRpcUrl(this.chainId,i||"")}updateRpcUrl(t,e=""){const r={infuraId:this.infuraId,custom:this.rpc||void 0};(e=e||Et(t,r))?(this.rpcUrl=e,this.updateHttpConnection()):this.emit("error",new Error(`No RPC Url available for chainId: ${t}`))}updateHttpConnection(){this.rpcUrl&&(this.http=new we(this.rpcUrl),this.http.on("payload",(t=>this.emit("payload",t))),this.http.on("error",(t=>this.emit("error",t))))}sendAsyncPromise(t,e){return new Promise(((r,n)=>{this.sendAsync({id:Mt(),jsonrpc:"2.0",method:t,params:e||[]},((t,e)=>{t?n(t):r(e.result)}))}))}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new Ae({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new Me),this.addProvider(new Se),this.addProvider(new Ee),this.addProvider(new ke),this.addProvider(new xe(this.configWallet())),this.addProvider({handleRequest:async(t,e,r)=>{try{const{error:e,result:n}=await this.handleRequest(t);r(e,n)}catch(n){r(n)}},setEngine:t=>t})}configWallet(){return{getAccounts:async t=>{try{const e=(await this.getWalletConnector()).accounts;e&&e.length?t(null,e):t(new Error("Failed to get accounts"))}catch(e){t(e)}},processMessage:async(t,e)=>{try{const r=await this.getWalletConnector();e(null,await r.signMessage([t.from,t.data]))}catch(r){e(r)}},processPersonalMessage:async(t,e)=>{try{const r=await this.getWalletConnector();e(null,await r.signPersonalMessage([t.data,t.from]))}catch(r){e(r)}},processSignTransaction:async(t,e)=>{try{const r=await this.getWalletConnector();e(null,await r.signTransaction(t))}catch(r){e(r)}},processTransaction:async(t,e)=>{try{const r=await this.getWalletConnector();e(null,await r.sendTransaction(t))}catch(r){e(r)}},processTypedMessage:async(t,e)=>{try{const r=await this.getWalletConnector();e(null,await r.signTypedData([t.from,t.data]))}catch(r){e(r)}}}}};let Ie=!1,Pe=!1;const Ce={debug:1,default:2,info:2,warning:3,error:4,off:5};let Te=Ce.default,Oe=null;const Ne=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(r){t.push(e)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var Be,Le;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(Be||(Be={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(Le||(Le={}));const je="0123456789abcdef";class qe{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==Ce[r]&&this.throwArgumentError("invalid log level name","logLevel",t),Te>Ce[r]||console.log.apply(console,e)}debug(...t){this._log(qe.levels.DEBUG,t)}info(...t){this._log(qe.levels.INFO,t)}warn(...t){this._log(qe.levels.WARNING,t)}makeError(t,e,r){if(Pe)return this.makeError("censored error",e,{});e||(e=qe.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((t=>{const e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4],r+=je[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(s){n.push(t+"="+JSON.stringify(r[t].toString()))}})),n.push(`code=${e}`),n.push(`version=${this.version}`);const i=t;let o="";switch(e){case Le.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case Le.CALL_EXCEPTION:case Le.INSUFFICIENT_FUNDS:case Le.MISSING_NEW:case Le.NONCE_EXPIRED:case Le.REPLACEMENT_UNDERPRICED:case Le.TRANSACTION_REPLACED:case Le.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(t+=" ("+n.join(", ")+")");const s=new Error(t);return s.reason=i,s.code=e,Object.keys(r).forEach((function(t){s[t]=r[t]})),s}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,qe.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r,n)}assertArgument(t,e,r,n){t||this.throwArgumentError(e,r,n)}checkNormalize(t){null==t&&(t="platform missing String.prototype.normalize"),Ne&&this.throwError("platform missing String.prototype.normalize",qe.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ne})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,qe.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,qe.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,qe.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",qe.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",qe.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",qe.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Oe||(Oe=new qe("logger/5.7.0")),Oe}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",qe.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ie){if(!t)return;this.globalLogger().throwError("error censorship permanent",qe.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Pe=!!t,Ie=!!e}static setLogLevel(t){const e=Ce[t.toLowerCase()];null!=e?Te=e:qe.globalLogger().warn("invalid log level - "+t)}static from(t){return new qe(t)}}qe.errors=Le,qe.levels=Be;var Ue=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Fe=new qe("properties/5.7.0");function De(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function ze(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function He(t){return Ue(this,void 0,void 0,(function*(){const e=Object.keys(t).map((e=>{const r=t[e];return Promise.resolve(r).then((t=>({key:e,value:t})))}));return(yield Promise.all(e)).reduce(((t,e)=>(t[e.key]=e.value,t)),{})}))}function Ke(t){const e={};for(const r in t)e[r]=t[r];return e}const Ge={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function We(t){if(null==t||Ge[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const r=Object.keys(t);for(let n=0;nZe(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&De(e,r,Ze(n))}return e}return Fe.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function Ze(t){return Ve(t)}class Je{constructor(t){for(const e in t)this[e]=Ze(t[e])}}const Ye="providers/5.7.2";var Qe=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Xe=new qe("abstract-signer/5.7.0"),$e=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],tr=[qe.errors.INSUFFICIENT_FUNDS,qe.errors.NONCE_EXPIRED,qe.errors.REPLACEMENT_UNDERPRICED];class er{constructor(){Xe.checkAbstract(new.target,er),De(this,"_isSigner",!0)}getBalance(t){return Qe(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return Qe(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return Qe(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield He(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return Qe(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield He(this.checkTransaction(t));return yield this.provider.call(r,e)}))}sendTransaction(t){return Qe(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),r=yield this.signTransaction(e);return yield this.provider.sendTransaction(r)}))}getChainId(){return Qe(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Qe(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Qe(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return Qe(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const r in t)-1===$e.indexOf(r)&&Xe.throwArgumentError("invalid transaction key: "+r,"transaction",t);const e=Ke(t);return null==e.from?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then((e=>(e[0].toLowerCase()!==e[1].toLowerCase()&&Xe.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return Qe(this,void 0,void 0,(function*(){const e=yield He(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>Qe(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&Xe.throwArgumentError("provided ENS name resolves to null","tx.to",t),e})))),e.to.catch((t=>{})));const r=null!=e.maxFeePerGas||null!=e.maxPriorityFeePerGas;if(null==e.gasPrice||2!==e.type&&!r?0!==e.type&&1!==e.type||!r||Xe.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):Xe.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t),2!==e.type&&null!=e.type||null==e.maxFeePerGas||null==e.maxPriorityFeePerGas)if(0===e.type||1===e.type)null==e.gasPrice&&(e.gasPrice=this.getGasPrice());else{const t=yield this.getFeeData();if(null==e.type)if(null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)if(e.type=2,null!=e.gasPrice){const t=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=t,e.maxPriorityFeePerGas=t}else null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas);else null!=t.gasPrice?(r&&Xe.throwError("network does not support EIP-1559",qe.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):Xe.throwError("failed to get consistent fee data",qe.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===e.type&&(null==e.maxFeePerGas&&(e.maxFeePerGas=t.maxFeePerGas),null==e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=t.maxPriorityFeePerGas))}else e.type=2;return null==e.nonce&&(e.nonce=this.getTransactionCount("pending")),null==e.gasLimit&&(e.gasLimit=this.estimateGas(e).catch((t=>{if(tr.indexOf(t.code)>=0)throw t;return Xe.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qe.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,tx:e})}))),null==e.chainId?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then((e=>(0!==e[1]&&e[0]!==e[1]&&Xe.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield He(e)}))}_checkProvider(t){this.provider||Xe.throwError("missing provider",qe.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}var rr=r(3877),nr=r.n(rr);const ir=new qe("bytes/5.7.0");function or(t){return!!t.toHexString}function sr(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return sr(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function ar(t){return dr(t)&&!(t.length%2)||cr(t)}function ur(t){return"number"==typeof t&&t==t&&t%1==0}function cr(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!ur(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function lr(t,e){if(e||(e={}),"number"==typeof t){ir.checkSafeUint53(t,"invalid arrayify value");const e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),sr(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),or(t)&&(t=t.toHexString()),dr(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":ir.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let t=0;tlr(t))),r=e.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(r);return e.reduce(((t,e)=>(n.set(e,t),t+e.length)),0),sr(n)}function hr(t){let e=lr(t);if(0===e.length)return e;let r=0;for(;r>4]+pr[15&n]}return e}return ir.throwArgumentError("invalid hexlify value","value",t)}function gr(t){if("string"!=typeof t)t=mr(t);else if(!dr(t)||t.length%2)return null;return(t.length-2)/2}function yr(t,e,r){return"string"!=typeof t?t=mr(t):(!dr(t)||t.length%2)&&ir.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function vr(t){let e="0x";return t.forEach((t=>{e+=mr(t).substring(2)})),e}function br(t){const e=function(t){"string"!=typeof t&&(t=mr(t));dr(t)||ir.throwArgumentError("invalid hex string","value",t);t=t.substring(2);let e=0;for(;e2*e+2&&ir.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function _r(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(ar(t)){let r=lr(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=mr(r.slice(0,32)),e.s=mr(r.slice(32,64))):65===r.length?(e.r=mr(r.slice(0,32)),e.s=mr(r.slice(32,64)),e.v=r[64]):ir.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:ir.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=mr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){const r=function(t,e){(t=lr(t)).length>e&&ir.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),sr(r)}(lr(e._vs),32);e._vs=mr(r);const n=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=n:e.recoveryParam!==n&&ir.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const i=mr(r);null==e.s?e.s=i:e.s!==i&&ir.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?ir.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{const r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&ir.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&dr(e.r)?e.r=wr(e.r,32):ir.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&dr(e.s)?e.s=wr(e.s,32):ir.throwArgumentError("signature missing or invalid s","signature",t);const r=lr(e.s);r[0]>=128&&ir.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=mr(r);e._vs&&(dr(e._vs)||ir.throwArgumentError("signature invalid _vs","signature",t),e._vs=wr(e._vs,32)),null==e._vs?e._vs=n:e._vs!==n&&ir.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var Mr=nr().BN;const Ar=new qe("bignumber/5.7.0"),Er={},xr=9007199254740991;let kr=!1;class Sr{constructor(t,e){t!==Er&&Ar.throwError("cannot call constructor directly; use BigNumber.from",qe.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Ir(Pr(this).fromTwos(t))}toTwos(t){return Ir(Pr(this).toTwos(t))}abs(){return"-"===this._hex[0]?Sr.from(this._hex.substring(1)):this}add(t){return Ir(Pr(this).add(Pr(t)))}sub(t){return Ir(Pr(this).sub(Pr(t)))}div(t){return Sr.from(t).isZero()&&Cr("division-by-zero","div"),Ir(Pr(this).div(Pr(t)))}mul(t){return Ir(Pr(this).mul(Pr(t)))}mod(t){const e=Pr(t);return e.isNeg()&&Cr("division-by-zero","mod"),Ir(Pr(this).umod(e))}pow(t){const e=Pr(t);return e.isNeg()&&Cr("negative-power","pow"),Ir(Pr(this).pow(e))}and(t){const e=Pr(t);return(this.isNegative()||e.isNeg())&&Cr("unbound-bitwise-result","and"),Ir(Pr(this).and(e))}or(t){const e=Pr(t);return(this.isNegative()||e.isNeg())&&Cr("unbound-bitwise-result","or"),Ir(Pr(this).or(e))}xor(t){const e=Pr(t);return(this.isNegative()||e.isNeg())&&Cr("unbound-bitwise-result","xor"),Ir(Pr(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&Cr("negative-width","mask"),Ir(Pr(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Cr("negative-width","shl"),Ir(Pr(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Cr("negative-width","shr"),Ir(Pr(this).shrn(t))}eq(t){return Pr(this).eq(Pr(t))}lt(t){return Pr(this).lt(Pr(t))}lte(t){return Pr(this).lte(Pr(t))}gt(t){return Pr(this).gt(Pr(t))}gte(t){return Pr(this).gte(Pr(t))}isNegative(){return"-"===this._hex[0]}isZero(){return Pr(this).isZero()}toNumber(){try{return Pr(this).toNumber()}catch(t){Cr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return Ar.throwError("this platform does not support BigInt",qe.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?kr||(kr=!0,Ar.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ar.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",qe.errors.UNEXPECTED_ARGUMENT,{}):Ar.throwError("BigNumber.toString does not accept parameters",qe.errors.UNEXPECTED_ARGUMENT,{})),Pr(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof Sr)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new Sr(Er,Rr(t)):t.match(/^-?[0-9]+$/)?new Sr(Er,Rr(new Mr(t))):Ar.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&Cr("underflow","BigNumber.from",t),(t>=xr||t<=-xr)&&Cr("overflow","BigNumber.from",t),Sr.from(String(t));const e=t;if("bigint"==typeof e)return Sr.from(e.toString());if(cr(e))return Sr.from(mr(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return Sr.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(dr(t)||"-"===t[0]&&dr(t.substring(1))))return Sr.from(t)}return Ar.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function Rr(t){if("string"!=typeof t)return Rr(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&Ar.throwArgumentError("invalid hex","value",t),"0x00"===(t=Rr(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function Ir(t){return Sr.from(Rr(t))}function Pr(t){const e=Sr.from(t).toHexString();return"-"===e[0]?new Mr("-"+e.substring(3),16):new Mr(e.substring(2),16)}function Cr(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),Ar.throwError(t,qe.errors.NUMERIC_FAULT,n)}function Tr(t){return"0x"+yt().keccak_256(lr(t))}const Or=new qe("rlp/5.7.0");function Nr(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function Br(t,e,r){let n=0;for(let i=0;ie+1+n&&Or.throwError("child data too short",qe.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function Ur(t,e){if(0===t.length&&Or.throwError("data too short",qe.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Or.throwError("data short segment too short",qe.errors.BUFFER_OVERRUN,{});const n=Br(t,e+1,r);return e+1+r+n>t.length&&Or.throwError("data long segment too short",qe.errors.BUFFER_OVERRUN,{}),qr(t,e,e+1+r,r+n)}if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Or.throwError("data array too short",qe.errors.BUFFER_OVERRUN,{}),qr(t,e,e+1,r)}if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Or.throwError("data array too short",qe.errors.BUFFER_OVERRUN,{});const n=Br(t,e+1,r);e+1+r+n>t.length&&Or.throwError("data array too short",qe.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:mr(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Or.throwError("data too short",qe.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:mr(t.slice(e+1,e+1+r))}}return{consumed:1,result:mr(t[e])}}function Fr(t){const e=lr(t),r=Ur(e,0);return r.consumed!==e.length&&Or.throwArgumentError("invalid rlp data","data",t),r.result}const Dr=new qe("address/5.7.0");function zr(t){dr(t,20)||Dr.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=lr(Tr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&n[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Hr={};for(let of=0;of<10;of++)Hr[String(of)]=String(of);for(let of=0;of<26;of++)Hr[String.fromCharCode(65+of)]=String(10+of);const Kr=Math.floor((Gr=9007199254740991,Math.log10?Math.log10(Gr):Math.log(Gr)/Math.LN10));var Gr;function Wr(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Hr[t])).join("");for(;e.length>=Kr;){let t=e.substring(0,Kr);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Vr(t){let e=null;if("string"!=typeof t&&Dr.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=zr(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Dr.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==Wr(t)&&Dr.throwArgumentError("bad icap checksum","address",t),r=t.substring(4),e=new Mr(r,36).toString(16);e.length<40;)e="0"+e;e=zr("0x"+e)}else Dr.throwArgumentError("invalid address","address",t);var r;return e}const Zr="hash/5.7.0",Jr=new qe("strings/5.7.0");var Yr,Qr;function Xr(t,e,r,n,i){if(t===Qr.BAD_PREFIX||t===Qr.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n>6==2;n++)t++;return t}return t===Qr.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(Yr||(Yr={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(Qr||(Qr={}));const $r=Object.freeze({error:function(t,e,r,n,i){return Jr.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:Xr,replace:function(t,e,r,n,i){return t===Qr.OVERLONG?(n.push(i),0):(n.push(65533),Xr(t,e,r))}});function tn(t,e){null==e&&(e=$r.error),t=lr(t);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){n+=e(128==(192&i)?Qr.UNEXPECTED_CONTINUE:Qr.BAD_PREFIX,n-1,t,r);continue}o=3,s=65535}if(n-1+o>=t.length){n+=e(Qr.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-o-1)-1;for(let u=0;u1114111?n+=e(Qr.OUT_OF_RANGE,n-1-o,t,r,a):a>=55296&&a<=57343?n+=e(Qr.UTF16_SURROGATE,n-1-o,t,r,a):a<=s?n+=e(Qr.OVERLONG,n-1-o,t,r,a):r.push(a))}return r}function en(t,e=Yr.current){e!=Yr.current&&(Jr.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(63&e|128);else if(55296==(64512&e)){n++;const i=t.charCodeAt(n);if(n>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&e)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(e>>12|224),r.push(e>>6&63|128),r.push(63&e|128)}return lr(r)}function rn(t,e){return tn(t,e).map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function nn(t){return Tr(en(t))}var on=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const sn=new qe(Zr),an=new Uint8Array(32);an.fill(0);const un=Sr.from(-1),cn=Sr.from(0),ln=Sr.from(1),fn=Sr.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const hn=wr(ln.toHexString(),32),dn=wr(cn.toHexString(),32),pn={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},mn=["name","version","chainId","verifyingContract","salt"];function gn(t){return function(e){return"string"!=typeof e&&sn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const yn={name:gn("name"),version:gn("version"),chainId:function(t){try{return Sr.from(t).toString()}catch(e){}return sn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Vr(t).toLowerCase()}catch(e){}return sn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=lr(t);if(32!==e.length)throw new Error("bad length");return mr(e)}catch(e){}return sn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function vn(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&sn.throwArgumentError("invalid numeric width","type",t);const i=fn.mask(r?n-1:n),o=r?i.add(ln).mul(un):cn;return function(e){const r=Sr.from(e);return(r.lt(o)||r.gt(i))&&sn.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),wr(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&sn.throwArgumentError("invalid bytes width","type",t),function(e){return lr(e).length!==r&&sn.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=lr(t),r=e.length%32;return r?vr([e,an.slice(r)]):mr(e)}(e)}}}switch(t){case"address":return function(t){return wr(Vr(t),32)};case"bool":return function(t){return t?hn:dn};case"bytes":return function(t){return Tr(t)};case"string":return function(t){return nn(t)}}return null}function bn(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class wn{constructor(t){De(this,"types",Object.freeze(Ze(t))),De(this,"_encoderCache",{}),De(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const o in t){const n={};t[o].forEach((i=>{n[i.name]&&sn.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(o)}`,"types",t),n[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===o&&sn.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);vn(s)||(r[s]||sn.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(o),e[o][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?sn.throwArgumentError("missing primary type","types",t):i.length>1&&sn.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),De(this,"primaryType",i[0]),function i(o,s){s[o]&&sn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const o in n){const e=Object.keys(n[o]);e.sort(),this._types[o]=bn(o,t[o])+e.map((e=>bn(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=vn(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&sn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(Tr)),Tr(vr(i))}}const r=this.types[t];if(r){const e=nn(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?Tr(n):n}));return n.unshift(e),vr(n)}}return sn.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||sn.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Tr(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(vn(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&sn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):sn.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new wn(t)}static getPrimaryType(t){return wn.from(t).primaryType}static hashStruct(t,e,r){return wn.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=pn[r];n||sn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>mn.indexOf(t.name)-mn.indexOf(e.name))),wn.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return vr(["0x1901",wn.hashDomain(t),wn.from(e).hash(r)])}static hash(t,e,r){return Tr(wn.encode(t,e,r))}static resolveNames(t,e,r,n){return on(this,void 0,void 0,(function*(){t=Ke(t);const i={};t.verifyingContract&&!dr(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=wn.from(e);o.visit(r,((t,e)=>("address"!==t||dr(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){wn.hashDomain(t);const n={},i=[];mn.forEach((e=>{const r=t[e];null!=r&&(n[e]=yn[e](r),i.push({name:e,type:pn[e]}))}));const o=wn.from(e),s=Ke(e);return s.EIP712Domain?sn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return mr(lr(e));if(t.match(/^u?int/))return Sr.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&sn.throwArgumentError("invalid string","value",e),e}return sn.throwArgumentError("unsupported type","type",t)}))}}}const _n=Sr.from(0);var Mn=r(2500),An=r.n(Mn),En=r(3715),xn=r.n(En);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;function kn(t,e,r){return r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},t(r,r.exports),r.exports}var Sn=Rn;function Rn(t,e){if(!t)throw new Error(e||"Assertion failed")}Rn.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var In=kn((function(t,e){var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}})),Pn=kn((function(t,e){var r=e;r.assert=Sn,r.toArray=In.toArray,r.zero2=In.zero2,r.toHex=In.toHex,r.encode=In.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,c=e.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0==(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},r.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new(An())(t,"hex","le")}})),Cn=Pn.getNAF,Tn=Pn.getJSF,On=Pn.assert;function Nn(t,e){this.type=t,this.p=new(An())(e.p,16),this.red=e.prime?An().red(e.prime):An().mont(this.p),this.zero=new(An())(0).toRed(this.red),this.one=new(An())(1).toRed(this.red),this.two=new(An())(2).toRed(this.red),this.n=e.n&&new(An())(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Bn=Nn;function Ln(t,e){this.curve=t,this.type=e,this.precomputed=null}Nn.prototype.point=function(){throw new Error("Not implemented")},Nn.prototype.validate=function(){throw new Error("Not implemented")},Nn.prototype._fixedNafMul=function(t,e){On(t.precomputed);var r=t._getDoubles(),n=Cn(e,1,this._bitLength),i=(1<=o;u--)s=(s<<1)+n[u];a.push(s)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var c=o[a];On(0!==c),s="affine"===t.type?c>0?s.mixedAdd(i[c-1>>1]):s.mixedAdd(i[-c-1>>1].neg()):c>0?s.add(i[c-1>>1]):s.add(i[-c-1>>1].neg())}return"affine"===t.type?s.toP():s},Nn.prototype._wnafMulAdd=function(t,e,r,n,i){var o,s,a,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(o=0;o=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=Tn(r[d],r[p]);for(f=Math.max(y[0].length,f),l[d]=new Array(f),l[p]=new Array(f),s=0;s=0;o--){for(var M=0;o>=0;){var A=!0;for(s=0;s=0&&M++,w=w.dblp(M),o<0)break;for(s=0;s0?a=c[s][E-1>>1]:E<0&&(a=c[s][-E-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},Ln.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=e,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]},Un.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(c).neg()}},Un.prototype.pointFromX=function(t,e){(t=new(An())(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(e&&!i||!e&&i)&&(n=n.redNeg()),this.point(t,n)},Un.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Un.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Dn.prototype.isInfinity=function(){return this.inf},Dn.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Dn.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},Dn.prototype.getX=function(){return this.x.fromRed()},Dn.prototype.getY=function(){return this.y.fromRed()},Dn.prototype.mul=function(t){return t=new(An())(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},Dn.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Dn.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Dn.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},Dn.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},Dn.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},jn(zn,Bn.BasePoint),Un.prototype.jpoint=function(t,e,r){return new zn(this,t,e,r)},zn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},zn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},zn.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),f=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},zn.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),l=r.redMul(u),f=a.redSqr().redIAdd(c).redISub(l).redISub(l),h=a.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(f,h,d)},zn.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},zn.prototype.inspect=function(){return this.isInfinity()?"":""},zn.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Hn=kn((function(t,e){var r=e;r.base=Bn,r.short=Fn,r.mont=null,r.edwards=null})),Kn=kn((function(t,e){var r,n=e,i=Pn.assert;function o(t){"short"===t.type?this.curve=new Hn.short(t):"edwards"===t.type?this.curve=new Hn.edwards(t):this.curve=new Hn.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new o(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:xn().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:xn().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:xn().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:xn().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:xn().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xn().sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xn().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(a){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:xn().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Gn(t){if(!(this instanceof Gn))return new Gn(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=In.toArray(t.entropy,t.entropyEnc||"hex"),r=In.toArray(t.nonce,t.nonceEnc||"hex"),n=In.toArray(t.pers,t.persEnc||"hex");Sn(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Wn=Gn;Gn.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Gn.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=In.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var Yn=Pn.assert;function Qn(t,e){if(t instanceof Qn)return t;this._importDER(t,e)||(Yn(t.r&&t.s,"Signature without r or s"),this.r=new(An())(t.r,16),this.s=new(An())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Xn=Qn;function $n(){this.place=0}function ti(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o>>=0;return!(i<=127)&&(e.place=s,i)}function ei(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}Qn.prototype._importDER=function(t,e){t=Pn.toArray(t,e);var r=new $n;if(48!==t[r.place++])return!1;var n=ti(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var i=ti(t,r);if(!1===i)return!1;var o=t.slice(r.place,i+r.place);if(r.place+=i,2!==t[r.place++])return!1;var s=ti(t,r);if(!1===s)return!1;if(t.length!==s+r.place)return!1;var a=t.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(An())(o),this.s=new(An())(a),this.recoveryParam=null,!0},Qn.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=ei(e),r=ei(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];ri(n,e.length),(n=n.concat(e)).push(2),ri(n,r.length);var i=n.concat(r),o=[48];return ri(o,i.length),o=o.concat(i),Pn.encode(o,t)};var ni=function(){throw new Error("unsupported")},ii=Pn.assert;function oi(t){if(!(this instanceof oi))return new oi(t);"string"==typeof t&&(ii(Object.prototype.hasOwnProperty.call(Kn,t),"Unknown curve "+t),t=Kn[t]),t instanceof Kn.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var si=oi;oi.prototype.keyPair=function(t){return new Jn(this,t)},oi.prototype.keyFromPrivate=function(t,e){return Jn.fromPrivate(this,t,e)},oi.prototype.keyFromPublic=function(t,e){return Jn.fromPublic(this,t,e)},oi.prototype.genKeyPair=function(t){t||(t={});for(var e=new Wn({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||ni(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(An())(2));;){var i=new(An())(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},oi.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},oi.prototype.sign=function(t,e,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new(An())(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),s=t.toArray("be",i),a=new Wn({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(An())(1)),c=0;;c++){var l=n.k?n.k(c):new(An())(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var f=this.g.mul(l);if(!f.isInfinity()){var h=f.getX(),d=h.umod(this.n);if(0!==d.cmpn(0)){var p=l.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(f.getY().isOdd()?1:0)|(0!==h.cmp(d)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Xn({r:d,s:p,recoveryParam:m})}}}}}},oi.prototype.verify=function(t,e,r,n){t=this._truncateToN(new(An())(t,16)),r=this.keyFromPublic(r,n);var i=(e=new Xn(e,"hex")).r,o=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),u=a.mul(t).umod(this.n),c=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},oi.prototype.recoverPubKey=function(t,e,r,n){ii((3&r)===r,"The recovery param is more than two bits"),e=new Xn(e,n);var i=this.n,o=new(An())(t),s=e.r,a=e.s,u=1&r,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");s=c?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=e.r.invm(i),f=i.sub(o).mul(l).umod(i),h=a.mul(l).umod(i);return this.g.mulAdd(f,s,h)},oi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new Xn(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var ai=kn((function(t,e){var r=e;r.version="6.5.4",r.utils=Pn,r.rand=function(){throw new Error("unsupported")},r.curve=Hn,r.curves=Kn,r.ec=si,r.eddsa=null})).ec;const ui=new qe("signing-key/5.7.0");let ci=null;function li(){return ci||(ci=new ai("secp256k1")),ci}class fi{constructor(t){De(this,"curve","secp256k1"),De(this,"privateKey",mr(t)),32!==gr(this.privateKey)&&ui.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=li().keyFromPrivate(lr(this.privateKey));De(this,"publicKey","0x"+e.getPublic(!1,"hex")),De(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),De(this,"_isSigningKey",!0)}_addPoint(t){const e=li().keyFromPublic(lr(this.publicKey)),r=li().keyFromPublic(lr(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=li().keyFromPrivate(lr(this.privateKey)),r=lr(t);32!==r.length&&ui.throwArgumentError("bad digest length","digest",t);const n=e.sign(r,{canonical:!0});return _r({recoveryParam:n.recoveryParam,r:wr("0x"+n.r.toString(16),32),s:wr("0x"+n.s.toString(16),32)})}computeSharedSecret(t){const e=li().keyFromPrivate(lr(this.privateKey)),r=li().keyFromPublic(lr(hi(t)));return wr("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function hi(t,e){const r=lr(t);if(32===r.length){const t=new fi(r);return e?"0x"+li().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?mr(r):"0x"+li().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+li().keyFromPublic(r).getPublic(!0,"hex"):mr(r):ui.throwArgumentError("invalid public or private key","key","[REDACTED]")}const di=new qe("transactions/5.7.0");var pi;function mi(t){return"0x"===t?null:Vr(t)}function gi(t){return"0x"===t?_n:Sr.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(pi||(pi={}));function yi(t,e){return function(t){return Vr(yr(Tr(yr(hi(t),1)),12))}(function(t,e){const r=_r(e),n={r:lr(r.r),s:lr(r.s)};return"0x"+li().recoverPubKey(lr(t),n,r.recoveryParam).encode("hex",!1)}(lr(t),e))}function vi(t,e){const r=hr(Sr.from(t).toHexString());return r.length>32&&di.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function bi(t,e){return{address:Vr(t),storageKeys:(e||[]).map(((e,r)=>(32!==gr(e)&&di.throwArgumentError("invalid access list storageKey",`accessList[${t}:${r}]`,e),e.toLowerCase())))}}function wi(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&di.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),bi(t[0],t[1])):bi(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const r=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return bi(e,Object.keys(r).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function _i(t){return wi(t).map((t=>[t.address,t.storageKeys]))}function Mi(t,e){if(null!=t.gasPrice){const e=Sr.from(t.gasPrice),r=Sr.from(t.maxFeePerGas||0);e.eq(r)||di.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:r})}const r=[vi(t.chainId||0,"chainId"),vi(t.nonce||0,"nonce"),vi(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),vi(t.maxFeePerGas||0,"maxFeePerGas"),vi(t.gasLimit||0,"gasLimit"),null!=t.to?Vr(t.to):"0x",vi(t.value||0,"value"),t.data||"0x",_i(t.accessList||[])];if(e){const t=_r(e);r.push(vi(t.recoveryParam,"recoveryParam")),r.push(hr(t.r)),r.push(hr(t.s))}return vr(["0x02",jr(r)])}function Ai(t,e){const r=[vi(t.chainId||0,"chainId"),vi(t.nonce||0,"nonce"),vi(t.gasPrice||0,"gasPrice"),vi(t.gasLimit||0,"gasLimit"),null!=t.to?Vr(t.to):"0x",vi(t.value||0,"value"),t.data||"0x",_i(t.accessList||[])];if(e){const t=_r(e);r.push(vi(t.recoveryParam,"recoveryParam")),r.push(hr(t.r)),r.push(hr(t.s))}return vr(["0x01",jr(r)])}function Ei(t,e,r){try{const r=gi(e[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");t.v=r}catch(n){di.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=wr(e[1],32),t.s=wr(e[2],32);try{const e=Tr(r(t));t.from=yi(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(n){}}function xi(t){const e=lr(t);if(e[0]>127)return function(t){const e=Fr(t);9!==e.length&&6!==e.length&&di.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:gi(e[0]).toNumber(),gasPrice:gi(e[1]),gasLimit:gi(e[2]),to:mi(e[3]),value:gi(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=Sr.from(e[6]).toNumber()}catch(n){return r}if(r.r=wr(e[7],32),r.s=wr(e[8],32),Sr.from(r.r).isZero()&&Sr.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27;const o=e.slice(0,6);0!==r.chainId&&(o.push(mr(r.chainId)),o.push("0x"),o.push("0x"),i-=2*r.chainId+8);const s=Tr(jr(o));try{r.from=yi(s,{r:mr(r.r),s:mr(r.s),recoveryParam:i})}catch(n){}r.hash=Tr(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){const e=Fr(t.slice(1));8!==e.length&&11!==e.length&&di.throwArgumentError("invalid component count for transaction type: 1","payload",mr(t));const r={type:1,chainId:gi(e[0]).toNumber(),nonce:gi(e[1]).toNumber(),gasPrice:gi(e[2]),gasLimit:gi(e[3]),to:mi(e[4]),value:gi(e[5]),data:e[6],accessList:wi(e[7])};return 8===e.length||(r.hash=Tr(t),Ei(r,e.slice(8),Ai)),r}(e);case 2:return function(t){const e=Fr(t.slice(1));9!==e.length&&12!==e.length&&di.throwArgumentError("invalid component count for transaction type: 2","payload",mr(t));const r=gi(e[2]),n=gi(e[3]),i={type:2,chainId:gi(e[0]).toNumber(),nonce:gi(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:gi(e[4]),to:mi(e[5]),value:gi(e[6]),data:e[7],accessList:wi(e[8])};return 9===e.length||(i.hash=Tr(t),Ei(i,e.slice(9),Mi)),i}(e)}return di.throwError(`unsupported transaction type: ${e[0]}`,qe.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}function ki(t){t=atob(t);const e=[];for(let r=0;r{o[e.toLowerCase()]=t})):n.headers.keys().forEach((t=>{o[t.toLowerCase()]=n.headers.get(t)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:lr(new Uint8Array(i))}}))}var Pi=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Ci=new qe("web/5.7.1");function Ti(t){return new Promise((e=>{setTimeout(e,t)}))}function Oi(t,e){if(null==t)return null;if("string"==typeof t)return t;if(ar(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return rn(t)}catch(r){}return mr(t)}return t}function Ni(t,e,r){let n=null;if(null!=e){n=en(e);const r="string"==typeof t?{url:t}:Ke(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=Ke(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return function(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;Ci.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;Ci.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let u=null;const c={method:"GET"};let l=!1,f=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||Ci.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(f=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&Ci.throwError("basic authentication requires a secure https url",qe.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+Si(en(e))}}null!=t.skipFetchSetup&&(c.skipFetchSetup=!!t.skipFetchSetup),null!=t.fetchOptions&&(c.fetchOptions=Ke(t.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),d=u?u.match(h):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]||"text/plain"},body:d[2]?ki(d[3]):(p=d[3],en(p.replace(/%([0-9a-f][0-9a-f])/gi,((t,e)=>String.fromCharCode(parseInt(e,16))))))};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(v){Ci.throwError("processing response error",qe.errors.SERVER_ERROR,{body:Oi(d[1],d[2]),error:v,requestBody:null,requestMethod:"GET",url:u})}var p;e&&(c.method="POST",c.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(a).forEach((t=>{const e=a[t];m[e.key]=e.value})),c.headers=m;const g=function(){let t=null;return{promise:new Promise((function(e,r){f&&(t=setTimeout((()=>{null!=t&&(t=null,r(Ci.makeError("timeout",qe.errors.TIMEOUT,{requestBody:Oi(c.body,m["content-type"]),requestMethod:c.method,timeout:f,url:u})))}),f))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),y=function(){return Pi(this,void 0,void 0,(function*(){for(let t=0;t=300)&&(g.cancel(),Ci.throwError("bad response",qe.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:Oi(a,e.headers?e.headers["content-type"]:null),requestBody:Oi(c.body,m["content-type"]),requestMethod:c.method,url:u})),r)try{const t=yield r(a,e);return g.cancel(),t}catch(v){if(v.throttleRetry&&t{let n=null;if(null!=t)try{n=JSON.parse(rn(t))}catch(i){Ci.throwError("invalid JSON",qe.errors.SERVER_ERROR,{body:t,error:i})}return r&&(n=r(n,e)),n}))}function Bi(t,e){return e||(e={}),null==(e=Ke(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let u=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(u++,u>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));te.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}var Li=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const ji=new qe("abstract-provider/5.7.0");class qi extends Je{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class Ui{constructor(){ji.checkAbstract(new.target,Ui),De(this,"_isProvider",!0)}getFeeData(){return Li(this,void 0,void 0,(function*(){const{block:t,gasPrice:e}=yield He({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let r=null,n=null,i=null;return t&&t.baseFeePerGas&&(r=t.baseFeePerGas,i=Sr.from("1500000000"),n=t.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:e}}))}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}class Fi{constructor(t){De(this,"alphabet",t),De(this,"base",t.length),De(this,"_alphabetMap",{}),De(this,"_leader",t.charAt(0));for(let e=0;e0;)r.push(t%this.base),t=t/this.base|0}let n="";for(let i=0;0===e[i]&&i=0;--i)n+=this.alphabet[r[i]];return n}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r0&&Array.isArray(t)?i(t,e-1):r.push(t)}))};return i(t,e),r}function Hi(t){return function(t){let e=0;return()=>t[e++]}(function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,o=[0,1];for(let w=1;w>--u&1}const f=Math.pow(2,31),h=f>>>1,d=h>>1,p=f-1;let m=0;for(let w=0;w<31;w++)m=m<<1|l();let g=[],y=0,v=f;for(;;){let t=Math.floor(((m-y+1)*i-1)/v),e=0,r=n;for(;r-e>1;){let n=e+r>>>1;t>>1|l(),s=s<<1^h,a=(a^h)<<1|h|1;y=s,v=1+a-s}let b=n-4;return g.map((e=>{switch(e-b){case 3:return b+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return b+256+(t[a++]<<8|t[a++]);case 1:return b+t[a++];default:return e-1}}))}(t))}function Ki(t){return 1&t?~t>>1:t>>1}function Gi(t,e){let r=Array(t);for(let n=0,i=-1;ne[t])):r}function Zi(t,e,r){let n=Array(t).fill(void 0).map((()=>[]));for(let i=0;in[e].push(t)));return n}function Ji(t,e){let r=1+e(),n=e(),i=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return zi(Zi(i.length,1+t,e).map(((t,e)=>{const o=t[0],s=t.slice(1);return Array(i[e]).fill(void 0).map(((t,e)=>{let i=e*n;return[o+e*r,s.map((t=>t+i))]}))})))}function Yi(t,e){return Zi(1+e(),1+t,e).map((t=>[t[0],t.slice(1)]))}const Qi=Hi(ki("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Xi=new Set(Vi(Qi)),$i=new Set(Vi(Qi)),to=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(Ji(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(Yi(r,t))}return function(t){const e={};for(let r=0;rt-e));return function r(){let n=[];for(;;){let i=Vi(t,e);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((t,e)=>e.set.size-t.set.size));let i=t(),o=i%3;i=i/3|0;let s=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:s,save:1==i,check:2==i}}()}(Qi),ro=45,no=95;function io(t){return function(t,e=Yr.current){return tn(en(t,e))}(t)}function oo(t){return t.filter((t=>65039!=t))}function so(t){for(let r of t.split(".")){let t=io(r);try{for(let e=t.lastIndexOf(no)-1;e>=0;e--)if(t[e]!==no)throw new Error("underscore only allowed at start");if(t.length>=4&&t.every((t=>t<128))&&t[2]===ro&&t[3]===ro)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${r}": ${e.message}`)}}return t}function ao(t){return so(function(t,e){let r=io(t).reverse(),n=[];for(;r.length;){let t=uo(r);if(t){n.push(...e(t));continue}let i=r.pop();if(Xi.has(i)){n.push(i);continue}if($i.has(i))continue;let o=to[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return so((i=String.fromCodePoint(...n),i.normalize("NFC")));var i}(t,oo))}function uo(t,e){var r;let n,i,o=eo,s=[],a=t.length;for(e&&(e.length=0);a;){let u=t[--a];if(o=null===(r=o.branches.find((t=>t.set.has(u))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=u;else if(o.check&&u===i)break;s.push(u),o.fe0f&&(s.push(65039),a>0&&65039==t[a-1]&&a--),o.valid&&(n=s.slice(),2==o.valid&&n.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return n}const co=new qe(Zr),lo=new Uint8Array(32);function fo(t){if(0===t.length)throw new Error("invalid ENS name; empty component");return t}function ho(t){const e=en(ao(t)),r=[];if(0===t.length)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(fo(e.slice(n))),r}function po(t){"string"!=typeof t&&co.throwArgumentError("invalid ENS name; not a string","name",t);let e=lo;const r=ho(t);for(;r.length;)e=Tr(fr([e,Tr(r.pop())]));return mr(e)}lo.fill(0);const mo=new qe("networks/5.7.1");function go(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(i){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(i){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(i){}if(e.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby","sepolia"];try{const i=new e.PocketProvider(t,r.pocket);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(i){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(i){}if(e.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(i){}if(0===n.length)return null;if(e.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(n,i)}return n[0]};return e.renetwork=function(t){return go(t)},e}function yo(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return yo(t,e)},r}const vo={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:go("homestead")},bo={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:go("ropsten")},wo={chainId:63,name:"classicMordor",_defaultProvider:yo("https://www.ethercluster.com/mordor","classicMordor")},_o={unspecified:{chainId:0,name:"unspecified"},homestead:vo,mainnet:vo,morden:{chainId:2,name:"morden"},ropsten:bo,testnet:bo,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:go("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:go("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:go("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:go("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:yo("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:wo,classicTestnet:wo,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:yo("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:go("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:go("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};new qe("sha2/5.7.0");function Mo(t){return"0x"+xn().sha256().update(lr(t)).digest("hex")}var Ao=r(3173),Eo=r.n(Ao);const xo=new qe(Ye);class ko{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:ko.allowNull(this.accessList.bind(this),null),blockHash:ko.allowNull(o,null),blockNumber:ko.allowNull(a,null),transactionIndex:ko.allowNull(a,null),confirmations:ko.allowNull(a,null),from:e,gasPrice:ko.allowNull(r),maxPriorityFeePerGas:ko.allowNull(r),maxFeePerGas:ko.allowNull(r),gasLimit:r,to:ko.allowNull(e,null),value:r,nonce:a,data:i,r:ko.allowNull(this.uint256),s:ko.allowNull(this.uint256),v:ko.allowNull(a),creates:ko.allowNull(e,null),raw:ko.allowNull(i)},t.transactionRequest={from:ko.allowNull(e),nonce:ko.allowNull(a),gasLimit:ko.allowNull(r),gasPrice:ko.allowNull(r),maxPriorityFeePerGas:ko.allowNull(r),maxFeePerGas:ko.allowNull(r),to:ko.allowNull(e),value:ko.allowNull(r),data:ko.allowNull((t=>this.data(t,!0))),type:ko.allowNull(a),accessList:ko.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:ko.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:ko.allowNull(this.address,null),from:ko.allowNull(this.address,null),contractAddress:ko.allowNull(e,null),transactionIndex:a,root:ko.allowNull(s),gasUsed:r,logsBloom:ko.allowNull(i),blockHash:o,transactionHash:o,logs:ko.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:ko.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:ko.allowNull(r),status:ko.allowNull(a),type:u},t.block={hash:ko.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:ko.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:ko.allowNull(e),extraData:i,transactions:ko.allowNull(ko.arrayOf(o)),baseFeePerGas:ko.allowNull(r)},t.blockWithTransactions=Ke(t.block),t.blockWithTransactions.transactions=ko.allowNull(ko.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:ko.allowNull(n,void 0),toBlock:ko.allowNull(n,void 0),blockHash:ko.allowNull(o,void 0),address:ko.allowNull(e,void 0),topics:ko.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:ko.allowNull(a),blockHash:ko.allowNull(o),transactionIndex:a,removed:ko.allowNull(this.boolean.bind(this)),address:e,data:ko.allowFalsish(i,"0x"),topics:ko.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return wi(t||[])}number(t){return"0x"===t?0:Sr.from(t).toNumber()}type(t){return"0x"===t||null==t?0:Sr.from(t).toNumber()}bigNumber(t){return Sr.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),dr(t))?t.toLowerCase():xo.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return Vr(t)}callAddress(t){if(!dr(t,32))return null;const e=Vr(yr(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return function(t){let e=null;try{e=Vr(t.from)}catch(r){Dr.throwArgumentError("missing from address","transaction",t)}return Vr(yr(Tr(jr([e,hr(lr(Sr.from(t.nonce).toHexString()))])),12))}(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if("number"==typeof t||dr(t))return br(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==gr(r)?xo.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=Sr.from(t);try{return e.toNumber()}catch(r){}return null}uint256(t){if(!dr(t))throw new Error("invalid uint256");return wr(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=ko.check(e,t);return n._difficulty=null==r?null:Sr.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return ko.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&Sr.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=ko.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;dr(r)&&(r=Sr.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),dr(r)&&(r=Sr.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return xi(t)}receiptLog(t){return ko.check(this.formats.receiptLog,t)}receipt(t){const e=ko.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=Sr.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&xo.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):xo.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&xo.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return ko.check(this.formats.filter,t)}filterLog(t){return ko.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const i in t)try{const n=t[i](e[i]);void 0!==n&&(r[i]=n)}catch(n){throw n.checkKey=i,n.checkValue=e[i],n}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach((function(e){r.push(t(e))})),r}}}var So=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Ro=new qe(Ye);function Io(t){return null==t?"null":(32!==gr(t)&&Ro.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Po(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[Io(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return Io(t)})).join("&")}function Co(t){if("string"==typeof t){if(32===gr(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+Po(t);if(qi.isForkEvent(t))throw Ro.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+Po(t.topics||[])}throw new Error("invalid event - "+t)}function To(){return(new Date).getTime()}function Oo(t){return new Promise((e=>{setTimeout(e,t)}))}const No=["block","network","pending","poll"];class Bo{constructor(t,e,r){De(this,"tag",t),De(this,"listener",e),De(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=""===(n=t[2])?[]:n.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var n;const i={};return r.length>0&&(i.topics=r),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||No.indexOf(this.tag)>=0}}const Lo={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function jo(t){return wr(Sr.from(t).toHexString(),32)}function qo(t){return Di.encode(fr([t,yr(Mo(Mo(t)),0,4)]))}const Uo=new RegExp("^(ipfs)://(.*)$","i"),Fo=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Uo,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Do(t,e){try{return rn(zo(t,e))}catch(r){}return null}function zo(t,e){if("0x"===t)return null;const r=Sr.from(yr(t,e,e+32)).toNumber(),n=Sr.from(yr(t,r,r+32)).toNumber();return yr(t,r+32,r+32+n)}function Ho(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Ro.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Ko(t){const e=lr(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Go(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function Wo(t){const e=[];let r=0;for(let n=0;nSr.from(t).eq(1))).catch((t=>{if(t.code===qe.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return So(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:vr([t,po(this.name),e||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=vr(["0x9061b923",Wo([(i=this.name,mr(fr(ho(i).map((t=>{if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e}))))+"00"),r.data])]));try{let t=yield this.provider.call(r);return lr(t).length%32==4&&Ro.throwError("resolver threw error",qe.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=zo(t,0)),t}catch(o){if(o.code===qe.errors.CALL_EXCEPTION)return null;throw o}}))}_fetchBytes(t,e){return So(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?zo(r,0):null}))}_getAddress(t,e){const r=Lo[String(t)];if(null==r&&Ro.throwError(`unsupported coin type: ${t}`,qe.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=lr(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return qo(fr([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return qo(fr([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=Eo().toWords(n.slice(2));return t.unshift(e),Eo().encode(r.prefix,t)}}return null}getAddress(t){return So(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(n){if(n.code===qe.errors.CALL_EXCEPTION)return null;throw n}const e=yield this._fetchBytes("0xf1cb7e06",jo(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&Ro.throwError("invalid or unsupported coin data",qe.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return So(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;rt[e]))}return Ro.throwError("invalid or unsupported content hash data",qe.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return So(this,void 0,void 0,(function*(){let e=en(t);e=fr([jo(64),jo(e.length),e]),e.length%32!=0&&(e=fr([e,wr("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",mr(e));return null==r||"0x"===r?null:rn(r)}))}}let Zo=null,Jo=1;class Yo extends Ui{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),De(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=ze(new.target,"getNetwork")(t);e?(De(this,"_network",e),this.emit("network",e,null)):Ro.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return So(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(t){}null==e&&(e=yield this.detectNetwork()),e||Ro.throwError("no network detected",qe.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:De(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Bi((()=>this._ready().then((t=>t),(t=>{if(t.code!==qe.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Zo&&(Zo=new ko),Zo}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in _o){const r=_o[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=_o[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=_o[t.name];if(!e)return"number"!=typeof t.chainId&&mo.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&mo.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;var n;return null==r&&e._defaultProvider&&(r=(n=e._defaultProvider)&&"function"==typeof n.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}(null==t?"homestead":t)}ccipReadFetch(t,e,r){return So(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t=0?null:JSON.stringify({data:i,sender:n}),u=yield Ni({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const c=u.message||"unknown error";if(u.status>=400&&u.status<500)return Ro.throwError(`response not found during CCIP fetch: ${c}`,qe.errors.SERVER_ERROR,{url:e,errorMessage:c});o.push(c)}return Ro.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,qe.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return So(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(To()-r.respTime<=t)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===e)break}}const e=To(),r=He({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=To();return(t=Sr.from(t).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return So(this,void 0,void 0,(function*(){const t=Jo++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){return void this.emit("error",n)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Ro.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Ro.makeError("network block skew detected",qe.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0,-2===t._lastBlockNumber&&(t._lastBlockNumber=r-1);const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(o)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return So(this,void 0,void 0,(function*(){return Ro.throwError("provider does not support network detection",qe.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return So(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield Oo(0),this._network;const r=Ro.makeError("underlying network changed",qe.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=To();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&tthis._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return So(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return So(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const u=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},c=t=>{t.confirmations{this.removeListener(t,c)})),n){let r=n.startBlock,i=null;const c=s=>So(this,void 0,void 0,(function*(){a||(yield Oo(1e3),this.getTransactionCount(n.from).then((l=>So(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i{a||this.once("block",c)})))}));if(a)return;this.once("block",c),s.push((()=>{this.removeListener("block",c)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{u()||o(Ro.makeError("timeout exceeded",qe.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return So(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return So(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Sr.from(t)}catch(e){return Ro.throwError("bad result from backend",qe.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return So(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield He({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return Sr.from(n)}catch(i){return Ro.throwError("bad result from backend",qe.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:i})}}))}getTransactionCount(t,e){return So(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield He({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return Sr.from(n).toNumber()}catch(i){return Ro.throwError("bad result from backend",qe.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:i})}}))}getCode(t,e){return So(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield He({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return mr(n)}catch(i){return Ro.throwError("bad result from backend",qe.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:i})}}))}getStorageAt(t,e,r){return So(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield He({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>br(t)))}),i=yield this.perform("getStorageAt",n);try{return mr(i)}catch(o){return Ro.throwError("bad result from backend",qe.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:o})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==gr(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&Ro.throwError("Transaction hash mismatch from Provider.sendTransaction.",qe.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>So(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&Ro.throwError("transaction failed",qe.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return So(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>mr(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(i){throw i.transaction=r,i.transactionHash=r.hash,i}}))}_getTransactionRequest(t){return So(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?Sr.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?mr(t):null)))})),this.formatter.transactionRequest(yield He(r))}))}_getFilter(t){return So(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield He(e))}))}_call(t,e,r){return So(this,void 0,void 0,(function*(){r>=10&&Ro.throwError("CCIP read exceeded maximum redirections",qe.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&gr(i)%32==4)try{const o=yr(i,4),s=yr(o,0,32);Sr.from(s).eq(n)||Ro.throwError("CCIP Read sender did not match",qe.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=Sr.from(yr(o,32,64)).toNumber(),c=Sr.from(yr(o,u,u+32)).toNumber(),l=yr(o,u+32);for(let e=0;eSo(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let n=0;nthis._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return So(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return Bi((()=>So(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return So(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return Bi((()=>So(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return So(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield He({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),ko.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return So(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return So(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&Ro.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return So(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new Vo(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return So(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||Ro.throwError("network does not support ENS",qe.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+po(t).substring(2)});return this.formatter.callAddress(e)}catch(n){}return null}))}resolveName(t){return So(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(r){if(dr(t))throw r}"string"!=typeof t&&Ro.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return So(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=Do(yield this.call({to:r,data:"0x691f3431"+po(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return So(this,void 0,void 0,(function*(){let e=null;if(dr(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(r,"getAvatar");if(!i)return null;e=new Vo(this,i,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(n){if(n.code!==qe.errors.CALL_EXCEPTION)throw n}try{const t=Do(yield this.call({to:i,data:"0x691f3431"+po(r).substring(2)}),0);e=yield this.getResolver(t)}catch(n){if(n.code!==qe.errors.CALL_EXCEPTION)throw n;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return Ro.throwError(t+" not implemented",qe.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new Bo(Co(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=Co(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=Co(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=Co(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,i=Co(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!n||(n=!0,r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const r=Co(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var Qo=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Xo=new qe(Ye),$o=["call","estimateGas"];function ts(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=dr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(const r in t){const n=ts(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return ts(JSON.parse(t),e)}catch(r){}return null}function es(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=ts(e,!0);if(t)return t.data;Xo.throwError("missing revert data in call exception; Transaction reverted without a reason string",qe.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=ts(e.body,!1);null==r&&(r=ts(e,!1)),r&&Xo.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qe.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===qe.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Xo.throwError("insufficient funds for intrinsic transaction cost",qe.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Xo.throwError("nonce has already been used",qe.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Xo.throwError("replacement fee too low",qe.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Xo.throwError("legacy pre-eip-155 transactions not supported",qe.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),$o.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Xo.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qe.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function rs(t){return new Promise((function(e){setTimeout(e,t)}))}function ns(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function is(t){return t?t.toLowerCase():t}const os={};class ss extends er{constructor(t,e,r){if(super(),t!==os)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");De(this,"provider",e),null==r&&(r=0),"string"==typeof r?(De(this,"_address",this.provider.formatter.address(r)),De(this,"_index",null)):"number"==typeof r?(De(this,"_index",r),De(this,"_address",null)):Xo.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return Xo.throwError("cannot alter JSON-RPC Signer connection",qe.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new as(os,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&Xo.throwError("unknown account #"+this._index,qe.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=Ke(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=Ke(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>Qo(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&Xo.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),He({tx:He(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&Xo.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>("string"==typeof t.message&&t.message.match(/user denied/i)&&Xo.throwError("user rejected transaction",qe.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:e}),es("sendTransaction",t,n))))}))}signTransaction(t){return Xo.throwError("signing transactions is unsupported",qe.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Qo(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield Bi((()=>Qo(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}}))}signMessage(t){return Qo(this,void 0,void 0,(function*(){const e="string"==typeof t?en(t):t,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[mr(e),r.toLowerCase()])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&Xo.throwError("user rejected signing",qe.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:t}),n}}))}_legacySignMessage(t){return Qo(this,void 0,void 0,(function*(){const e="string"==typeof t?en(t):t,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),mr(e)])}catch(n){throw"string"==typeof n.message&&n.message.match(/user denied/i)&&Xo.throwError("user rejected signing",qe.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:t}),n}}))}_signTypedData(t,e,r){return Qo(this,void 0,void 0,(function*(){const n=yield wn.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(wn.getPayload(n.domain,e,n.value))])}catch(o){throw"string"==typeof o.message&&o.message.match(/user denied/i)&&Xo.throwError("user rejected signing",qe.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:e,value:n.value}}),o}}))}unlock(t){return Qo(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class as extends ss{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const us={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class cs extends Yo{constructor(t,e){let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=ze(this.constructor,"defaultUrl")()),De(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(Ke(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Qo(this,void 0,void 0,(function*(){yield rs(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(e){}}if(null!=t){const r=ze(this.constructor,"getNetwork");try{return r(Sr.from(t).toNumber())}catch(e){return Xo.throwError("could not detect network",qe.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return Xo.throwError("could not detect network",qe.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new ss(os,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ze(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=Ni(this.connection,JSON.stringify(r),ns).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[is(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[is(e.address),e.blockTag]];case"getCode":return["eth_getCode",[is(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[is(e.address),wr(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[ze(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[ze(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=is(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Qo(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&Sr.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=Ke(e)).transaction=Ke(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&Xo.throwError(t+" not implemented",qe.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(n){return es(t,n,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return rs(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=Ke(us);if(e)for(const s in e)e[s]&&(r[s]=!0);var n,i;i=r,(n=t)&&"object"==typeof n||Fe.throwArgumentError("invalid object","object",n),Object.keys(n).forEach((t=>{i[t]||Fe.throwArgumentError("invalid object key - "+t,"transaction:"+t,n)}));const o={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=br(Sr.from(t[e]));"gasLimit"===e&&(e="gas"),o[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(o[e]=mr(t[e]))})),t.accessList&&(o.accessList=wi(t.accessList)),o}}const ls=new qe(Ye);let fs=1;function hs(t,e){const r="Web3LegacyFetcher";return function(t,n){const i={method:t,params:n,id:fs++,jsonrpc:"2.0"};return new Promise(((t,n)=>{this.emit("debug",{action:"request",fetcher:r,request:Ze(i),provider:this}),e(i,((e,o)=>{if(e)return this.emit("debug",{action:"response",fetcher:r,error:e,request:i,provider:this}),n(e);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:this}),o.error){const t=new Error(o.error.message);return t.code=o.error.code,t.data=o.error.data,n(t)}t(o.result)}))}))}}class ds extends cs{constructor(t,e){null==t&&ls.throwArgumentError("missing provider","provider",t);let r=null,n=null,i=null;"function"==typeof t?(r="unknown:",n=t):(r=t.host||t.path||"",!r&&t.isMetaMask&&(r="metamask"),i=t,t.request?(""===r&&(r="eip-1193:"),n=function(t){return function(e,r){null==r&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Ze(n),provider:this}),t.request(n).then((t=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:t,provider:this}),t}))}}(t)):t.sendAsync?n=hs(0,t.sendAsync.bind(t)):t.send?n=hs(0,t.send.bind(t)):ls.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),De(this,"jsonRpcFetchFunc",n),De(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}var ps=r(917);const ms="undefined"!=typeof window?r(2484):null,gs=(0,s.createContext)({}),ys=t=>{let{children:e}=t;const{0:r,1:n}=(0,s.useState)(void 0),{0:i,1:o}=(0,s.useState)(void 0),a={walletconnect:{package:Re,options:{infuraId:"854b581018fe44a59897b53ee6a19551"}}},u=ms&&new ms.default({cacheProvider:!0,providerOptions:a}),c=void 0!==r,l=c&&new ds(r,"any"),f=l&&l.getSigner(),h=()=>{f.getAddress().then((t=>o(t)))};return(0,s.useEffect)((()=>{r&&(h(),r.on("accountsChanged",h),r.on("chainChanged",h))}),[r]),(0,ps.tZ)(gs.Provider,{value:{web3:r,setWeb3:n,handleConnect:()=>{u.connect().then(n)},isConnected:c,handleAddChain:t=>{var e;l.send("wallet_addEthereumChain",[{chainId:"0x"+t.chainId.toString(16),chainName:t.name,nativeCurrency:t.nativeCurrency,rpcUrls:t.rpc,blockExplorerUrls:null===(e=t.explorers)||void 0===e?void 0:e.map((t=>t.url))}])},address:i}},e)};var vs=r(8032);const bs=t=>{let{name:e,chainId:r,nativeCurrency:n,icon:i,...o}=t;const{isConnected:a,handleConnect:u,handleAddChain:c}=(0,s.useContext)(gs);return(0,ps.tZ)(y,{flexDirection:"column",px:"5",py:"4",borderWidth:"1px",rounded:"md",boxShadow:"base"},(0,ps.tZ)(y,{justifyContent:"space-between"},(0,ps.tZ)(y,{flexDirection:"column",minW:"200px"},(0,ps.tZ)(y,{mb:"2"},(0,ps.tZ)(v.x,{fontSize:"lg",fontWeight:"semibold",lineHeight:"short",isTruncated:!0,verticalAlign:"middle"},e)),(0,ps.tZ)(b,{mb:"2"},(0,ps.tZ)(x,null,(0,ps.tZ)(k,null,"Chain ID"),(0,ps.tZ)(S,{fontSize:"md"},r)),(0,ps.tZ)(x,null,(0,ps.tZ)(k,null,"Currency"),(0,ps.tZ)(S,{fontSize:"md"},n.symbol)))),i&&(0,ps.tZ)(y,null,(0,ps.tZ)(vs.G,{objectFit:"scale-down",image:i,alt:e}))),(0,ps.tZ)(R.M,{mt:"auto"},a?(0,ps.tZ)(L,{onClick:()=>{c({name:e,chainId:r,nativeCurrency:n,...o})}},"Add Chain"):(0,ps.tZ)(L,{onClick:u},"Connect Wallet")))},ws=(0,s.createContext)({}),_s=t=>{let{children:e}=t;const{0:r,1:n}=(0,s.useState)(""),{0:i,1:o}=(0,s.useState)(!1),{0:a,1:u}=(0,s.useState)(!1);return(0,ps.tZ)(ws.Provider,{value:{query:r,setQuery:n,showTestnets:i,setShowTestnets:o,showDeprecated:a,setShowDeprecated:u}},e)},Ms=t=>{let{chains:e}=t;const{query:r,showTestnets:n,showDeprecated:i}=(0,s.useContext)(ws),o=r.toLowerCase(),u=e.filter((t=>{const e=t.name.toLowerCase(),s=!n&&(t.faucets.length>0||e.includes("testnet")),a=!i&&"deprecated"===t.status;return!s&&!a&&(!(r.length>0)||(t.name.toLowerCase().includes(o)||t.chainId.toString().includes(r)||t.nativeCurrency.symbol.toLowerCase().includes(o)))}));return(0,ps.tZ)(g,{minChildWidth:"300px",spacing:4},u.map((t=>(0,ps.tZ)(bs,(0,a.Z)({key:t.id},t)))))};var As=r(4418),Es={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function xs(t){return null!=t&&"object"==typeof t&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function ks(t){var e;if(!xs(t))return!1;return t instanceof(null!=(e=t.ownerDocument.defaultView)?e:window).HTMLElement}function Ss(t){return xs(t)?t.ownerDocument:document}function Rs(t){return["html","body","#document"].includes(t.localName)?t.ownerDocument.body:ks(t)&&function(t){const e=t.ownerDocument.defaultView||window,{overflow:r,overflowX:n,overflowY:i}=e.getComputedStyle(t);return/auto|scroll|overlay|hidden/.test(r+i+n)}(t)?t:Rs(function(t){return"html"===t.localName?t:t.assignedSlot||t.parentElement||t.ownerDocument.documentElement}(t))}var Is=(t,e)=>({var:t,varRef:e?`var(${t}, ${e})`:`var(${t})`}),Ps={arrowShadowColor:Is("--popper-arrow-shadow-color"),arrowSize:Is("--popper-arrow-size","8px"),arrowSizeHalf:Is("--popper-arrow-size-half"),arrowBg:Is("--popper-arrow-bg"),transformOrigin:Is("--popper-transform-origin"),arrowOffset:Is("--popper-arrow-offset")};var Cs={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},Ts={scroll:!0,resize:!0};function Os(t){let e;return e="object"==typeof t?{enabled:!0,options:{...Ts,...t}}:{enabled:t,options:Ts},e}var Ns={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:t})=>{t.styles.popper.width=`${t.rects.reference.width}px`},effect:({state:t})=>()=>{const e=t.elements.reference;t.elements.popper.style.width=`${e.offsetWidth}px`}},Bs={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:t})=>{Ls(t)},effect:({state:t})=>()=>{Ls(t)}},Ls=t=>{var e;t.elements.popper.style.setProperty(Ps.transformOrigin.var,(e=t.placement,Cs[e]))},js={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:t})=>{qs(t)}},qs=t=>{var e;if(!t.placement)return;const r=Us(t.placement);if((null==(e=t.elements)?void 0:e.arrow)&&r){Object.assign(t.elements.arrow.style,{[r.property]:r.value,width:Ps.arrowSize.varRef,height:Ps.arrowSize.varRef,zIndex:-1});const e={[Ps.arrowSizeHalf.var]:`calc(${Ps.arrowSize.varRef} / 2 - 1px)`,[Ps.arrowOffset.var]:`calc(${Ps.arrowSizeHalf.varRef} * -1)`};for(const r in e)t.elements.arrow.style.setProperty(r,e[r])}},Us=t=>t.startsWith("top")?{property:"bottom",value:Ps.arrowOffset.varRef}:t.startsWith("bottom")?{property:"top",value:Ps.arrowOffset.varRef}:t.startsWith("left")?{property:"right",value:Ps.arrowOffset.varRef}:t.startsWith("right")?{property:"left",value:Ps.arrowOffset.varRef}:void 0,Fs={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:t})=>{Ds(t)},effect:({state:t})=>()=>{Ds(t)}},Ds=t=>{if(!t.elements.arrow)return;const e=t.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!e)return;const r=(n=t.placement).includes("top")?"1px 1px 0px 0 var(--popper-arrow-shadow-color)":n.includes("bottom")?"-1px -1px 0px 0 var(--popper-arrow-shadow-color)":n.includes("right")?"-1px 1px 0px 0 var(--popper-arrow-shadow-color)":n.includes("left")?"1px -1px 0px 0 var(--popper-arrow-shadow-color)":void 0;var n;r&&e.style.setProperty("--popper-arrow-default-shadow",r),Object.assign(e.style,{transform:"rotate(45deg)",background:Ps.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},zs={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},Hs={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function Ks(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Gs(t){return t instanceof Ks(t).Element||t instanceof Element}function Ws(t){return t instanceof Ks(t).HTMLElement||t instanceof HTMLElement}function Vs(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Ks(t).ShadowRoot||t instanceof ShadowRoot)}var Zs=Math.max,Js=Math.min,Ys=Math.round;function Qs(t,e){void 0===e&&(e=!1);var r=t.getBoundingClientRect(),n=1,i=1;if(Ws(t)&&e){var o=t.offsetHeight,s=t.offsetWidth;s>0&&(n=Ys(r.width)/s||1),o>0&&(i=Ys(r.height)/o||1)}return{width:r.width/n,height:r.height/i,top:r.top/i,right:r.right/n,bottom:r.bottom/i,left:r.left/n,x:r.left/n,y:r.top/i}}function Xs(t){var e=Ks(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function $s(t){return t?(t.nodeName||"").toLowerCase():null}function ta(t){return((Gs(t)?t.ownerDocument:t.document)||window.document).documentElement}function ea(t){return Qs(ta(t)).left+Xs(t).scrollLeft}function ra(t){return Ks(t).getComputedStyle(t)}function na(t){var e=ra(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function ia(t,e,r){void 0===r&&(r=!1);var n,i,o=Ws(e),s=Ws(e)&&function(t){var e=t.getBoundingClientRect(),r=Ys(e.width)/t.offsetWidth||1,n=Ys(e.height)/t.offsetHeight||1;return 1!==r||1!==n}(e),a=ta(e),u=Qs(t,s),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!r)&&(("body"!==$s(e)||na(a))&&(c=(n=e)!==Ks(n)&&Ws(n)?{scrollLeft:(i=n).scrollLeft,scrollTop:i.scrollTop}:Xs(n)),Ws(e)?((l=Qs(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=ea(a))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function oa(t){var e=Qs(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function sa(t){return"html"===$s(t)?t:t.assignedSlot||t.parentNode||(Vs(t)?t.host:null)||ta(t)}function aa(t){return["html","body","#document"].indexOf($s(t))>=0?t.ownerDocument.body:Ws(t)&&na(t)?t:aa(sa(t))}function ua(t,e){var r;void 0===e&&(e=[]);var n=aa(t),i=n===(null==(r=t.ownerDocument)?void 0:r.body),o=Ks(n),s=i?[o].concat(o.visualViewport||[],na(n)?n:[]):n,a=e.concat(s);return i?a:a.concat(ua(sa(s)))}function ca(t){return["table","td","th"].indexOf($s(t))>=0}function la(t){return Ws(t)&&"fixed"!==ra(t).position?t.offsetParent:null}function fa(t){for(var e=Ks(t),r=la(t);r&&ca(r)&&"static"===ra(r).position;)r=la(r);return r&&("html"===$s(r)||"body"===$s(r)&&"static"===ra(r).position)?e:r||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Ws(t)&&"fixed"===ra(t).position)return null;for(var r=sa(t);Ws(r)&&["html","body"].indexOf($s(r))<0;){var n=ra(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(t)||e}var ha="top",da="bottom",pa="right",ma="left",ga="auto",ya=[ha,da,pa,ma],va="start",ba="end",wa="clippingParents",_a="viewport",Ma="popper",Aa="reference",Ea=ya.reduce((function(t,e){return t.concat([e+"-"+va,e+"-"+ba])}),[]),xa=[].concat(ya,[ga]).reduce((function(t,e){return t.concat([e,e+"-"+va,e+"-"+ba])}),[]),ka=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Sa(t){var e=new Map,r=new Set,n=[];function i(t){r.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!r.has(t)){var n=e.get(t);n&&i(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){r.has(t.name)||i(t)})),n}var Ra={placement:"bottom",modifiers:[],strategy:"absolute"};function Ia(){for(var t=arguments.length,e=new Array(t),r=0;r=0?"x":"y"}function Ba(t){var e,r=t.reference,n=t.element,i=t.placement,o=i?Ta(i):null,s=i?Oa(i):null,a=r.x+r.width/2-n.width/2,u=r.y+r.height/2-n.height/2;switch(o){case ha:e={x:a,y:r.y-n.height};break;case da:e={x:a,y:r.y+r.height};break;case pa:e={x:r.x+r.width,y:u};break;case ma:e={x:r.x-n.width,y:u};break;default:e={x:r.x,y:r.y}}var c=o?Na(o):null;if(null!=c){var l="y"===c?"height":"width";switch(s){case va:e[c]=e[c]-(r[l]/2-n[l]/2);break;case ba:e[c]=e[c]+(r[l]/2-n[l]/2)}}return e}var La={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ja(t){var e,r=t.popper,n=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,u=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,f=t.isFixed,h=s.x,d=void 0===h?0:h,p=s.y,m=void 0===p?0:p,g="function"==typeof l?l({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var y=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),b=ma,w=ha,_=window;if(c){var M=fa(r),A="clientHeight",E="clientWidth";if(M===Ks(r)&&"static"!==ra(M=ta(r)).position&&"absolute"===a&&(A="scrollHeight",E="scrollWidth"),i===ha||(i===ma||i===pa)&&o===ba)w=da,m-=(f&&_.visualViewport?_.visualViewport.height:M[A])-n.height,m*=u?1:-1;if(i===ma||(i===ha||i===da)&&o===ba)b=pa,d-=(f&&_.visualViewport?_.visualViewport.width:M[E])-n.width,d*=u?1:-1}var x,k=Object.assign({position:a},c&&La),S=!0===l?function(t){var e=t.x,r=t.y,n=window.devicePixelRatio||1;return{x:Ys(e*n)/n||0,y:Ys(r*n)/n||0}}({x:d,y:m}):{x:d,y:m};return d=S.x,m=S.y,u?Object.assign({},k,((x={})[w]=v?"0":"",x[b]=y?"0":"",x.transform=(_.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",x)):Object.assign({},k,((e={})[w]=v?m+"px":"",e[b]=y?d+"px":"",e.transform="",e))}var qa={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,r=t.options,n=t.name,i=r.offset,o=void 0===i?[0,0]:i,s=xa.reduce((function(t,r){return t[r]=function(t,e,r){var n=Ta(t),i=[ma,ha].indexOf(n)>=0?-1:1,o="function"==typeof r?r(Object.assign({},e,{placement:t})):r,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[ma,pa].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}(r,e.rects,o),t}),{}),a=s[e.placement],u=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=s}},Ua={left:"right",right:"left",bottom:"top",top:"bottom"};function Fa(t){return t.replace(/left|right|bottom|top/g,(function(t){return Ua[t]}))}var Da={start:"end",end:"start"};function za(t){return t.replace(/start|end/g,(function(t){return Da[t]}))}function Ha(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&Vs(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ka(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ga(t,e){return e===_a?Ka(function(t){var e=Ks(t),r=ta(t),n=e.visualViewport,i=r.clientWidth,o=r.clientHeight,s=0,a=0;return n&&(i=n.width,o=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=n.offsetLeft,a=n.offsetTop)),{width:i,height:o,x:s+ea(t),y:a}}(t)):Gs(e)?function(t){var e=Qs(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Ka(function(t){var e,r=ta(t),n=Xs(t),i=null==(e=t.ownerDocument)?void 0:e.body,o=Zs(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Zs(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-n.scrollLeft+ea(t),u=-n.scrollTop;return"rtl"===ra(i||r).direction&&(a+=Zs(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:u}}(ta(t)))}function Wa(t,e,r){var n="clippingParents"===e?function(t){var e=ua(sa(t)),r=["absolute","fixed"].indexOf(ra(t).position)>=0&&Ws(t)?fa(t):t;return Gs(r)?e.filter((function(t){return Gs(t)&&Ha(t,r)&&"body"!==$s(t)})):[]}(t):[].concat(e),i=[].concat(n,[r]),o=i[0],s=i.reduce((function(e,r){var n=Ga(t,r);return e.top=Zs(n.top,e.top),e.right=Js(n.right,e.right),e.bottom=Js(n.bottom,e.bottom),e.left=Zs(n.left,e.left),e}),Ga(t,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Va(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Za(t,e){return e.reduce((function(e,r){return e[r]=t,e}),{})}function Ja(t,e){void 0===e&&(e={});var r=e,n=r.placement,i=void 0===n?t.placement:n,o=r.boundary,s=void 0===o?wa:o,a=r.rootBoundary,u=void 0===a?_a:a,c=r.elementContext,l=void 0===c?Ma:c,f=r.altBoundary,h=void 0!==f&&f,d=r.padding,p=void 0===d?0:d,m=Va("number"!=typeof p?p:Za(p,ya)),g=l===Ma?Aa:Ma,y=t.rects.popper,v=t.elements[h?g:l],b=Wa(Gs(v)?v:v.contextElement||ta(t.elements.popper),s,u),w=Qs(t.elements.reference),_=Ba({reference:w,element:y,strategy:"absolute",placement:i}),M=Ka(Object.assign({},y,_)),A=l===Ma?M:w,E={top:b.top-A.top+m.top,bottom:A.bottom-b.bottom+m.bottom,left:b.left-A.left+m.left,right:A.right-b.right+m.right},x=t.modifiersData.offset;if(l===Ma&&x){var k=x[i];Object.keys(E).forEach((function(t){var e=[pa,da].indexOf(t)>=0?1:-1,r=[ha,da].indexOf(t)>=0?"y":"x";E[t]+=k[r]*e}))}return E}var Ya={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,o=void 0===i||i,s=r.altAxis,a=void 0===s||s,u=r.fallbackPlacements,c=r.padding,l=r.boundary,f=r.rootBoundary,h=r.altBoundary,d=r.flipVariations,p=void 0===d||d,m=r.allowedAutoPlacements,g=e.options.placement,y=Ta(g),v=u||(y===g||!p?[Fa(g)]:function(t){if(Ta(t)===ga)return[];var e=Fa(t);return[za(t),e,za(e)]}(g)),b=[g].concat(v).reduce((function(t,r){return t.concat(Ta(r)===ga?function(t,e){void 0===e&&(e={});var r=e,n=r.placement,i=r.boundary,o=r.rootBoundary,s=r.padding,a=r.flipVariations,u=r.allowedAutoPlacements,c=void 0===u?xa:u,l=Oa(n),f=l?a?Ea:Ea.filter((function(t){return Oa(t)===l})):ya,h=f.filter((function(t){return c.indexOf(t)>=0}));0===h.length&&(h=f);var d=h.reduce((function(e,r){return e[r]=Ja(t,{placement:r,boundary:i,rootBoundary:o,padding:s})[Ta(r)],e}),{});return Object.keys(d).sort((function(t,e){return d[t]-d[e]}))}(e,{placement:r,boundary:l,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:m}):r)}),[]),w=e.rects.reference,_=e.rects.popper,M=new Map,A=!0,E=b[0],x=0;x=0,P=I?"width":"height",C=Ja(e,{placement:k,boundary:l,rootBoundary:f,altBoundary:h,padding:c}),T=I?R?pa:ma:R?da:ha;w[P]>_[P]&&(T=Fa(T));var O=Fa(T),N=[];if(o&&N.push(C[S]<=0),a&&N.push(C[T]<=0,C[O]<=0),N.every((function(t){return t}))){E=k,A=!1;break}M.set(k,N)}if(A)for(var B=function(t){var e=b.find((function(e){var r=M.get(e);if(r)return r.slice(0,t).every((function(t){return t}))}));if(e)return E=e,"break"},L=p?3:1;L>0;L--){if("break"===B(L))break}e.placement!==E&&(e.modifiersData[n]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Qa(t,e,r){return Zs(t,Js(e,r))}var Xa={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,o=void 0===i||i,s=r.altAxis,a=void 0!==s&&s,u=r.boundary,c=r.rootBoundary,l=r.altBoundary,f=r.padding,h=r.tether,d=void 0===h||h,p=r.tetherOffset,m=void 0===p?0:p,g=Ja(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:l}),y=Ta(e.placement),v=Oa(e.placement),b=!v,w=Na(y),_="x"===w?"y":"x",M=e.modifiersData.popperOffsets,A=e.rects.reference,E=e.rects.popper,x="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,k="number"==typeof x?{mainAxis:x,altAxis:x}:Object.assign({mainAxis:0,altAxis:0},x),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(M){if(o){var I,P="y"===w?ha:ma,C="y"===w?da:pa,T="y"===w?"height":"width",O=M[w],N=O+g[P],B=O-g[C],L=d?-E[T]/2:0,j=v===va?A[T]:E[T],q=v===va?-E[T]:-A[T],U=e.elements.arrow,F=d&&U?oa(U):{width:0,height:0},D=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=D[P],H=D[C],K=Qa(0,A[T],F[T]),G=b?A[T]/2-L-K-z-k.mainAxis:j-K-z-k.mainAxis,W=b?-A[T]/2+L+K+H+k.mainAxis:q+K+H+k.mainAxis,V=e.elements.arrow&&fa(e.elements.arrow),Z=V?"y"===w?V.clientTop||0:V.clientLeft||0:0,J=null!=(I=null==S?void 0:S[w])?I:0,Y=O+W-J,Q=Qa(d?Js(N,O+G-J-Z):N,O,d?Zs(B,Y):B);M[w]=Q,R[w]=Q-O}if(a){var X,$="x"===w?ha:ma,tt="x"===w?da:pa,et=M[_],rt="y"===_?"height":"width",nt=et+g[$],it=et-g[tt],ot=-1!==[ha,ma].indexOf(y),st=null!=(X=null==S?void 0:S[_])?X:0,at=ot?nt:et-A[rt]-E[rt]-st+k.altAxis,ut=ot?et+A[rt]+E[rt]-st-k.altAxis:it,ct=d&&ot?function(t,e,r){var n=Qa(t,e,r);return n>r?r:n}(at,et,ut):Qa(d?at:nt,et,d?ut:it);M[_]=ct,R[_]=ct-et}e.modifiersData[n]=R}},requiresIfExists:["offset"]};var $a={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,r=t.state,n=t.name,i=t.options,o=r.elements.arrow,s=r.modifiersData.popperOffsets,a=Ta(r.placement),u=Na(a),c=[ma,pa].indexOf(a)>=0?"height":"width";if(o&&s){var l=function(t,e){return Va("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Za(t,ya))}(i.padding,r),f=oa(o),h="y"===u?ha:ma,d="y"===u?da:pa,p=r.rects.reference[c]+r.rects.reference[u]-s[u]-r.rects.popper[c],m=s[u]-r.rects.reference[u],g=fa(o),y=g?"y"===u?g.clientHeight||0:g.clientWidth||0:0,v=p/2-m/2,b=l[h],w=y-f[c]-l[d],_=y/2-f[c]/2+v,M=Qa(b,_,w),A=u;r.modifiersData[n]=((e={})[A]=M,e.centerOffset=M-_,e)}},effect:function(t){var e=t.state,r=t.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Ha(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function tu(t,e,r){return void 0===r&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function eu(t){return[ha,pa,da,ma].some((function(e){return t[e]>=0}))}var ru=Pa({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,o=void 0===i||i,s=n.resize,a=void 0===s||s,u=Ks(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",r.update,Ca)})),a&&u.addEventListener("resize",r.update,Ca),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",r.update,Ca)})),a&&u.removeEventListener("resize",r.update,Ca)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,r=t.name;e.modifiersData[r]=Ba({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=void 0===n||n,o=r.adaptive,s=void 0===o||o,a=r.roundOffsets,u=void 0===a||a,c={placement:Ta(e.placement),variation:Oa(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,ja(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,ja(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},i=e.elements[t];Ws(i)&&$s(i)&&(Object.assign(i.style,r),Object.keys(n).forEach((function(t){var e=n[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],i=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:r[t]).reduce((function(t,e){return t[e]="",t}),{});Ws(n)&&$s(n)&&(Object.assign(n.style,o),Object.keys(i).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]},qa,Ya,Xa,$a,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Ja(e,{elementContext:"reference"}),a=Ja(e,{altBoundary:!0}),u=tu(s,n),c=tu(a,i,o),l=eu(u),f=eu(c);e.modifiersData[r]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}}]});function nu(t={}){const{enabled:e=!0,modifiers:r,placement:n="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:u,gutter:c=8,flip:l=!0,boundary:f="clippingParents",preventOverflow:h=!0,matchWidth:d,direction:p="ltr"}=t,m=(0,s.useRef)(null),g=(0,s.useRef)(null),y=(0,s.useRef)(null),v=function(t,e="ltr"){var r,n;const i=(null==(r=zs[t])?void 0:r[e])||t;return"ltr"===e?i:null!=(n=Hs[t])?n:i}(n,p),b=(0,s.useRef)((()=>{})),w=(0,s.useCallback)((()=>{var t;e&&m.current&&g.current&&(null==(t=b.current)||t.call(b),y.current=ru(m.current,g.current,{placement:v,modifiers:[Fs,js,Bs,{...Ns,enabled:!!d},{name:"eventListeners",...Os(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:null!=u?u:[0,c]}},{name:"flip",enabled:!!l,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:f}},...null!=r?r:[]],strategy:i}),y.current.forceUpdate(),b.current=y.current.destroy)}),[v,e,r,d,a,o,u,c,l,h,f,i]);(0,s.useEffect)((()=>()=>{var t;m.current||g.current||(null==(t=y.current)||t.destroy(),y.current=null)}),[]);const _=(0,s.useCallback)((t=>{m.current=t,w()}),[w]),M=(0,s.useCallback)(((t={},e=null)=>({...t,ref:N(_,e)})),[_]),A=(0,s.useCallback)((t=>{g.current=t,w()}),[w]),E=(0,s.useCallback)(((t={},e=null)=>({...t,ref:N(A,e),style:{...t.style,position:i,minWidth:d?void 0:"max-content",inset:"0 auto auto 0"}})),[i,A,d]),x=(0,s.useCallback)(((t={},e=null)=>{const{size:r,shadowColor:n,bg:i,style:o,...s}=t;return{...s,ref:e,"data-popper-arrow":"",style:iu(t)}}),[]),k=(0,s.useCallback)(((t={},e=null)=>({...t,ref:e,"data-popper-arrow-inner":""})),[]);return{update(){var t;null==(t=y.current)||t.update()},forceUpdate(){var t;null==(t=y.current)||t.forceUpdate()},transformOrigin:Ps.transformOrigin.varRef,referenceRef:_,popperRef:A,getPopperProps:E,getArrowProps:x,getArrowInnerProps:k,getReferenceProps:M}}function iu(t){const{size:e,shadowColor:r,bg:n,style:i}=t,o={...i,position:"absolute"};return e&&(o["--popper-arrow-size"]=e),r&&(o["--popper-arrow-shadow-color"]=r),n&&(o["--popper-arrow-bg"]=n),o}var ou=r(5155);function su(t={}){const{onClose:e,onOpen:r,isOpen:n,id:i}=t,o=(0,ou.W)(r),a=(0,ou.W)(e),[u,c]=(0,s.useState)(t.defaultIsOpen||!1),l=void 0!==n?n:u,f=void 0!==n,h=(0,s.useId)(),d=null!=i?i:`disclosure-${h}`,p=(0,s.useCallback)((()=>{f||c(!1),null==a||a()}),[f,a]),m=(0,s.useCallback)((()=>{f||c(!0),null==o||o()}),[f,o]),g=(0,s.useCallback)((()=>{l?p():m()}),[l,m,p]);return{isOpen:l,onOpen:m,onClose:p,onToggle:g,isControlled:f,getButtonProps:function(t={}){return{...t,"aria-expanded":l,"aria-controls":d,onClick(e){var r;null==(r=t.onClick)||r.call(t,e),g()}}},getDisclosureProps:function(t={}){return{...t,hidden:!l,id:d}}}}function au(t,e,r,n){const i=(0,ou.W)(r);return(0,s.useEffect)((()=>{const o="function"==typeof t?t():null!=t?t:document;if(r&&o)return o.addEventListener(e,i,n),()=>{o.removeEventListener(e,i,n)}}),[e,t,n,i,r]),()=>{const r="function"==typeof t?t():null!=t?t:document;null==r||r.removeEventListener(e,i,n)}}var uu=t=>{var e;return(null==(e=t.current)?void 0:e.ownerDocument)||document},cu=t=>{var e,r;return(null==(r=null==(e=t.current)?void 0:e.ownerDocument)?void 0:r.defaultView)||window};function lu(t={}){const{openDelay:e=0,closeDelay:r=0,closeOnClick:n=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:u=!0,onOpen:c,onClose:l,placement:f,id:h,isOpen:d,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:y,arrowPadding:v,modifiers:b,isDisabled:w,gutter:_,offset:M,direction:A,...E}=t,{isOpen:x,onOpen:k,onClose:S}=su({isOpen:d,defaultIsOpen:m,onOpen:c,onClose:l}),{referenceRef:R,getPopperProps:I,getArrowInnerProps:P,getArrowProps:C}=nu({enabled:x,placement:f,arrowPadding:v,modifiers:b,gutter:_,offset:M,direction:A}),T=(0,s.useId)(),O=`tooltip-${null!=h?h:T}`,B=(0,s.useRef)(null),L=(0,s.useRef)(),j=(0,s.useCallback)((()=>{L.current&&(clearTimeout(L.current),L.current=void 0)}),[]),q=(0,s.useRef)(),U=(0,s.useCallback)((()=>{q.current&&(clearTimeout(q.current),q.current=void 0)}),[]),F=(0,s.useCallback)((()=>{U(),S()}),[S,U]),D=function(t,e){return(0,s.useEffect)((()=>{const r=uu(t);return r.addEventListener(fu,e),()=>r.removeEventListener(fu,e)}),[e,t]),()=>{const e=uu(t),r=cu(t);e.dispatchEvent(new r.CustomEvent(fu))}}(B,F),z=(0,s.useCallback)((()=>{if(!w&&!L.current){D();const t=cu(B);L.current=t.setTimeout(k,e)}}),[D,w,k,e]),H=(0,s.useCallback)((()=>{j();const t=cu(B);q.current=t.setTimeout(F,r)}),[r,F,j]),K=(0,s.useCallback)((()=>{x&&n&&H()}),[n,H,x]),G=(0,s.useCallback)((()=>{x&&a&&H()}),[a,H,x]),W=(0,s.useCallback)((t=>{x&&"Escape"===t.key&&H()}),[x,H]);au((()=>uu(B)),"keydown",u?W:void 0),au((()=>{const t=B.current;if(!t)return null;const e=Rs(t);return"body"===e.localName?cu(B):e}),"scroll",(()=>{x&&o&&F()}),{passive:!0,capture:!0}),(0,s.useEffect)((()=>{w&&(j(),x&&S())}),[w,x,S,j]),(0,s.useEffect)((()=>()=>{j(),U()}),[j,U]),au((()=>B.current),"pointerleave",H);const V=(0,s.useCallback)(((t={},e=null)=>({...t,ref:N(B,e,R),onPointerEnter:(0,p.v0)(t.onPointerEnter,(t=>{"touch"!==t.pointerType&&z()})),onClick:(0,p.v0)(t.onClick,K),onPointerDown:(0,p.v0)(t.onPointerDown,G),onFocus:(0,p.v0)(t.onFocus,z),onBlur:(0,p.v0)(t.onBlur,H),"aria-describedby":x?O:void 0})),[z,H,G,x,O,K,R]),Z=(0,s.useCallback)(((t={},e=null)=>I({...t,style:{...t.style,[Ps.arrowSize.var]:g?`${g}px`:void 0,[Ps.arrowShadowColor.var]:y}},e)),[I,g,y]),J=(0,s.useCallback)(((t={},e=null)=>{const r={...t.style,position:"relative",transformOrigin:Ps.transformOrigin.varRef};return{ref:e,...E,...t,id:O,role:"tooltip",style:r}}),[E,O]);return{isOpen:x,show:z,hide:H,getTriggerProps:V,getTooltipProps:J,getTooltipPositionerProps:Z,getArrowProps:C,getArrowInnerProps:P}}var fu="chakra-ui:close-tooltip";var hu=r(9598),du=r(954),pu=r(7828);var mu=(0,c.m)(du.E.div),gu=(0,u.G)(((t,e)=>{var r,n;const i=(0,_.mq)("Tooltip",t),o=(0,M.Lr)(t),a=(0,h.F)(),{children:u,label:f,shouldWrapChildren:d,"aria-label":p,hasArrow:m,bg:g,portalProps:y,background:v,backgroundColor:b,bgColor:w,motionProps:A,...E}=o,x=null!=(n=null!=(r=null!=v?v:b)?r:g)?n:w;if(x){i.bg=x;const t=(0,M.K1)(a,"colors",x);i[Ps.arrowBg.var]=t}const k=lu({...E,direction:a.direction});let S;if("string"==typeof u||d)S=(0,l.jsx)(c.m.span,{display:"inline-block",tabIndex:0,...k.getTriggerProps(),children:u});else{const t=s.Children.only(u);S=(0,s.cloneElement)(t,k.getTriggerProps(t.props,t.ref))}const R=!!p,I=k.getTooltipProps({},e),P=R?function(t,e=[]){const r=Object.assign({},t);for(const n of e)n in r&&delete r[n];return r}(I,["role","id"]):I,C=function(t,e){const r={};for(const n of e)n in t&&(r[n]=t[n]);return r}(I,["role","id"]);return f?(0,l.jsxs)(l.Fragment,{children:[S,(0,l.jsx)(pu.M,{children:k.isOpen&&(0,l.jsx)(hu.h,{...y,children:(0,l.jsx)(c.m.div,{...k.getTooltipPositionerProps(),__css:{zIndex:i.zIndex,pointerEvents:"none"},children:(0,l.jsxs)(mu,{variants:Es,initial:"exit",animate:"enter",exit:"exit",...A,...P,__css:i,children:[f,R&&(0,l.jsx)(c.m.span,{srOnly:!0,...C,children:p}),m&&(0,l.jsx)(c.m.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:(0,l.jsx)(c.m.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:i.bg}})})]})})})})]}):(0,l.jsx)(l.Fragment,{children:u})}));gu.displayName="Tooltip";var yu=(0,u.G)((function(t,e){const r=(0,_.mq)("Link",t),{className:n,isExternal:i,...o}=(0,M.Lr)(t);return(0,l.jsx)(c.m.a,{target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:e,className:(0,p.cx)("chakra-link",n),...o,__css:r})}));yu.displayName="Link";var vu=(0,u.G)(((t,e)=>{const{icon:r,children:n,isRound:i,"aria-label":o,...a}=t,u=r||n,c=(0,s.isValidElement)(u)?(0,s.cloneElement)(u,{"aria-hidden":!0,focusable:!1}):null;return(0,l.jsx)(L,{padding:"0",borderRadius:i?"full":void 0,ref:e,"aria-label":o,...a,children:c})}));vu.displayName="IconButton";var bu=r(6877);function wu(t){const{viewBox:e="0 0 24 24",d:r,displayName:n,defaultProps:i={}}=t,o=s.Children.toArray(t.path),a=(0,u.G)(((t,n)=>(0,l.jsx)(bu.J,{ref:n,viewBox:e,...i,...t,children:o.length?o:(0,l.jsx)("path",{fill:"currentColor",d:r})})));return a.displayName=n,a}var _u=wu({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"}),Mu=wu({displayName:"SunIcon",path:(0,l.jsxs)("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[(0,l.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,l.jsx)("path",{d:"M12 1v2"}),(0,l.jsx)("path",{d:"M12 21v2"}),(0,l.jsx)("path",{d:"M4.22 4.22l1.42 1.42"}),(0,l.jsx)("path",{d:"M18.36 18.36l1.42 1.42"}),(0,l.jsx)("path",{d:"M1 12h2"}),(0,l.jsx)("path",{d:"M21 12h2"}),(0,l.jsx)("path",{d:"M4.22 19.78l1.42-1.42"}),(0,l.jsx)("path",{d:"M18.36 5.64l1.42-1.42"})]})}),Au=r(2498);const Eu=t=>{const{colorMode:e,toggleColorMode:r}=(0,Au.If)();return(0,ps.tZ)(gu,{label:"Toggle Dark Mode"},(0,ps.tZ)(vu,(0,a.Z)({},t,{"aria-label":"Toggle Dark Mode",onClick:r,icon:"light"===e?(0,ps.tZ)(_u,null):(0,ps.tZ)(Mu,null)})))};var xu=wu({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});var ku=r(7052),[Su,Ru]=(0,w.k)({name:"InputGroupStylesContext",errorMessage:"useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),Iu=(0,u.G)((function(t,e){const r=(0,_.jC)("Input",t),{children:n,className:i,...o}=(0,M.Lr)(t),a=(0,p.cx)("chakra-input__group",i),u={},f=function(t){return s.Children.toArray(t).filter((t=>(0,s.isValidElement)(t)))}(n),h=r.field;f.forEach((t=>{var e,n;r&&(h&&"InputLeftElement"===t.type.id&&(u.paddingStart=null!=(e=h.height)?e:h.h),h&&"InputRightElement"===t.type.id&&(u.paddingEnd=null!=(n=h.height)?n:h.h),"InputRightAddon"===t.type.id&&(u.borderEndRadius=0),"InputLeftAddon"===t.type.id&&(u.borderStartRadius=0))}));const d=f.map((e=>{var r,n;const i=(0,ku.o)({size:(null==(r=e.props)?void 0:r.size)||t.size,variant:(null==(n=e.props)?void 0:n.variant)||t.variant});return"Input"!==e.type.id?(0,s.cloneElement)(e,i):(0,s.cloneElement)(e,Object.assign(i,u,e.props))}));return(0,l.jsx)(c.m.div,{className:a,ref:e,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate"},"data-group":!0,...o,children:(0,l.jsx)(Su,{value:r,children:d})})}));Iu.displayName="InputGroup";var Pu=(0,c.m)("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),Cu=(0,u.G)((function(t,e){var r,n;const{placement:i="left",...o}=t,s=Ru(),a=s.field,u={["left"===i?"insetStart":"insetEnd"]:"0",width:null!=(r=null==a?void 0:a.height)?r:null==a?void 0:a.h,height:null!=(n=null==a?void 0:a.height)?n:null==a?void 0:a.h,fontSize:null==a?void 0:a.fontSize,...s.element};return(0,l.jsx)(Pu,{ref:e,__css:u,...o})}));Cu.id="InputElement",Cu.displayName="InputElement";var Tu=(0,u.G)((function(t,e){const{className:r,...n}=t,i=(0,p.cx)("chakra-input__left-element",r);return(0,l.jsx)(Cu,{ref:e,placement:"left",className:i,...n})}));Tu.id="InputLeftElement",Tu.displayName="InputLeftElement";var Ou=(0,u.G)((function(t,e){const{className:r,...n}=t,i=(0,p.cx)("chakra-input__right-element",r);return(0,l.jsx)(Cu,{ref:e,placement:"right",className:i,...n})}));Ou.id="InputRightElement",Ou.displayName="InputRightElement";var[Nu,Bu]=(0,w.k)({name:"FormControlStylesContext",errorMessage:"useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),[Lu,ju]=(0,w.k)({strict:!1,name:"FormControlContext"});var qu=(0,u.G)((function(t,e){const r=(0,_.jC)("Form",t),n=(0,M.Lr)(t),{getRootProps:i,htmlProps:o,...a}=function(t){const{id:e,isRequired:r,isInvalid:n,isDisabled:i,isReadOnly:o,...a}=t,u=(0,s.useId)(),c=e||`field-${u}`,l=`${c}-label`,f=`${c}-feedback`,h=`${c}-helptext`,[d,m]=(0,s.useState)(!1),[g,y]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),w=(0,s.useCallback)(((t={},e=null)=>({id:h,...t,ref:N(e,(t=>{t&&y(!0)}))})),[h]),_=(0,s.useCallback)(((t={},e=null)=>({...t,ref:e,"data-focus":(0,p.PB)(v),"data-disabled":(0,p.PB)(i),"data-invalid":(0,p.PB)(n),"data-readonly":(0,p.PB)(o),id:void 0!==t.id?t.id:l,htmlFor:void 0!==t.htmlFor?t.htmlFor:c})),[c,i,v,n,o,l]),M=(0,s.useCallback)(((t={},e=null)=>({id:f,...t,ref:N(e,(t=>{t&&m(!0)})),"aria-live":"polite"})),[f]),A=(0,s.useCallback)(((t={},e=null)=>({...t,...a,ref:e,role:"group"})),[a]),E=(0,s.useCallback)(((t={},e=null)=>({...t,ref:e,role:"presentation","aria-hidden":!0,children:t.children||"*"})),[]);return{isRequired:!!r,isInvalid:!!n,isReadOnly:!!o,isDisabled:!!i,isFocused:!!v,onFocus:()=>b(!0),onBlur:()=>b(!1),hasFeedbackText:d,setHasFeedbackText:m,hasHelpText:g,setHasHelpText:y,id:c,labelId:l,feedbackId:f,helpTextId:h,htmlProps:a,getHelpTextProps:w,getErrorMessageProps:M,getRootProps:A,getLabelProps:_,getRequiredIndicatorProps:E}}(n),u=(0,p.cx)("chakra-form-control",t.className);return(0,l.jsx)(Lu,{value:a,children:(0,l.jsx)(Nu,{value:r,children:(0,l.jsx)(c.m.div,{...i({},e),className:u,__css:r.container})})})}));function Uu(t){var e,r,n;const i=ju(),{id:o,disabled:s,readOnly:a,required:u,isRequired:c,isInvalid:l,isReadOnly:f,isDisabled:h,onFocus:d,onBlur:m,...g}=t,y=t["aria-describedby"]?[t["aria-describedby"]]:[];return(null==i?void 0:i.hasFeedbackText)&&(null==i?void 0:i.isInvalid)&&y.push(i.feedbackId),(null==i?void 0:i.hasHelpText)&&y.push(i.helpTextId),{...g,"aria-describedby":y.join(" ")||void 0,id:null!=o?o:null==i?void 0:i.id,isDisabled:null!=(e=null!=s?s:h)?e:null==i?void 0:i.isDisabled,isReadOnly:null!=(r=null!=a?a:f)?r:null==i?void 0:i.isReadOnly,isRequired:null!=(n=null!=u?u:c)?n:null==i?void 0:i.isRequired,isInvalid:null!=l?l:null==i?void 0:i.isInvalid,onFocus:(0,p.v0)(null==i?void 0:i.onFocus,d),onBlur:(0,p.v0)(null==i?void 0:i.onBlur,m)}}qu.displayName="FormControl",(0,u.G)((function(t,e){const r=ju(),n=Bu(),i=(0,p.cx)("chakra-form__helper-text",t.className);return(0,l.jsx)(c.m.div,{...null==r?void 0:r.getHelpTextProps(t,e),__css:n.helperText,className:i})})).displayName="FormHelperText";var Fu=(0,u.G)((function(t,e){const{htmlSize:r,...n}=t,i=(0,_.jC)("Input",n),o=function(t){const{isDisabled:e,isInvalid:r,isReadOnly:n,isRequired:i,...o}=Uu(t);return{...o,disabled:e,readOnly:n,required:i,"aria-invalid":(0,p.Qm)(r),"aria-required":(0,p.Qm)(i),"aria-readonly":(0,p.Qm)(n)}}((0,M.Lr)(n)),s=(0,p.cx)("chakra-input",t.className);return(0,l.jsx)(c.m.input,{size:r,...o,__css:i.field,ref:e,className:s})}));Fu.displayName="Input",Fu.id="Input";const Du=()=>{const{setQuery:t}=(0,s.useContext)(ws),{0:e,1:r}=(0,s.useState)(""),n=((t,e)=>{const{0:r,1:n}=(0,s.useState)(t);return(0,s.useEffect)((()=>{const r=setTimeout((()=>n(t)),e);return()=>{clearTimeout(r)}}),[t,e]),r})(e,250);return(0,s.useEffect)((()=>{t(n)}),[n]),(0,ps.tZ)(Iu,{size:"lg",mx:{base:0,md:"5"},mb:{base:"2",md:0}},(0,ps.tZ)(Tu,{pointerEvents:"none",children:(0,ps.tZ)(xu,{color:"gray.300"})}),(0,ps.tZ)(Fu,{type:"text",placeholder:"Search",value:e,onChange:t=>r(t.target.value)}))};var zu=r(9583),Hu=wu({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});function Ku(t){const{isOpen:e,ref:r}=t,[n,i]=(0,s.useState)(e),[o,a]=(0,s.useState)(!1);(0,s.useEffect)((()=>{o||(i(e),a(!0))}),[e,o,n]),au((()=>r.current),"animationend",(()=>{i(e)}));return{present:!(!e&&!n),onComplete(){var t;const e=function(t){var e,r;return null!=(r=null==(e=Ss(t))?void 0:e.defaultView)?r:window}(r.current),n=new e.CustomEvent("animationend",{bubbles:!0});null==(t=r.current)||t.dispatchEvent(n)}}}var Gu=()=>"undefined"!=typeof window;var Wu=t=>Gu()&&t.test(function(){var t;const e=navigator.userAgentData;return null!=(t=null==e?void 0:e.platform)?t:navigator.platform}()),Vu=()=>{return Wu(/mac|iphone|ipad|ipod/i)&&(t=/apple/i,Gu()&&t.test(navigator.vendor));var t};var Zu=t=>t.hasAttribute("tabindex"),Ju=t=>Zu(t)&&-1===t.tabIndex;function Yu(t){return!(!t.parentElement||!Yu(t.parentElement))||t.hidden}function Qu(t){if(!ks(t)||Yu(t)||function(t){return!0===Boolean(t.getAttribute("disabled"))||!0===Boolean(t.getAttribute("aria-disabled"))}(t))return!1;const{localName:e}=t;if(["input","select","textarea","button"].indexOf(e)>=0)return!0;const r={a:()=>t.hasAttribute("href"),audio:()=>t.hasAttribute("controls"),video:()=>t.hasAttribute("controls")};return e in r?r[e]():!!function(t){const e=t.getAttribute("contenteditable");return"false"!==e&&null!=e}(t)||Zu(t)}var Xu=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"].join(),$u=t=>t.offsetWidth>0&&t.offsetHeight>0;function tc(t){const e=Array.from(t.querySelectorAll(Xu));return e.unshift(t),e.filter((t=>Qu(t)&&$u(t)))}var ec=r(6245),rc=r(2366);function nc(t){const e=t.current;if(!e)return!1;const r=Ss(e).activeElement;var n;return!!r&&(!e.contains(r)&&!(!((n=r)&&ks(n)&&Qu(n))||Ju(n)))}var ic={preventScroll:!0,shouldFocus:!1};var oc={click:"click",hover:"hover"};function sc(t={}){const{closeOnBlur:e=!0,closeOnEsc:r=!0,initialFocusRef:n,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:u,arrowShadowColor:c,trigger:l=oc.click,openDelay:f=200,closeDelay:h=200,isLazy:d,lazyBehavior:m="unmount",computePositionOnMount:g,...y}=t,{isOpen:v,onClose:b,onOpen:w,onToggle:_}=su(t),M=(0,s.useRef)(null),A=(0,s.useRef)(null),E=(0,s.useRef)(null),x=(0,s.useRef)(!1),k=(0,s.useRef)(!1);v&&(k.current=!0);const[S,R]=(0,s.useState)(!1),[I,P]=(0,s.useState)(!1),C=(0,s.useId)(),T=null!=i?i:C,[O,B,L,j]=["popover-trigger","popover-content","popover-header","popover-body"].map((t=>`${t}-${T}`)),{referenceRef:q,getArrowProps:U,getPopperProps:F,getArrowInnerProps:D,forceUpdate:z}=nu({...y,enabled:v||!!g}),H=Ku({isOpen:v,ref:E});!function(t){const{ref:e,elements:r,enabled:n}=t,i=()=>{var t,r;return null!=(r=null==(t=e.current)?void 0:t.ownerDocument)?r:document};au(i,"pointerdown",(t=>{if(!Vu()||!n)return;const o=t.target,s=(null!=r?r:[e]).some((t=>{const e="current"in t?t.current:t;return(null==e?void 0:e.contains(o))||e===o}));i().activeElement!==o&&s&&(t.preventDefault(),o.focus())}))}({enabled:v,ref:A}),function(t,e){const{shouldFocus:r,visible:n,focusRef:i}=e,o=r&&!n;(0,rc.r)((()=>{if(!o)return;if(nc(t))return;const e=(null==i?void 0:i.current)||t.current;let r;return e?(r=requestAnimationFrame((()=>{e.focus({preventScroll:!0})})),()=>{cancelAnimationFrame(r)}):void 0}),[o,t,i])}(E,{focusRef:A,visible:v,shouldFocus:o&&l===oc.click}),function(t,e=ic){const{focusRef:r,preventScroll:n,shouldFocus:i,visible:o}=e,a="current"in t?t.current:t,u=i&&o,c=(0,s.useRef)(u),l=(0,s.useRef)(o);(0,ec.G)((()=>{!l.current&&o&&(c.current=u),l.current=o}),[o,u]);const f=(0,s.useCallback)((()=>{if(o&&a&&c.current&&(c.current=!1,!a.contains(document.activeElement)))if(null==r?void 0:r.current)requestAnimationFrame((()=>{var t;null==(t=r.current)||t.focus({preventScroll:n})}));else{const t=tc(a);t.length>0&&requestAnimationFrame((()=>{t[0].focus({preventScroll:n})}))}}),[o,n,a,r]);(0,rc.r)((()=>{f()}),[f]),au(a,"transitionend",f)}(E,{focusRef:n,visible:v,shouldFocus:a&&l===oc.click});const K=function(t){const{wasSelected:e,enabled:r,isSelected:n,mode:i="unmount"}=t;return!r||!!n||!("keepMounted"!==i||!e)}({wasSelected:k.current,enabled:d,mode:m,isSelected:H.present}),G=(0,s.useCallback)(((t={},n=null)=>{const i={...t,style:{...t.style,transformOrigin:Ps.transformOrigin.varRef,[Ps.arrowSize.var]:u?`${u}px`:void 0,[Ps.arrowShadowColor.var]:c},ref:N(E,n),children:K?t.children:null,id:B,tabIndex:-1,role:"dialog",onKeyDown:(0,p.v0)(t.onKeyDown,(t=>{r&&"Escape"===t.key&&b()})),onBlur:(0,p.v0)(t.onBlur,(t=>{const r=uc(t),n=ac(E.current,r),i=ac(A.current,r);v&&e&&(!n&&!i)&&b()})),"aria-labelledby":S?L:void 0,"aria-describedby":I?j:void 0};return l===oc.hover&&(i.role="tooltip",i.onMouseEnter=(0,p.v0)(t.onMouseEnter,(()=>{x.current=!0})),i.onMouseLeave=(0,p.v0)(t.onMouseLeave,(t=>{null!==t.nativeEvent.relatedTarget&&(x.current=!1,setTimeout((()=>b()),h))}))),i}),[K,B,S,L,I,j,l,r,b,v,e,h,c,u]),W=(0,s.useCallback)(((t={},e=null)=>F({...t,style:{visibility:v?"visible":"hidden",...t.style}},e)),[v,F]),V=(0,s.useCallback)(((t,e=null)=>({...t,ref:N(e,M,q)})),[M,q]),Z=(0,s.useRef)(),J=(0,s.useRef)(),Y=(0,s.useCallback)((t=>{null==M.current&&q(t)}),[q]),Q=(0,s.useCallback)(((t={},r=null)=>{const n={...t,ref:N(A,r,Y),id:O,"aria-haspopup":"dialog","aria-expanded":v,"aria-controls":B};return l===oc.click&&(n.onClick=(0,p.v0)(t.onClick,_)),l===oc.hover&&(n.onFocus=(0,p.v0)(t.onFocus,(()=>{void 0===Z.current&&w()})),n.onBlur=(0,p.v0)(t.onBlur,(t=>{const r=uc(t),n=!ac(E.current,r);v&&e&&n&&b()})),n.onKeyDown=(0,p.v0)(t.onKeyDown,(t=>{"Escape"===t.key&&b()})),n.onMouseEnter=(0,p.v0)(t.onMouseEnter,(()=>{x.current=!0,Z.current=window.setTimeout((()=>w()),f)})),n.onMouseLeave=(0,p.v0)(t.onMouseLeave,(()=>{x.current=!1,Z.current&&(clearTimeout(Z.current),Z.current=void 0),J.current=window.setTimeout((()=>{!1===x.current&&b()}),h)}))),n}),[O,v,B,l,Y,_,w,e,b,f,h]);(0,s.useEffect)((()=>()=>{Z.current&&clearTimeout(Z.current),J.current&&clearTimeout(J.current)}),[]);const X=(0,s.useCallback)(((t={},e=null)=>({...t,id:L,ref:N(e,(t=>{R(!!t)}))})),[L]),$=(0,s.useCallback)(((t={},e=null)=>({...t,id:j,ref:N(e,(t=>{P(!!t)}))})),[j]);return{forceUpdate:z,isOpen:v,onAnimationComplete:H.onComplete,onClose:b,getAnchorProps:V,getArrowProps:U,getArrowInnerProps:D,getPopoverPositionerProps:W,getPopoverProps:G,getTriggerProps:Q,getHeaderProps:X,getBodyProps:$}}function ac(t,e){return t===e||(null==t?void 0:t.contains(e))}function uc(t){var e;const r=t.currentTarget.ownerDocument.activeElement;return null!=(e=t.relatedTarget)?e:r}var[cc,lc]=(0,w.k)({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[fc,hc]=(0,w.k)({name:"PopoverStylesContext",errorMessage:"usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "});function dc(t){const e=(0,_.jC)("Popover",t),{children:r,...n}=(0,M.Lr)(t),i=sc({...n,direction:(0,h.F)().direction});return(0,l.jsx)(cc,{value:i,children:(0,l.jsx)(fc,{value:e,children:(0,p.Pu)(r,{isOpen:i.isOpen,onClose:i.onClose,forceUpdate:i.forceUpdate})})})}function pc(t){const e=s.Children.only(t.children),{getTriggerProps:r}=lc();return(0,s.cloneElement)(e,r(e.props,e.ref))}function mc(t){if(t)return{enter:{...t.enter,visibility:"visible"},exit:{...t.exit,transitionEnd:{visibility:"hidden"}}}}dc.displayName="Popover",pc.displayName="PopoverTrigger";var gc={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},yc=(0,c.m)(du.E.section),vc=(0,u.G)((function(t,e){const{variants:r=gc,...n}=t,{isOpen:i}=lc();return(0,l.jsx)(yc,{ref:e,variants:mc(r),initial:!1,animate:i?"enter":"exit",...n})}));vc.displayName="PopoverTransition";var bc=(0,u.G)((function(t,e){const{rootProps:r,motionProps:n,...i}=t,{getPopoverProps:o,getPopoverPositionerProps:s,onAnimationComplete:a}=lc(),u=hc(),f={position:"relative",display:"flex",flexDirection:"column",...u.content};return(0,l.jsx)(c.m.div,{...s(r),__css:u.popper,className:"chakra-popover__popper",children:(0,l.jsx)(vc,{...n,...o(i,e),onAnimationComplete:(0,p.PP)(a,i.onAnimationComplete),className:(0,p.cx)("chakra-popover__content",t.className),__css:f})})}));bc.displayName="PopoverContent";var wc=(t,e)=>e?`${t}.${e}, ${e}`:void 0;function _c(t){var e;const{bg:r,bgColor:n,backgroundColor:i,shadow:o,boxShadow:s,shadowColor:a}=t,{getArrowProps:u,getArrowInnerProps:f}=lc(),h=hc(),d=null!=(e=null!=r?r:n)?e:i,m=null!=o?o:s;return(0,l.jsx)(c.m.div,{...u(),className:"chakra-popover__arrow-positioner",children:(0,l.jsx)(c.m.div,{className:(0,p.cx)("chakra-popover__arrow",t.className),...f(t),__css:{"--popper-arrow-shadow-color":wc("colors",a),"--popper-arrow-bg":wc("colors",d),"--popper-arrow-shadow":wc("shadows",m),...h.arrow}})})}_c.displayName="PopoverArrow";var Mc=(0,u.G)((function(t,e){const{getBodyProps:r}=lc(),n=hc();return(0,l.jsx)(c.m.div,{...r(t,e),className:(0,p.cx)("chakra-popover__body",t.className),__css:n.body})}));Mc.displayName="PopoverBody";var Ac=(0,u.G)((function(t,e){var r;const n=(0,_.mq)("FormLabel",t),i=(0,M.Lr)(t),{className:o,children:s,requiredIndicator:a=(0,l.jsx)(Ec,{}),optionalIndicator:u=null,...f}=i,h=ju(),d=null!=(r=null==h?void 0:h.getLabelProps(f,e))?r:{ref:e,...f};return(0,l.jsxs)(c.m.label,{...d,className:(0,p.cx)("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...n},children:[s,(null==h?void 0:h.isRequired)?a:u]})}));Ac.displayName="FormLabel";var Ec=(0,u.G)((function(t,e){const r=ju(),n=Bu();if(!(null==r?void 0:r.isRequired))return null;const i=(0,p.cx)("chakra-form__required-indicator",t.className);return(0,l.jsx)(c.m.span,{...null==r?void 0:r.getRequiredIndicatorProps(t,e),__css:n.requiredIndicator,className:i})}));Ec.displayName="RequiredIndicator";var xc={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},kc=!1,Sc=null,Rc=!1,Ic=!1,Pc=new Set;function Cc(t,e){Pc.forEach((r=>r(t,e)))}var Tc="undefined"!=typeof window&&null!=window.navigator&&/^Mac/.test(window.navigator.platform);function Oc(t){var e;Rc=!0,(e=t).metaKey||!Tc&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(Sc="keyboard",Cc("keyboard",t))}function Nc(t){if(Sc="pointer","mousedown"===t.type||"pointerdown"===t.type){Rc=!0;const e=t.composedPath?t.composedPath()[0]:t.target;let r=!1;try{r=e.matches(":focus-visible")}catch{}if(r)return;Cc("pointer",t)}}function Bc(t){var e;(0===(e=t).mozInputSource&&e.isTrusted||0===e.detail&&!e.pointerType)&&(Rc=!0,Sc="virtual")}function Lc(t){t.target!==window&&t.target!==document&&(Rc||Ic||(Sc="virtual",Cc("virtual",t)),Rc=!1,Ic=!1)}function jc(){Rc=!1,Ic=!0}function qc(){return"pointer"!==Sc}function Uc(){if("undefined"==typeof window||kc)return;const{focus:t}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...e){Rc=!0,t.apply(this,e)},document.addEventListener("keydown",Oc,!0),document.addEventListener("keyup",Oc,!0),document.addEventListener("click",Bc,!0),window.addEventListener("focus",Lc,!0),window.addEventListener("blur",jc,!1),"undefined"!=typeof PointerEvent?(document.addEventListener("pointerdown",Nc,!0),document.addEventListener("pointermove",Nc,!0),document.addEventListener("pointerup",Nc,!0)):(document.addEventListener("mousedown",Nc,!0),document.addEventListener("mousemove",Nc,!0),document.addEventListener("mouseup",Nc,!0)),kc=!0}function Fc(t){Uc(),t(qc());const e=()=>t(qc());return Pc.add(e),()=>{Pc.delete(e)}}function Dc(t={}){const e=Uu(t),{isDisabled:r,isReadOnly:n,isRequired:i,isInvalid:o,id:a,onBlur:u,onFocus:c,"aria-describedby":l}=e,{defaultChecked:f,isChecked:h,isFocusable:d,onChange:m,isIndeterminate:g,name:y,value:v,tabIndex:b,"aria-label":w,"aria-labelledby":_,"aria-invalid":M,...A}=t,E=function(t,e=[]){const r=Object.assign({},t);for(const n of e)n in r&&delete r[n];return r}(A,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),x=(0,ou.W)(m),k=(0,ou.W)(u),S=(0,ou.W)(c),[R,I]=(0,s.useState)(!1),[P,C]=(0,s.useState)(!1),[T,O]=(0,s.useState)(!1),[B,L]=(0,s.useState)(!1);(0,s.useEffect)((()=>Fc(I)),[]);const j=(0,s.useRef)(null),[q,U]=(0,s.useState)(!0),[F,D]=(0,s.useState)(!!f),z=void 0!==h,H=z?h:F,K=(0,s.useCallback)((t=>{n||r?t.preventDefault():(z||D(H?t.target.checked:!!g||t.target.checked),null==x||x(t))}),[n,r,H,z,g,x]);(0,ec.G)((()=>{j.current&&(j.current.indeterminate=Boolean(g))}),[g]),(0,rc.r)((()=>{r&&C(!1)}),[r,C]),(0,ec.G)((()=>{const t=j.current;(null==t?void 0:t.form)&&(t.form.onreset=()=>{D(!!f)})}),[]);const G=r&&!d,W=(0,s.useCallback)((t=>{" "===t.key&&L(!0)}),[L]),V=(0,s.useCallback)((t=>{" "===t.key&&L(!1)}),[L]);(0,ec.G)((()=>{if(!j.current)return;j.current.checked!==H&&D(j.current.checked)}),[j.current]);const Z=(0,s.useCallback)(((t={},e=null)=>({...t,ref:e,"data-active":(0,p.PB)(B),"data-hover":(0,p.PB)(T),"data-checked":(0,p.PB)(H),"data-focus":(0,p.PB)(P),"data-focus-visible":(0,p.PB)(P&&R),"data-indeterminate":(0,p.PB)(g),"data-disabled":(0,p.PB)(r),"data-invalid":(0,p.PB)(o),"data-readonly":(0,p.PB)(n),"aria-hidden":!0,onMouseDown:(0,p.v0)(t.onMouseDown,(t=>{P&&t.preventDefault(),L(!0)})),onMouseUp:(0,p.v0)(t.onMouseUp,(()=>L(!1))),onMouseEnter:(0,p.v0)(t.onMouseEnter,(()=>O(!0))),onMouseLeave:(0,p.v0)(t.onMouseLeave,(()=>O(!1)))})),[B,H,r,P,R,T,g,o,n]),J=(0,s.useCallback)(((t={},e=null)=>({...E,...t,ref:N(e,(t=>{t&&U("LABEL"===t.tagName)})),onClick:(0,p.v0)(t.onClick,(()=>{var t;q||(null==(t=j.current)||t.click(),requestAnimationFrame((()=>{var t;null==(t=j.current)||t.focus({preventScroll:!0})})))})),"data-disabled":(0,p.PB)(r),"data-checked":(0,p.PB)(H),"data-invalid":(0,p.PB)(o)})),[E,r,H,o,q]),Y=(0,s.useCallback)(((t={},e=null)=>({...t,ref:N(j,e),type:"checkbox",name:y,value:v,id:a,tabIndex:b,onChange:(0,p.v0)(t.onChange,K),onBlur:(0,p.v0)(t.onBlur,k,(()=>C(!1))),onFocus:(0,p.v0)(t.onFocus,S,(()=>C(!0))),onKeyDown:(0,p.v0)(t.onKeyDown,W),onKeyUp:(0,p.v0)(t.onKeyUp,V),required:i,checked:H,disabled:G,readOnly:n,"aria-label":w,"aria-labelledby":_,"aria-invalid":M?Boolean(M):o,"aria-describedby":l,"aria-disabled":r,style:xc})),[y,v,a,K,k,S,W,V,i,H,G,n,w,_,M,o,l,r,b]),Q=(0,s.useCallback)(((t={},e=null)=>({...t,ref:e,onMouseDown:(0,p.v0)(t.onMouseDown,zc),"data-disabled":(0,p.PB)(r),"data-checked":(0,p.PB)(H),"data-invalid":(0,p.PB)(o)})),[H,r,o]);return{state:{isInvalid:o,isFocused:P,isChecked:H,isActive:B,isHovered:T,isIndeterminate:g,isDisabled:r,isReadOnly:n,isRequired:i},getRootProps:J,getCheckboxProps:Z,getInputProps:Y,getLabelProps:Q,htmlProps:E}}function zc(t){t.preventDefault(),t.stopPropagation()}var Hc=(0,u.G)((function(t,e){const r=(0,_.jC)("Switch",t),{spacing:n="0.5rem",children:i,...o}=(0,M.Lr)(t),{state:a,getInputProps:u,getCheckboxProps:f,getRootProps:h,getLabelProps:d}=Dc(o),m=(0,s.useMemo)((()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container})),[r.container]),g=(0,s.useMemo)((()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track})),[r.track]),y=(0,s.useMemo)((()=>({userSelect:"none",marginStart:n,...r.label})),[n,r.label]);return(0,l.jsxs)(c.m.label,{...h(),className:(0,p.cx)("chakra-switch",t.className),__css:m,children:[(0,l.jsx)("input",{className:"chakra-switch__input",...u({},e)}),(0,l.jsx)(c.m.span,{...f(),className:"chakra-switch__track",__css:g,children:(0,l.jsx)(c.m.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":(0,p.PB)(a.isChecked),"data-hover":(0,p.PB)(a.isHovered)})}),i&&(0,l.jsx)(c.m.span,{className:"chakra-switch__label",...d(),__css:y,children:i})]})}));Hc.displayName="Switch";const Kc=()=>{const{showTestnets:t,showDeprecated:e,setShowTestnets:r,setShowDeprecated:n}=(0,s.useContext)(ws);return(0,ps.tZ)(dc,null,(0,ps.tZ)(gu,{label:"Filters"},(0,ps.tZ)(pc,null,(0,ps.tZ)(vu,{size:"lg","aria-label":"Filters",icon:(0,ps.tZ)(zu.ulB,null),mr:"1"}))),(0,ps.tZ)(hu.h,null,(0,ps.tZ)(bc,{maxW:"220px"},(0,ps.tZ)(_c,null),(0,ps.tZ)(Mc,null,(0,ps.tZ)(qu,{display:"flex",alignItems:"center",justifyContent:"space-between",mb:"2"},(0,ps.tZ)(Ac,{htmlFor:"testnet-switch",mb:"0"},"Show Testnets"),(0,ps.tZ)(Hc,{id:"testnet-switch",onChange:()=>{r((t=>!t))},value:t})),(0,ps.tZ)(qu,{display:"flex",alignItems:"center",justifyContent:"space-between"},(0,ps.tZ)(Ac,{htmlFor:"deprecated-switch",mb:"0"},"Show Deprecated"),(0,ps.tZ)(Hc,{id:"deprecated-switch",onChange:()=>{n((t=>!t))},value:e}))))))},Gc=()=>{const{handleConnect:t,isConnected:e,address:r}=(0,s.useContext)(gs);return(0,ps.tZ)(y,{pb:"2",flexDirection:{base:"column",md:"row"},justifyContent:"space-between"},(0,ps.tZ)(As.X,null,"Chainlist"),(0,ps.tZ)(Du,null),(0,ps.tZ)(y,null,(0,ps.tZ)(Kc,null),(0,ps.tZ)(gu,{label:"Add Network"},(0,ps.tZ)(yu,{href:"https://github.com/ethereum-lists/chains/pulls",isExternal:!0},(0,ps.tZ)(vu,{size:"lg","aria-label":"Add",icon:(0,ps.tZ)(Hu,null),mr:"1"}))),(0,ps.tZ)(gu,{label:"GitHub"},(0,ps.tZ)(yu,{href:"https://github.com/FrederikBolding/chainlist",isExternal:!0},(0,ps.tZ)(vu,{size:"lg","aria-label":"GitHub",icon:(0,ps.tZ)(zu.hJX,null),mr:"1"}))),(0,ps.tZ)(Eu,{size:"lg",mr:"1"}),e?(0,ps.tZ)(L,{size:"lg",w:{base:"100%",md:"auto"}},(0,ps.tZ)(v.x,{fontSize:"sm",isTruncated:!0},r)):(0,ps.tZ)(L,{w:{base:"100%",md:"auto"},size:"lg",onClick:t},"Connect Wallet")))};var Wc,Vc,Zc,Jc,Yc=r(5697),Qc=r.n(Yc),Xc=r(3524),$c=r.n(Xc),tl=r(9590),el=r.n(tl),rl=r(4852),nl=r.n(rl),il="bodyAttributes",ol="htmlAttributes",sl="titleAttributes",al={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},ul=(Object.keys(al).map((function(t){return al[t]})),"charset"),cl="cssText",ll="href",fl="http-equiv",hl="innerHTML",dl="itemprop",pl="name",ml="property",gl="rel",yl="src",vl="target",bl={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},wl="defaultTitle",_l="defer",Ml="encodeSpecialCharacters",Al="onChangeClientState",El="titleTemplate",xl=Object.keys(bl).reduce((function(t,e){return t[bl[e]]=e,t}),{}),kl=[al.NOSCRIPT,al.SCRIPT,al.STYLE],Sl="data-react-helmet",Rl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Il=function(){function t(t,e){for(var r=0;r=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},Tl=function(t){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},Ol=function(t){var e=ql(t,al.TITLE),r=ql(t,El);if(r&&e)return r.replace(/%s/g,(function(){return Array.isArray(e)?e.join(""):e}));var n=ql(t,wl);return e||n||void 0},Nl=function(t){return ql(t,Al)||function(){}},Bl=function(t,e){return e.filter((function(e){return void 0!==e[t]})).map((function(e){return e[t]})).reduce((function(t,e){return Pl({},t,e)}),{})},Ll=function(t,e){return e.filter((function(t){return void 0!==t[al.BASE]})).map((function(t){return t[al.BASE]})).reverse().reduce((function(e,r){if(!e.length)for(var n=Object.keys(r),i=0;i=0;r--){var n=t[r];if(n.hasOwnProperty(e))return n[e]}return null},Ul=(Wc=Date.now(),function(t){var e=Date.now();e-Wc>16?(Wc=e,t(e)):setTimeout((function(){Ul(t)}),0)}),Fl=function(t){return clearTimeout(t)},Dl="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Ul:r.g.requestAnimationFrame||Ul,zl="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Fl:r.g.cancelAnimationFrame||Fl,Hl=function(t){return console&&"function"==typeof console.warn&&console.warn(t)},Kl=null,Gl=function(t,e){var r=t.baseTag,n=t.bodyAttributes,i=t.htmlAttributes,o=t.linkTags,s=t.metaTags,a=t.noscriptTags,u=t.onChangeClientState,c=t.scriptTags,l=t.styleTags,f=t.title,h=t.titleAttributes;Zl(al.BODY,n),Zl(al.HTML,i),Vl(f,h);var d={baseTag:Jl(al.BASE,r),linkTags:Jl(al.LINK,o),metaTags:Jl(al.META,s),noscriptTags:Jl(al.NOSCRIPT,a),scriptTags:Jl(al.SCRIPT,c),styleTags:Jl(al.STYLE,l)},p={},m={};Object.keys(d).forEach((function(t){var e=d[t],r=e.newTags,n=e.oldTags;r.length&&(p[t]=r),n.length&&(m[t]=d[t].oldTags)})),e&&e(),u(t,p,m)},Wl=function(t){return Array.isArray(t)?t.join(""):t},Vl=function(t,e){void 0!==t&&document.title!==t&&(document.title=Wl(t)),Zl(al.TITLE,e)},Zl=function(t,e){var r=document.getElementsByTagName(t)[0];if(r){for(var n=r.getAttribute(Sl),i=n?n.split(","):[],o=[].concat(i),s=Object.keys(e),a=0;a=0;f--)r.removeAttribute(o[f]);i.length===o.length?r.removeAttribute(Sl):r.getAttribute(Sl)!==s.join(",")&&r.setAttribute(Sl,s.join(","))}},Jl=function(t,e){var r=document.head||document.querySelector(al.HEAD),n=r.querySelectorAll(t+"["+Sl+"]"),i=Array.prototype.slice.call(n),o=[],s=void 0;return e&&e.length&&e.forEach((function(e){var r=document.createElement(t);for(var n in e)if(e.hasOwnProperty(n))if(n===hl)r.innerHTML=e.innerHTML;else if(n===cl)r.styleSheet?r.styleSheet.cssText=e.cssText:r.appendChild(document.createTextNode(e.cssText));else{var a=void 0===e[n]?"":e[n];r.setAttribute(n,a)}r.setAttribute(Sl,"true"),i.some((function(t,e){return s=e,r.isEqualNode(t)}))?i.splice(s,1):o.push(r)})),i.forEach((function(t){return t.parentNode.removeChild(t)})),o.forEach((function(t){return r.appendChild(t)})),{oldTags:i,newTags:o}},Yl=function(t){return Object.keys(t).reduce((function(e,r){var n=void 0!==t[r]?r+'="'+t[r]+'"':""+r;return e?e+" "+n:n}),"")},Ql=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce((function(e,r){return e[bl[r]||r]=t[r],e}),e)},Xl=function(t,e,r){switch(t){case al.TITLE:return{toComponent:function(){return t=e.title,r=e.titleAttributes,(n={key:t})[Sl]=!0,i=Ql(r,n),[s.createElement(al.TITLE,i,t)];var t,r,n,i},toString:function(){return function(t,e,r,n){var i=Yl(r),o=Wl(e);return i?"<"+t+" "+Sl+'="true" '+i+">"+Tl(o,n)+"":"<"+t+" "+Sl+'="true">'+Tl(o,n)+""}(t,e.title,e.titleAttributes,r)}};case il:case ol:return{toComponent:function(){return Ql(e)},toString:function(){return Yl(e)}};default:return{toComponent:function(){return function(t,e){return e.map((function(e,r){var n,i=((n={key:r})[Sl]=!0,n);return Object.keys(e).forEach((function(t){var r=bl[t]||t;if(r===hl||r===cl){var n=e.innerHTML||e.cssText;i.dangerouslySetInnerHTML={__html:n}}else i[r]=e[t]})),s.createElement(t,i)}))}(t,e)},toString:function(){return function(t,e,r){return e.reduce((function(e,n){var i=Object.keys(n).filter((function(t){return!(t===hl||t===cl)})).reduce((function(t,e){var i=void 0===n[e]?e:e+'="'+Tl(n[e],r)+'"';return t?t+" "+i:i}),""),o=n.innerHTML||n.cssText||"",s=-1===kl.indexOf(t);return e+"<"+t+" "+Sl+'="true" '+i+(s?"/>":">"+o+"")}),"")}(t,e,r)}}}},$l=function(t){var e=t.baseTag,r=t.bodyAttributes,n=t.encode,i=t.htmlAttributes,o=t.linkTags,s=t.metaTags,a=t.noscriptTags,u=t.scriptTags,c=t.styleTags,l=t.title,f=void 0===l?"":l,h=t.titleAttributes;return{base:Xl(al.BASE,e,n),bodyAttributes:Xl(il,r,n),htmlAttributes:Xl(ol,i,n),link:Xl(al.LINK,o,n),meta:Xl(al.META,s,n),noscript:Xl(al.NOSCRIPT,a,n),script:Xl(al.SCRIPT,u,n),style:Xl(al.STYLE,c,n),title:Xl(al.TITLE,{title:f,titleAttributes:h},n)}},tf=$c()((function(t){return{baseTag:Ll([ll,vl],t),bodyAttributes:Bl(il,t),defer:ql(t,_l),encode:ql(t,Ml),htmlAttributes:Bl(ol,t),linkTags:jl(al.LINK,[gl,ll],t),metaTags:jl(al.META,[pl,ul,fl,ml,dl],t),noscriptTags:jl(al.NOSCRIPT,[hl],t),onChangeClientState:Nl(t),scriptTags:jl(al.SCRIPT,[yl,hl],t),styleTags:jl(al.STYLE,[cl],t),title:Ol(t),titleAttributes:Bl(sl,t)}}),(function(t){Kl&&zl(Kl),t.defer?Kl=Dl((function(){Gl(t,(function(){Kl=null}))})):(Gl(t),Kl=null)}),$l)((function(){return null})),ef=(Vc=tf,Jc=Zc=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.shouldComponentUpdate=function(t){return!el()(this.props,t)},e.prototype.mapNestedChildrenToProps=function(t,e){if(!e)return null;switch(t.type){case al.SCRIPT:case al.NOSCRIPT:return{innerHTML:e};case al.STYLE:return{cssText:e}}throw new Error("<"+t.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},e.prototype.flattenArrayTypeChildren=function(t){var e,r=t.child,n=t.arrayTypeChildren,i=t.newChildProps,o=t.nestedChildren;return Pl({},n,((e={})[r.type]=[].concat(n[r.type]||[],[Pl({},i,this.mapNestedChildrenToProps(r,o))]),e))},e.prototype.mapObjectTypeChildren=function(t){var e,r,n=t.child,i=t.newProps,o=t.newChildProps,s=t.nestedChildren;switch(n.type){case al.TITLE:return Pl({},i,((e={})[n.type]=s,e.titleAttributes=Pl({},o),e));case al.BODY:return Pl({},i,{bodyAttributes:Pl({},o)});case al.HTML:return Pl({},i,{htmlAttributes:Pl({},o)})}return Pl({},i,((r={})[n.type]=Pl({},o),r))},e.prototype.mapArrayTypeChildrenToProps=function(t,e){var r=Pl({},e);return Object.keys(t).forEach((function(e){var n;r=Pl({},r,((n={})[e]=t[e],n))})),r},e.prototype.warnOnInvalidChildren=function(t,e){return!0},e.prototype.mapChildrenToProps=function(t,e){var r=this,n={};return s.Children.forEach(t,(function(t){if(t&&t.props){var i=t.props,o=i.children,s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(t).reduce((function(e,r){return e[xl[r]||r]=t[r],e}),e)}(Cl(i,["children"]));switch(r.warnOnInvalidChildren(t,o),t.type){case al.LINK:case al.META:case al.NOSCRIPT:case al.SCRIPT:case al.STYLE:n=r.flattenArrayTypeChildren({child:t,arrayTypeChildren:n,newChildProps:s,nestedChildren:o});break;default:e=r.mapObjectTypeChildren({child:t,newProps:e,newChildProps:s,nestedChildren:o})}}})),e=this.mapArrayTypeChildrenToProps(n,e)},e.prototype.render=function(){var t=this.props,e=t.children,r=Cl(t,["children"]),n=Pl({},r);return e&&(n=this.mapChildrenToProps(e,n)),s.createElement(Vc,n)},Il(e,null,[{key:"canUseDOM",set:function(t){Vc.canUseDOM=t}}]),e}(s.Component),Zc.propTypes={base:Qc().object,bodyAttributes:Qc().object,children:Qc().oneOfType([Qc().arrayOf(Qc().node),Qc().node]),defaultTitle:Qc().string,defer:Qc().bool,encodeSpecialCharacters:Qc().bool,htmlAttributes:Qc().object,link:Qc().arrayOf(Qc().object),meta:Qc().arrayOf(Qc().object),noscript:Qc().arrayOf(Qc().object),onChangeClientState:Qc().func,script:Qc().arrayOf(Qc().object),style:Qc().arrayOf(Qc().object),title:Qc().string,titleAttributes:Qc().object,titleTemplate:Qc().string},Zc.defaultProps={defer:!0,encodeSpecialCharacters:!0},Zc.peek=Vc.peek,Zc.rewind=function(){var t=Vc.rewind();return t||(t=$l({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),t},Jc);ef.renderStatic=ef.rewind;const rf=t=>{var e,r;let{lang:n="en",meta:i=[]}=t;const{site:s}=(0,o.K2)("63159454"),a=s.siteMetadata.description,u=null===(e=s.siteMetadata)||void 0===e?void 0:e.title;return(0,ps.tZ)(ef,{htmlAttributes:{lang:n},title:u,titleTemplate:"%s",meta:[{name:"description",content:a},{property:"og:title",content:u},{property:"og:description",content:a},{property:"og:type",content:"website"},{name:"twitter:card",content:"summary"},{name:"twitter:creator",content:(null===(r=s.siteMetadata)||void 0===r?void 0:r.author)||""},{name:"twitter:title",content:u},{name:"twitter:description",content:a}].concat(i)})};var nf=()=>{const t=(0,o.K2)("3467081199"),e=t.allChain.nodes,r=t.allImageSharp.nodes.reduce(((t,e)=>(t[e.parent.name]=e.gatsbyImageData,t)),{}),n=e.reduce(((t,e,n)=>(t[n].icon=r[e.icon],t)),e);return(0,ps.tZ)(s.Fragment,null,(0,ps.tZ)(rf,null),(0,ps.tZ)(ys,null,(0,ps.tZ)(_s,null,(0,ps.tZ)(i.xu,{py:"4",px:"8"},(0,ps.tZ)(Gc,null),(0,ps.tZ)(Ms,{chains:n})))))}},210:function(t,e,r){"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(I){u=null}var c=function(){throw new s},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(e){return c}}}():c,f=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},d={},p="undefined"==typeof Uint8Array?n:h(Uint8Array),m={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(I){var g=h(h(I));m["%Error.prototype%"]=g}var y=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return m[e]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(8612),w=r(7642),_=b.call(Function.call,Array.prototype.concat),M=b.call(Function.apply,Array.prototype.splice),A=b.call(Function.call,String.prototype.replace),E=b.call(Function.call,String.prototype.slice),x=b.call(Function.call,RegExp.prototype.exec),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,S=/\\(\\)?/g,R=function(t,e){var r,n=t;if(w(v,n)&&(n="%"+(r=v[n])[0]+"%"),w(m,n)){var o=m[n];if(o===d&&(o=y(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=E(t,0,1),r=E(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return A(t,k,(function(t,e,r,i){n[n.length]=r?A(i,S,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=R("%"+n+"%",e),a=o.name,c=o.value,l=!1,f=o.alias;f&&(n=f[0],M(r,_([0,1],f)));for(var h=1,d=!0;h=r.length){var v=u(c,p);c=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[p]}else d=w(c,p),c=c[p];d&&!l&&(m[a]=c)}}return c}},5275:function(t,e,r){"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(i){n=null}t.exports=n},1044:function(t,e,r){"use strict";var n=r(210)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},1405:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},5419:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:function(t,e,r){"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:function(t,e,r){"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},3349:function(t,e,r){"use strict";var n=r(9509).Buffer,i=r(8473).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5717)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(i){n=i}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},3715:function(t,e,r){var n=e;n.utils=r(6436),n.common=r(5772),n.sha=r(9041),n.ripemd=r(2949),n.hmac=r(2344),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5772:function(t,e,r){"use strict";var n=r(6436),i=r(9746);function o(){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}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;othis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},6436:function(t,e,r){"use strict";var n=r(9746),i=r(5717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(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}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,c){var l=0,f=e;return l+=(f=f+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,c){return e+n+o+a+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},2156:function(t,e,r){"use strict";var n=r(3715),i=r(4504),o=r(9746);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length>1,l=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*m}},5717:function(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:function(t,e,r){"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},5320:function(t){"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(d){d!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(r){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var h=document.all;u.call(h)===u.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(r){}return!1})}t.exports=i?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(n){if(n!==r)return!1}return!s(t)&&a(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return a(t);if(s(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},8662:function(t,e,r){"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},3944:function(t){t.exports=function(t){if("string"!=typeof t)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}},8611:function(t){"use strict";t.exports=function(t){return t!=t}},360:function(t,e,r){"use strict";var n=r(5559),i=r(4289),o=r(8611),s=r(9415),a=r(3194),u=n(s(),Number);i(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},9415:function(t,e,r){"use strict";var n=r(8611);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},3194:function(t,e,r){"use strict";var n=r(4289),i=r(9415);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},5692:function(t,e,r){"use strict";var n=r(4029),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u=r(5275),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),f=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!u&&function(t){var e=!1;return n(d,(function(r,n){if(!e)try{e=r.call(t)===n}catch(i){}})),e}(t)}},4501:function(t){t.exports=n,n.strict=i,n.loose=o;var e=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function n(t){return i(t)||o(t)}function i(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function o(t){return r[e.call(t)]}},5826:function(t){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},1094:function(t,e,r){var n;!function(){"use strict";var i="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA3_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:a&&(s=self);var u=!s.JS_SHA3_NO_COMMON_JS&&t.exports,c=r.amdO,l=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[4,1024,262144,67108864],d=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],m=[224,256,384,512],g=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!l||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var b=function(t,e,r){return function(n){return new N(t,e,t).update(n)[r]()}},w=function(t,e,r){return function(n,i){return new N(t,e,i).update(n)[r]()}},_=function(t,e,r){return function(e,n,i,o){return k["cshake"+t].update(e,n,i,o)[r]()}},M=function(t,e,r){return function(e,n,i,o){return k["kmac"+t].update(e,n,i,o)[r]()}},A=function(t,e,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function B(t,e,r){N.call(this,t,e,r)}N.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}for(var n,o,s=this.blocks,a=this.byteCount,u=t.length,c=this.blockCount,f=0,h=this.s;f>2]|=t[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(s[n>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=a){for(this.start=n-a,this.block=s[c],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},N.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(i);if(null===t)throw new Error(i);if(l&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||l&&ArrayBuffer.isView(t)))throw new Error(i);e=!0}var n=0,o=t.length;if(e)n=o;else for(var s=0;s=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},N.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+f[15&t]+f[t>>12&15]+f[t>>8&15]+f[t>>20&15]+f[t>>16&15]+f[t>>28&15]+f[t>>24&15];s%e==0&&(L(r),o=0)}return i&&(t=r[o],a+=f[t>>4&15]+f[15&t],i>1&&(a+=f[t>>12&15]+f[t>>8&15]),i>2&&(a+=f[t>>20&15]+f[t>>16&15])),a},N.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&L(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},B.prototype=new N,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var L=function(t){var e,r,n,i,o,s,a,u,c,l,f,h,d,m,g,y,v,b,w,_,M,A,E,x,k,S,R,I,P,C,T,O,N,B,L,j,q,U,F,D,z,H,K,G,W,V,Z,J,Y,Q,X,$,tt,et,rt,nt,it,ot,st,at,ut,ct,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(h=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|f>>>31),r=a^(f<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(h<<1|d>>>31),r=c^(d<<1|h>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],g=t[1],V=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,B=t[2]<<1|t[3]>>>31,L=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,C=t[33]<<13|t[32]>>>19,T=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,j=t[14]<<6|t[15]>>>26,q=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,Q=t[34]<<15|t[35]>>>17,X=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,N=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,k=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,G=t[8]<<27|t[9]>>>5,W=t[9]<<27|t[8]>>>5,S=t[18]<<20|t[19]>>>12,R=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,D=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=m^~y&b,t[1]=g^~v&w,t[10]=x^~S&I,t[11]=k^~R&P,t[20]=B^~j&U,t[21]=L^~q&F,t[30]=G^~V&J,t[31]=W^~Z&Y,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~b&_,t[3]=v^~w&M,t[12]=S^~I&C,t[13]=R^~P&T,t[22]=j^~U&D,t[23]=q^~F&z,t[32]=V^~J&Q,t[33]=Z^~Y&X,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=b^~_&A,t[5]=w^~M&E,t[14]=I^~C&O,t[15]=P^~T&N,t[24]=U^~D&H,t[25]=F^~z&K,t[34]=J^~Q&$,t[35]=Y^~X&tt,t[44]=ot^~at&ct,t[45]=st^~ut<,t[6]=_^~A&m,t[7]=M^~E&g,t[16]=C^~O&x,t[17]=T^~N&k,t[26]=D^~H&B,t[27]=z^~K&L,t[36]=Q^~$&G,t[37]=X^~tt&W,t[46]=at^~ct&et,t[47]=ut^~lt&rt,t[8]=A^~m&y,t[9]=E^~g&v,t[18]=O^~x&S,t[19]=N^~k&R,t[28]=H^~B&j,t[29]=K^~L&q,t[38]=$^~G&V,t[39]=tt^~W&Z,t[48]=ct^~et&nt,t[49]=lt^~rt&it,t[0]^=p[n],t[1]^=p[n+1]};if(u)t.exports=k;else{for(R=0;R{let o;const s=new Promise((t=>{o=t}));let a,u;t(e,r,(async()=>{u=!0,n((t=>{a=t,o()})),await s})).then((async()=>{u?(await s,a(null)):i(null)})).catch((t=>{a?a(t):i(t)}))}}},2121:function(t){t.exports=function(t){return(e,r,n,i)=>{const o=t[e.method];return void 0===o?n():"function"==typeof o?o(e,r,n,i):(r.result=o,i())}}},3420:function(t){t.exports=function(t){var e=(t=t||{}).max||Number.MAX_SAFE_INTEGER,r=void 0!==t.start?t.start:Math.floor(Math.random()*e);return function(){return r%=e,r++}}},7266:function(t,e,r){var n="undefined"!=typeof JSON?JSON:r(8418);t.exports=function(t,e){e||(e={}),"function"==typeof e&&(e={cmp:e});var r=e.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var s,a="boolean"==typeof e.cycles&&e.cycles,u=e.replacer||function(t,e){return e},c=e.cmp&&(s=e.cmp,function(t){return function(e,r){var n={key:e,value:t[e]},i={key:r,value:t[r]};return s(n,i)}}),l=[];return function t(e,s,f,h){var d=r?"\n"+new Array(h+1).join(r):"",p=r?": ":":";if(f&&f.toJSON&&"function"==typeof f.toJSON&&(f=f.toJSON()),void 0!==(f=u.call(e,s,f))){if("object"!=typeof f||null===f)return n.stringify(f);if(i(f)){for(var m=[],g=0;g="0"&&r<="9";)e+=r,a();if("."===r)for(e+=".";a()&&r>="0"&&r<="9";)e+=r;if("e"===r||"E"===r)for(e+=r,a(),"-"!==r&&"+"!==r||(e+=r,a());r>="0"&&r<="9";)e+=r,a();if(t=+e,isFinite(t))return t;s("Bad number")},c=function(){var t,e,n,i="";if('"'===r)for(;a();){if('"'===r)return a(),i;if("\\"===r)if(a(),"u"===r){for(n=0,e=0;e<4&&(t=parseInt(a(),16),isFinite(t));e+=1)n=16*n+t;i+=String.fromCharCode(n)}else{if("string"!=typeof o[r])break;i+=o[r]}else i+=r}s("Bad string")},l=function(){for(;r&&r<=" ";)a()};i=function(){switch(l(),r){case"{":return function(){var t,e={};if("{"===r){if(a("{"),l(),"}"===r)return a("}"),e;for(;r;){if(t=c(),l(),a(":"),Object.hasOwnProperty.call(e,t)&&s('Duplicate key "'+t+'"'),e[t]=i(),l(),"}"===r)return a("}"),e;a(","),l()}}s("Bad object")}();case"[":return function(){var t=[];if("["===r){if(a("["),l(),"]"===r)return a("]"),t;for(;r;){if(t.push(i()),l(),"]"===r)return a("]"),t;a(","),l()}}s("Bad array")}();case'"':return c();case"-":return u();default:return r>="0"&&r<="9"?u():function(){switch(r){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}s("Unexpected '"+r+"'")}()}},t.exports=function(t,o){var a;return n=t,e=0,r=" ",a=i(),l(),r&&s("Syntax error"),"function"==typeof o?function t(e,r){var n,i,s=e[r];if(s&&"object"==typeof s)for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(void 0!==(i=t(s,n))?s[n]=i:delete s[n]);return o.call(e,r,s)}({"":a},""):a}},6177:function(t){var e,r,n,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(t){return i.lastIndex=0,i.test(t)?'"'+t.replace(i,(function(t){var e=o[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}function a(t,i){var o,u,c,l,f,h=e,d=i[t];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(t)),"function"==typeof n&&(d=n.call(i,t,d)),typeof d){case"string":return s(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(e+=r,f=[],"[object Array]"===Object.prototype.toString.apply(d)){for(l=d.length,o=0;oclass e extends i{constructor(e,r,n,i,o){super(o),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=o,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(i){n=i}r(n)}_flush(t){let e=null;try{this.push(this.digest())}catch(r){e=r}t(e)}update(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return n.isBuffer(t)||(t=n.from(t,e)),this._state.absorb(t),this}digest(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let e=this._state.squeeze(this._hashBitLength/8);return void 0!==t&&(e=e.toString(t)),this._resetState(),e}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}},5675:function(t,e,r){var n=r(8764).Buffer;const{Transform:i}=r(8473);t.exports=t=>class e extends i{constructor(e,r,n,i){super(i),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new t,this._state.initialize(e,r),this._finalized=!1}_transform(t,e,r){let n=null;try{this.update(t,e)}catch(i){n=i}r(n)}_flush(){}_read(t){this.push(this.squeeze(t))}update(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return n.isBuffer(t)||(t=n.from(t,e)),this._state.absorb(t),this}squeeze(t,e){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(t);return void 0!==e&&(r=r.toString(e)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t}}},4040:function(t,e){const r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];e.p1600=function(t){for(let e=0;e<24;++e){const n=t[0]^t[10]^t[20]^t[30]^t[40],i=t[1]^t[11]^t[21]^t[31]^t[41],o=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],a=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],f=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let d=f^(o<<1|s>>>31),p=h^(s<<1|o>>>31);const m=t[0]^d,g=t[1]^p,y=t[10]^d,v=t[11]^p,b=t[20]^d,w=t[21]^p,_=t[30]^d,M=t[31]^p,A=t[40]^d,E=t[41]^p;d=n^(a<<1|u>>>31),p=i^(u<<1|a>>>31);const x=t[2]^d,k=t[3]^p,S=t[12]^d,R=t[13]^p,I=t[22]^d,P=t[23]^p,C=t[32]^d,T=t[33]^p,O=t[42]^d,N=t[43]^p;d=o^(c<<1|l>>>31),p=s^(l<<1|c>>>31);const B=t[4]^d,L=t[5]^p,j=t[14]^d,q=t[15]^p,U=t[24]^d,F=t[25]^p,D=t[34]^d,z=t[35]^p,H=t[44]^d,K=t[45]^p;d=a^(f<<1|h>>>31),p=u^(h<<1|f>>>31);const G=t[6]^d,W=t[7]^p,V=t[16]^d,Z=t[17]^p,J=t[26]^d,Y=t[27]^p,Q=t[36]^d,X=t[37]^p,$=t[46]^d,tt=t[47]^p;d=c^(n<<1|i>>>31),p=l^(i<<1|n>>>31);const et=t[8]^d,rt=t[9]^p,nt=t[18]^d,it=t[19]^p,ot=t[28]^d,st=t[29]^p,at=t[38]^d,ut=t[39]^p,ct=t[48]^d,lt=t[49]^p,ft=m,ht=g,dt=v<<4|y>>>28,pt=y<<4|v>>>28,mt=b<<3|w>>>29,gt=w<<3|b>>>29,yt=M<<9|_>>>23,vt=_<<9|M>>>23,bt=A<<18|E>>>14,wt=E<<18|A>>>14,_t=x<<1|k>>>31,Mt=k<<1|x>>>31,At=R<<12|S>>>20,Et=S<<12|R>>>20,xt=I<<10|P>>>22,kt=P<<10|I>>>22,St=T<<13|C>>>19,Rt=C<<13|T>>>19,It=O<<2|N>>>30,Pt=N<<2|O>>>30,Ct=L<<30|B>>>2,Tt=B<<30|L>>>2,Ot=j<<6|q>>>26,Nt=q<<6|j>>>26,Bt=F<<11|U>>>21,Lt=U<<11|F>>>21,jt=D<<15|z>>>17,qt=z<<15|D>>>17,Ut=K<<29|H>>>3,Ft=H<<29|K>>>3,Dt=G<<28|W>>>4,zt=W<<28|G>>>4,Ht=Z<<23|V>>>9,Kt=V<<23|Z>>>9,Gt=J<<25|Y>>>7,Wt=Y<<25|J>>>7,Vt=Q<<21|X>>>11,Zt=X<<21|Q>>>11,Jt=tt<<24|$>>>8,Yt=$<<24|tt>>>8,Qt=et<<27|rt>>>5,Xt=rt<<27|et>>>5,$t=nt<<20|it>>>12,te=it<<20|nt>>>12,ee=st<<7|ot>>>25,re=ot<<7|st>>>25,ne=at<<8|ut>>>24,ie=ut<<8|at>>>24,oe=ct<<14|lt>>>18,se=lt<<14|ct>>>18;t[0]=ft^~At&Bt,t[1]=ht^~Et&Lt,t[10]=Dt^~$t&mt,t[11]=zt^~te>,t[20]=_t^~Ot&Gt,t[21]=Mt^~Nt&Wt,t[30]=Qt^~dt&xt,t[31]=Xt^~pt&kt,t[40]=Ct^~Ht&ee,t[41]=Tt^~Kt&re,t[2]=At^~Bt&Vt,t[3]=Et^~Lt&Zt,t[12]=$t^~mt&St,t[13]=te^~gt&Rt,t[22]=Ot^~Gt&ne,t[23]=Nt^~Wt&ie,t[32]=dt^~xt&jt,t[33]=pt^~kt&qt,t[42]=Ht^~ee&yt,t[43]=Kt^~re&vt,t[4]=Bt^~Vt&oe,t[5]=Lt^~Zt&se,t[14]=mt^~St&Ut,t[15]=gt^~Rt&Ft,t[24]=Gt^~ne&bt,t[25]=Wt^~ie&wt,t[34]=xt^~jt&Jt,t[35]=kt^~qt&Yt,t[44]=ee^~yt&It,t[45]=re^~vt&Pt,t[6]=Vt^~oe&ft,t[7]=Zt^~se&ht,t[16]=St^~Ut&Dt,t[17]=Rt^~Ft&zt,t[26]=ne^~bt&_t,t[27]=ie^~wt&Mt,t[36]=jt^~Jt&Qt,t[37]=qt^~Yt&Xt,t[46]=yt^~It&Ct,t[47]=vt^~Pt&Tt,t[8]=oe^~ft&At,t[9]=se^~ht&Et,t[18]=Ut^~Dt&$t,t[19]=Ft^~zt&te,t[28]=bt^~_t&Ot,t[29]=wt^~Mt&Nt,t[38]=Jt^~Qt&dt,t[39]=Yt^~Xt&pt,t[48]=It^~Ct&Ht,t[49]=Pt^~Tt&Kt,t[0]^=r[2*e],t[1]^=r[2*e+1]}}},9483:function(t,e,r){var n=r(8764).Buffer;const i=r(4040);function o(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}o.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},o.prototype.absorb=function(t){for(let e=0;e>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return e},o.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing},t.exports=o},2705:function(t,e,r){var n=r(5639).Symbol;t.exports=n},4636:function(t,e,r){var n=r(2545),i=r(5694),o=r(1469),s=r(4144),a=r(213),u=r(6719),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),l=!r&&i(t),f=!r&&!l&&s(t),h=!r&&!l&&!f&&u(t),d=r||l||f||h,p=d?n(t.length,String):[],m=p.length;for(var g in t)!e&&!c.call(t,g)||d&&("length"==g||f&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,m))||p.push(g);return p}},4239:function(t,e,r){var n=r(2705),i=r(9607),o=r(2333),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?i(t):o(t)}},9454:function(t,e,r){var n=r(4239),i=r(7005);t.exports=function(t){return i(t)&&"[object Arguments]"==n(t)}},8749:function(t,e,r){var n=r(4239),i=r(1780),o=r(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!s[n(t)]}},280:function(t,e,r){var n=r(5726),i=r(6916),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return i(t);var e=[];for(var r in Object(t))o.call(t,r)&&"constructor"!=r&&e.push(r);return e}},2545:function(t){t.exports=function(t,e){for(var r=-1,n=Array(t);++r-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}},3218:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},7005:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},6719:function(t,e,r){var n=r(8749),i=r(7518),o=r(1167),s=o&&o.isTypedArray,a=s?i(s):n;t.exports=a},3674:function(t,e,r){var n=r(4636),i=r(280),o=r(1240);t.exports=function(t){return o(t)?n(t):i(t)}},308:function(t){t.exports=function(){}},5062:function(t){t.exports=function(){return!1}},2318:function(t,e,r){"use strict";var n=r(5717),i=r(3349),o=r(9509).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<>>32-e}function c(t,e,r,n,i,o,s){return u(t+(e&r|~e&n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return u(t+(e&n|r&~n)+i+o|0,s)+e|0}function f(t,e,r,n,i,o,s){return u(t+(e^r^n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return u(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,t[0],3614090360,7),o=c(o,r,n,i,t[1],3905402710,12),i=c(i,o,r,n,t[2],606105819,17),n=c(n,i,o,r,t[3],3250441966,22),r=c(r,n,i,o,t[4],4118548399,7),o=c(o,r,n,i,t[5],1200080426,12),i=c(i,o,r,n,t[6],2821735955,17),n=c(n,i,o,r,t[7],4249261313,22),r=c(r,n,i,o,t[8],1770035416,7),o=c(o,r,n,i,t[9],2336552879,12),i=c(i,o,r,n,t[10],4294925233,17),n=c(n,i,o,r,t[11],2304563134,22),r=c(r,n,i,o,t[12],1804603682,7),o=c(o,r,n,i,t[13],4254626195,12),i=c(i,o,r,n,t[14],2792965006,17),r=l(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=l(o,r,n,i,t[6],3225465664,9),i=l(i,o,r,n,t[11],643717713,14),n=l(n,i,o,r,t[0],3921069994,20),r=l(r,n,i,o,t[5],3593408605,5),o=l(o,r,n,i,t[10],38016083,9),i=l(i,o,r,n,t[15],3634488961,14),n=l(n,i,o,r,t[4],3889429448,20),r=l(r,n,i,o,t[9],568446438,5),o=l(o,r,n,i,t[14],3275163606,9),i=l(i,o,r,n,t[3],4107603335,14),n=l(n,i,o,r,t[8],1163531501,20),r=l(r,n,i,o,t[13],2850285829,5),o=l(o,r,n,i,t[2],4243563512,9),i=l(i,o,r,n,t[7],1735328473,14),r=f(r,n=l(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=f(o,r,n,i,t[8],2272392833,11),i=f(i,o,r,n,t[11],1839030562,16),n=f(n,i,o,r,t[14],4259657740,23),r=f(r,n,i,o,t[1],2763975236,4),o=f(o,r,n,i,t[4],1272893353,11),i=f(i,o,r,n,t[7],4139469664,16),n=f(n,i,o,r,t[10],3200236656,23),r=f(r,n,i,o,t[13],681279174,4),o=f(o,r,n,i,t[0],3936430074,11),i=f(i,o,r,n,t[3],3572445317,16),n=f(n,i,o,r,t[6],76029189,23),r=f(r,n,i,o,t[9],3654602809,4),o=f(o,r,n,i,t[12],3873151461,11),i=f(i,o,r,n,t[15],530742520,16),r=h(r,n=f(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=h(o,r,n,i,t[7],1126891415,10),i=h(i,o,r,n,t[14],2878612391,15),n=h(n,i,o,r,t[5],4237533241,21),r=h(r,n,i,o,t[12],1700485571,6),o=h(o,r,n,i,t[3],2399980690,10),i=h(i,o,r,n,t[10],4293915773,15),n=h(n,i,o,r,t[1],2240044497,21),r=h(r,n,i,o,t[8],1873313359,6),o=h(o,r,n,i,t[15],4264355552,10),i=h(i,o,r,n,t[6],2734768916,15),n=h(n,i,o,r,t[13],1309151649,21),r=h(r,n,i,o,t[4],4149444226,6),o=h(o,r,n,i,t[11],3174756917,10),i=h(i,o,r,n,t[2],718787259,15),n=h(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},9746:function(t){function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},4504:function(t,e){"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},4244:function(t){"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},609:function(t,e,r){"use strict";var n=r(4289),i=r(5559),o=r(4244),s=r(5624),a=r(2281),u=i(s(),Object);n(u,{getPolyfill:s,implementation:o,shim:a}),t.exports=u},5624:function(t,e,r){"use strict";var n=r(4244);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},2281:function(t,e,r){"use strict";var n=r(5624),i=r(4289);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8987:function(t,e,r){"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(1414),a=Object.prototype.propertyIsEnumerable,u=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!h["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),h=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&t.length>0&&!i.call(t,0))for(var m=0;m0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},7435:function(t,e){e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},2352:function(t){"use strict";const e=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let t=0;t{e.errorFirst?n.push((function(t,n){if(e.multiArgs){const e=new Array(arguments.length-1);for(let t=1;t{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const n=t=>{const e=e=>"string"==typeof e?t===e:e.test(t);return r.include?r.include.some(e):!r.exclude.some(e)};let i;i="function"==typeof t?function(){return r.excludeMain?t.apply(this,arguments):e(t,r).apply(this,arguments)}:Object.create(Object.getPrototypeOf(t));for(const o in t){const s=t[o];i[o]="function"==typeof s&&n(o)?e(s,r):s}return i}},5776:function(t,e,r){"use strict";r.r(e),r.d(e,{Children:function(){return vt},Component:function(){return b},Fragment:function(){return v},PureComponent:function(){return dt},Suspense:function(){return _t},SuspenseList:function(){return Et},cloneElement:function(){return Ft},createContext:function(){return q},createElement:function(){return m},createFactory:function(){return qt},createPortal:function(){return Rt},createRef:function(){return y},default:function(){return Kt},findDOMNode:function(){return zt},forwardRef:function(){return gt},hydrate:function(){return Tt},isValidElement:function(){return Ut},lazy:function(){return At},memo:function(){return pt},render:function(){return Ct},unmountComponentAtNode:function(){return Dt},unstable_batchedUpdates:function(){return Ht},useCallback:function(){return rt},useContext:function(){return nt},useDebugValue:function(){return it},useEffect:function(){return Q},useErrorBoundary:function(){return ot},useImperativeHandle:function(){return tt},useLayoutEffect:function(){return X},useMemo:function(){return et},useReducer:function(){return Y},useRef:function(){return $},useState:function(){return J},version:function(){return jt}});var n,i,o,s,a,u,c,l={},f=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function d(t,e){for(var r in e)t[r]=e[r];return t}function p(t){var e=t.parentNode;e&&e.removeChild(t)}function m(t,e,r){var n,i=arguments,o={};for(n in e)"key"!==n&&"ref"!==n&&(o[n]=e[n]);if(arguments.length>3)for(r=[r],n=3;n2&&(e.children=f.slice.call(arguments,2)),r={},e)"key"!==n&&"ref"!==n&&(r[n]=e[n]);return g(t.type,r,e.key||t.key,e.ref||t.ref,null)}function q(t){var e={},r={__c:"__cC"+c++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i=this;return this.getChildContext||(n=[],this.getChildContext=function(){return e[r.__c]=i,e},this.shouldComponentUpdate=function(t){i.props.value!==t.value&&n.some((function(e){e.context=t.value,M(e)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return r.Consumer.contextType=r,r.Provider.__=r,r}n={__e:function(t,e){for(var r,n;e=e.__;)if((r=e.__c)&&!r.__)try{if(r.constructor&&null!=r.constructor.getDerivedStateFromError&&(n=!0,r.setState(r.constructor.getDerivedStateFromError(t))),null!=r.componentDidCatch&&(n=!0,r.componentDidCatch(t)),n)return M(r.__E=r)}catch(e){t=e}throw t}},b.prototype.setState=function(t,e){var r;r=this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof t&&(t=t(r,this.props)),t&&d(r,t),null!=t&&this.__v&&(e&&this.__h.push(e),M(this))},b.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),M(this))},b.prototype.render=v,i=[],o=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=l,c=0;var U,F,D,z=0,H=[],K=n.__r,G=n.diffed,W=n.__c,V=n.unmount;function Z(t,e){n.__h&&n.__h(F,t,z||e),z=0;var r=F.__H||(F.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function J(t){return z=1,Y(lt,t)}function Y(t,e,r){var n=Z(U++,2);return n.__c||(n.__c=F,n.__=[r?r(e):lt(void 0,e),function(e){var r=t(n.__[0],e);n.__[0]!==r&&(n.__[0]=r,n.__c.setState({}))}]),n.__}function Q(t,e){var r=Z(U++,3);!n.__s&&ct(r.__H,e)&&(r.__=t,r.__H=e,F.__H.__h.push(r))}function X(t,e){var r=Z(U++,4);!n.__s&&ct(r.__H,e)&&(r.__=t,r.__H=e,F.__h.push(r))}function $(t){return z=5,et((function(){return{current:t}}),[])}function tt(t,e,r){z=6,X((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==r?r:r.concat(t))}function et(t,e){var r=Z(U++,7);return ct(r.__H,e)?(r.__H=e,r.__h=t,r.__=t()):r.__}function rt(t,e){return z=8,et((function(){return t}),e)}function nt(t){var e=F.context[t.__c],r=Z(U++,9);return r.__c=t,e?(null==r.__&&(r.__=!0,e.sub(F)),e.props.value):t.__}function it(t,e){n.useDebugValue&&n.useDebugValue(e?e(t):t)}function ot(t){var e=Z(U++,10),r=J();return e.__=t,F.componentDidCatch||(F.componentDidCatch=function(t){e.__&&e.__(t),r[1](t)}),[r[0],function(){r[1](void 0)}]}function st(){H.some((function(t){if(t.__P)try{t.__H.__h.forEach(at),t.__H.__h.forEach(ut),t.__H.__h=[]}catch(i){return t.__H.__h=[],n.__e(i,t.__v),!0}})),H=[]}function at(t){t.t&&t.t()}function ut(t){var e=t.__();"function"==typeof e&&(t.t=e)}function ct(t,e){return!t||e.some((function(e,r){return e!==t[r]}))}function lt(t,e){return"function"==typeof e?e(t):e}function ft(t,e){for(var r in e)t[r]=e[r];return t}function ht(t,e){for(var r in t)if("__source"!==r&&!(r in e))return!0;for(var n in e)if("__source"!==n&&t[n]!==e[n])return!0;return!1}n.__r=function(t){K&&K(t),U=0,(F=t.__c).__H&&(F.__H.__h.forEach(at),F.__H.__h.forEach(ut),F.__H.__h=[])},n.diffed=function(t){G&&G(t);var e=t.__c;if(e){var r=e.__H;r&&r.__h.length&&(1!==H.push(e)&&D===n.requestAnimationFrame||((D=n.requestAnimationFrame)||function(t){var e,r=function(){clearTimeout(n),cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);"undefined"!=typeof window&&(e=requestAnimationFrame(r))})(st))}},n.__c=function(t,e){e.some((function(t){try{t.__h.forEach(at),t.__h=t.__h.filter((function(t){return!t.__||ut(t)}))}catch(a){e.some((function(t){t.__h&&(t.__h=[])})),e=[],n.__e(a,t.__v)}})),W&&W(t,e)},n.unmount=function(t){V&&V(t);var e=t.__c;if(e){var r=e.__H;if(r)try{r.__.forEach((function(t){return t.t&&t.t()}))}catch(t){n.__e(t,e.__v)}}};var dt=function(t){var e,r;function n(e){var r;return(r=t.call(this,e)||this).isPureReactComponent=!0,r}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,n.prototype.shouldComponentUpdate=function(t,e){return ht(this.props,t)||ht(this.state,e)},n}(b);function pt(t,e){function r(t){var r=this.props.ref,n=r==t.ref;return!n&&r&&(r.call?r(null):r.current=null),e?!e(this.props,t)||!n:ht(this.props,t)}function n(e){return this.shouldComponentUpdate=r,m(t,ft({},e))}return n.prototype.isReactComponent=!0,n.displayName="Memo("+(t.displayName||t.name)+")",n.t=!0,n}var mt=n.__b;function gt(t){function e(e){var r=ft({},e);return delete r.ref,t(r,e.ref)}return e.prototype.isReactComponent=e.t=!0,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}n.__b=function(t){t.type&&t.type.t&&t.ref&&(t.props.ref=t.ref,t.ref=null),mt&&mt(t)};var yt=function(t,e){return t?x(t).reduce((function(t,r,n){return t.concat(e(r,n))}),[]):null},vt={map:yt,forEach:yt,count:function(t){return t?x(t).length:0},only:function(t){if(1!==(t=x(t)).length)throw new Error("Children.only() expects only one child.");return t[0]},toArray:x},bt=n.__e;function wt(t){return t&&((t=ft({},t)).__c=null,t.__k=t.__k&&t.__k.map(wt)),t}function _t(){this.__u=0,this.o=null,this.__b=null}function Mt(t){var e=t.__.__c;return e&&e.u&&e.u(t)}function At(t){var e,r,n;function i(i){if(e||(e=t()).then((function(t){r=t.default||t}),(function(t){n=t})),n)throw n;if(!r)throw e;return m(r,i)}return i.displayName="Lazy",i.t=!0,i}function Et(){this.i=null,this.l=null}n.__e=function(t,e,r){if(t.then)for(var n,i=e;i=i.__;)if((n=i.__c)&&n.__c)return n.__c(t,e.__c);bt(t,e,r)},(_t.prototype=new b).__c=function(t,e){var r=this;null==r.o&&(r.o=[]),r.o.push(e);var n=Mt(r.__v),i=!1,o=function(){i||(i=!0,n?n(s):s())};e.__c=e.componentWillUnmount,e.componentWillUnmount=function(){o(),e.__c&&e.__c()};var s=function(){var t;if(!--r.__u)for(r.__v.__k[0]=r.state.u,r.setState({u:r.__b=null});t=r.o.pop();)t.forceUpdate()};r.__u++||r.setState({u:r.__b=r.__v.__k[0]}),t.then(o,o)},_t.prototype.render=function(t,e){return this.__b&&(this.__v.__k[0]=wt(this.__b),this.__b=null),[m(b,null,e.u?null:t.children),e.u&&t.fallback]};var xt=function(t,e,r){if(++r[1]===r[0]&&t.l.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.l.size))for(r=t.i;r;){for(;r.length>3;)r.pop()();if(r[1]>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=e},3280:function(t,e,r){var n=r(9131);function i(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=n.alloc(t*t),this.reservedBit=n.alloc(t*t)}i.prototype.set=function(t,e,r,n){var i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},i.prototype.get=function(t,e){return this.data[t*this.size+e]},i.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},i.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=i},3424:function(t,e,r){var n=r(9131),i=r(6910);function o(t){this.mode=i.BYTE,this.data=n.from(t)}o.getBitsLength=function(t){return 8*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){for(var e=0,r=this.data.length;e=0&&t.bit<4},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(n){return r}}},6526:function(t,e,r){var n=r(242).getSymbolSize;e.getPositions=function(t){var e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},1642:function(t,e,r){var n=r(242),i=n.getBCHDigit(1335);e.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,o=r<<10;n.getBCHDigit(o)-i>=0;)o^=1335<=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},t.exports=o},7126:function(t,e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var r=3,n=3,i=40,o=10;function s(t,r,n){switch(t){case e.Patterns.PATTERN000:return(r+n)%2==0;case e.Patterns.PATTERN001:return r%2==0;case e.Patterns.PATTERN010:return n%3==0;case e.Patterns.PATTERN011:return(r+n)%3==0;case e.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case e.Patterns.PATTERN101:return r*n%2+r*n%3==0;case e.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case e.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){for(var e=t.size,n=0,i=0,o=0,s=null,a=null,u=0;u=5&&(n+=r+(i-5)),s=l,i=1),(l=t.get(c,u))===a?o++:(o>=5&&(n+=r+(o-5)),a=l,o=1)}i>=5&&(n+=r+(i-5)),o>=5&&(n+=r+(o-5))}return n},e.getPenaltyN2=function(t){for(var e=t.size,r=0,i=0;i=10&&(1488===n||93===n)&&r++,o=o<<1&2047|t.get(a,s),a>=10&&(1488===o||93===o)&&r++}return r*i},e.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return i.testNumeric(t)?e.NUMERIC:i.testAlphanumeric(t)?e.ALPHANUMERIC:i.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,r){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(n){return r}}},1085:function(t,e,r){var n=r(6910);function i(t){this.mode=n.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);var i=this.data.length-e;i>0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*i+1))},t.exports=i},6143:function(t,e,r){var n=r(9131),i=r(2577);e.mul=function(t,e){for(var r=n.alloc(t.length+e.length-1),o=0;o=0;){for(var o=r[0],s=0;s>n&1),n<6?t.set(n,8,i,!0):n<8?t.set(n+1,8,i,!0):t.set(o-15+n,8,i,!0),n<8?t.set(8,o-n-1,i,!0):n<9?t.set(8,15-n-1+1,i,!0):t.set(8,15-n-1,i,!0);t.set(o-8,8,1,!0)}function b(t,e,r){var o=new s;r.forEach((function(e){o.put(e.mode.bit,4),o.put(e.getLength(),m.getCharCountIndicator(e.mode,t)),e.write(o)}));var a=8*(i.getSymbolTotalCodewords(t)-f.getTotalCodewordsCount(t,e));for(o.getLengthInBits()+4<=a&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);for(var u=(a-o.getLengthInBits())/8,c=0;c=0&&a<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===a||6===a)||a>=2&&a<=4&&u>=2&&u<=4?t.set(o+a,s+u,!0,!0):t.set(o+a,s+u,!1,!0))}(w,e),function(t){for(var e=t.size,r=8;r=7&&function(t,e){for(var r,n,i,o=t.size,s=d.getEncodedBits(e),a=0;a<18;a++)r=Math.floor(a/3),n=a%3+o-8-3,i=1==(s>>a&1),t.set(r,n,i,!0),t.set(n,r,i,!0)}(w,e),function(t,e){for(var r=t.size,n=-1,i=r-1,o=7,s=0,a=r-1;a>0;a-=2)for(6===a&&a--;;){for(var u=0;u<2;u++)if(!t.isReserved(i,a-u)){var c=!1;s>>o&1)),t.set(i,a-u,c),-1==--o&&(s++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(w,p),isNaN(n)&&(n=l.getBestMask(w,v.bind(null,w,r))),l.applyMask(n,w),v(w,r,n),{modules:w,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}e.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,s=o.M;return void 0!==e&&(s=o.from(e.errorCorrectionLevel,o.M),r=d.from(e.version),n=l.from(e.maskPattern),e.toSJISFunc&&i.setToSJISFunction(e.toSJISFunc)),w(t,r,s,n)}},2882:function(t,e,r){var n=r(9131),i=r(6143),o=r(8764).Buffer;function s(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}s.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},s.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=n.alloc(this.degree),r=o.concat([t,e],t.length+this.degree),s=i.mod(r,this.genPoly),a=this.degree-s.length;if(a>0){var u=n.alloc(this.degree);return s.copy(u,a),u}return s},t.exports=s},7007:function(t,e){var r="[0-9]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(n,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(i,"g"),e.NUMERIC=new RegExp(r,"g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),s=new RegExp("^"+r+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return o.test(t)},e.testNumeric=function(t){return s.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},6130:function(t,e,r){var n=r(6910),i=r(1085),o=r(8260),s=r(3424),a=r(5442),u=r(7007),c=r(242),l=r(5987);function f(t){return unescape(encodeURIComponent(t)).length}function h(t,e,r){for(var n,i=[];null!==(n=t.exec(r));)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function d(t){var e,r,i=h(u.NUMERIC,n.NUMERIC,t),o=h(u.ALPHANUMERIC,n.ALPHANUMERIC,t);return c.isKanjiModeEnabled()?(e=h(u.BYTE,n.BYTE,t),r=h(u.KANJI,n.KANJI,t)):(e=h(u.BYTE_KANJI,n.BYTE,t),r=[]),i.concat(o,e,r).sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function p(t,e){switch(e){case n.NUMERIC:return i.getBitsLength(t);case n.ALPHANUMERIC:return o.getBitsLength(t);case n.KANJI:return a.getBitsLength(t);case n.BYTE:return s.getBitsLength(t)}}function m(t,e){var r,u=n.getBestModeForData(t);if((r=n.from(e,u))!==n.BYTE&&r.bit=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[])}(a))},e.rawSplit=function(t){return e.fromArray(d(t,c.isKanjiModeEnabled()))}},242:function(t,e){var r,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return n[t]},e.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');r=t},e.isKanjiModeEnabled=function(){return void 0!==r},e.toSJIS=function(t){return r(t)}},3114:function(t,e){e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},3103:function(t,e,r){var n=r(242),i=r(5393),o=r(4908),s=r(6910),a=r(3114),u=r(5826),c=n.getBCHDigit(7973);function l(t,e){return s.getCharCountIndicator(t,e)+4}function f(t,e){var r=0;return t.forEach((function(t){var n=l(t.mode,e);r+=n+t.getBitsLength()})),r}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,r){if(!a.isValid(t))throw new Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);var o=8*(n.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e));if(r===s.MIXED)return o;var u=o-l(r,t);switch(r){case s.NUMERIC:return Math.floor(u/10*3);case s.ALPHANUMERIC:return Math.floor(u/11*2);case s.KANJI:return Math.floor(u/13);case s.BYTE:default:return Math.floor(u/8)}},e.getBestVersionForData=function(t,r){var n,i=o.from(r,o.M);if(u(t)){if(t.length>1)return function(t,r){for(var n=1;n<=40;n++)if(f(t,n)<=e.getCapacity(n,r,s.MIXED))return n}(t,i);if(0===t.length)return 1;n=t[0]}else n=t;return function(t,r,n){for(var i=1;i<=40;i++)if(r<=e.getCapacity(i,n,t))return i}(n.mode,n.getLength(),i)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;n.getBCHDigit(e)-c>=0;)e^=7973<':"",f="0&&c>0&&t[u-1]||(n+=s?o("M",c+r,.5+l+r):o("m",i,0),i=0,s=!1),c+1',h='viewBox="0 0 '+c+" "+c+'"',d=''+l+f+"\n";return"function"==typeof r&&r(null,d),d}},9653:function(t,e){function r(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))),6===e.length&&e.push("F","F");var r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:n,scale:n?4:i,margin:e,color:{dark:r(t.color.dark||"#000000ff"),light:r(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,r){var n=e.getScale(t,r);return Math.floor((t+2*r.margin)*n)},e.qrToImageData=function(t,r,n){for(var i=r.modules.size,o=r.modules.data,s=e.getScale(i,n),a=Math.floor((i+2*n.margin)*s),u=n.margin*s,c=[n.color.light,n.color.dark],l=0;l=u&&f>=u&&l=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function a(t,e){var r;return o.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e)).__proto__=o.prototype:(null===(r=t)&&(r=new o(e)),r.length=e),r}function u(t,e){var r=a(t,e<0?0:0|s(e));if(!o.TYPED_ARRAY_SUPPORT)for(var n=0;n55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function f(t){return o.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:l(t).length)}o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),o.prototype.write=function(t,e,r){void 0===e||void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,e,r,n){return function(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}(l(e,t.length-r),t,r,n)}(this,t,e,r)},o.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;iNumber(t)-Number(e))).map((e=>t[e])):t}function l(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function f(t){const e=(t=l(t)).indexOf("?");return-1===e?"":t.slice(e+1)}function h(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&"string"==typeof t&&""!==t.trim()?t=Number(t):!e.parseBooleans||null===t||"true"!==t.toLowerCase()&&"false"!==t.toLowerCase()||(t="true"===t.toLowerCase()),t}function d(t,e){s((e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e)).arrayFormatSeparator);const r=function(t){let e;switch(t.arrayFormat){case"index":return(t,r,n)=>{e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===n[t]&&(n[t]={}),n[t][e[1]]=r):n[t]=r};case"bracket":return(t,r,n)=>{e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==n[t]?n[t]=[].concat(n[t],r):n[t]=[r]:n[t]=r};case"comma":case"separator":return(e,r,n)=>{const i="string"==typeof r&&r.split("").indexOf(t.arrayFormatSeparator)>-1?r.split(t.arrayFormatSeparator).map((e=>u(e,t))):null===r?r:u(r,t);n[e]=i};default:return(t,e,r)=>{void 0!==r[t]?r[t]=[].concat(r[t],e):r[t]=e}}}(e),n=Object.create(null);if("string"!=typeof t)return n;if(!(t=t.trim().replace(/^[?#&]/,"")))return n;for(const i of t.split("&")){let[t,s]=o(e.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator"].includes(e.arrayFormat)?s:u(s,e),r(u(t,e),s,n)}for(const i of Object.keys(n)){const t=n[i];if("object"==typeof t&&null!==t)for(const r of Object.keys(t))t[r]=h(t[r],e);else n[i]=h(t,e)}return!1===e.sort?n:(!0===e.sort?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce(((t,e)=>{const r=n[e];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?t[e]=c(r):t[e]=r,t}),Object.create(null))}e.extract=f,e.parse=d,e.stringify=(t,e)=>{if(!t)return"";s((e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e)).arrayFormatSeparator);const r=r=>e.skipNull&&null==t[r]||e.skipEmptyString&&""===t[r],n=function(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[a(e,t),"[",i,"]"].join("")]:[...r,[a(e,t),"[",a(i,t),"]=",a(n,t)].join("")]};case"bracket":return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,[a(e,t),"[]"].join("")]:[...r,[a(e,t),"[]=",a(n,t)].join("")];case"comma":case"separator":return e=>(r,n)=>null==n||0===n.length?r:0===r.length?[[a(e,t),"=",a(n,t)].join("")]:[[r,a(n,t)].join(t.arrayFormatSeparator)];default:return e=>(r,n)=>void 0===n||t.skipNull&&null===n||t.skipEmptyString&&""===n?r:null===n?[...r,a(e,t)]:[...r,[a(e,t),"=",a(n,t)].join("")]}}(e),i={};for(const s of Object.keys(t))r(s)||(i[s]=t[s]);const o=Object.keys(i);return!1!==e.sort&&o.sort(e.sort),o.map((r=>{const i=t[r];return void 0===i?"":null===i?a(r,e):Array.isArray(i)?i.reduce(n(r),[]).join("&"):a(r,e)+"="+a(i,e)})).filter((t=>t.length>0)).join("&")},e.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);const[r,n]=o(t,"#");return Object.assign({url:r.split("?")[0]||"",query:d(f(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=l(t.url).split("?")[0]||"",i=e.extract(t.url),o=e.parse(i,{sort:!1}),s=Object.assign(o,t.query);let u=e.stringify(s,r);u&&(u=`?${u}`);let c=function(t){let e="";const r=t.indexOf("#");return-1!==r&&(e=t.slice(r)),e}(t.url);return t.fragmentIdentifier&&(c=`#${a(t.fragmentIdentifier,r)}`),`${n}${u}${c}`}},2587:function(t){"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(r);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var u=t.length;a>0&&u>a&&(u=a);for(var c=0;c=0?(l=p.substr(0,m),f=p.substr(m+1)):(l=p,f=""),h=decodeURIComponent(l),d=decodeURIComponent(f),e(o,h)?Array.isArray(o[h])?o[h].push(d):o[h]=[o[h],d]:o[h]=d}return o}},2182:function(t){"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,r,n,i){return r=r||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var o=encodeURIComponent(e(i))+n;return Array.isArray(t[i])?t[i].map((function(t){return o+encodeURIComponent(e(t))})).join(r):o+encodeURIComponent(e(t[i]))})).join(r):i?encodeURIComponent(e(i))+n+encodeURIComponent(e(t)):""}},7673:function(t,e,r){"use strict";e.decode=e.parse=r(2587),e.encode=e.stringify=r(2182)},1798:function(t,e,r){"use strict";var n=65536,i=4294967295;var o=r(9509).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>i)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(t);if(t>0)if(t>n)for(var a=0;a2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a;if("string"==typeof e&&(o="not ",e.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:function(t,e,r){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=c;var i=r(9481),o=r(4229);r(5717)(c,i);for(var s=n(o.prototype),a=0;a0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)c.endEmitted?_(t,new w):k(t,c,e,!0);else if(c.ended)_(t,new v);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?k(t,c,e,!1):C(t,c)):k(t,c,e,!1)}else n||(c.reading=!1,C(t,c));return!c.ended&&(c.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=S?t=S:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function I(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(P,t))}function P(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,L(t)}function C(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(T,t,e))}function T(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function N(t){u("readable nexttick read 0"),t.read(0)}function B(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),L(t),e.flowing&&!e.reading&&t.read(0)}function L(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function q(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(U,e,t))}function U(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function F(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?q(this):I(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&q(this),null;var n,i=e.needReadable;return u("need readable",i),(0===e.length||e.length-t0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&q(this)),null!==n&&this.emit("data",n),n},E.prototype._read=function(t){_(this,new b("_read()"))},E.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var o=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?a:m;function s(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",m),r.removeListener("data",f),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function a(){u("onend"),t.end()}n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);var c=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,L(t))}}(r);t.on("drain",c);var l=!1;function f(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==F(n.pipes,t))&&!l&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){u("onerror",e),m(),t.removeListener("error",h),0===i(t,"error")&&_(t,e)}function d(){t.removeListener("finish",p),m()}function p(){u("onfinish"),t.removeListener("close",d),m()}function m(){u("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",h),t.once("close",d),t.once("finish",p),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},E.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?I(this):n.reading||process.nextTick(N,this))),r},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(t,e){var r=o.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(O,this),r},E.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(O,this),e},E.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(B,t,e))}(this,t)),t.paused=!1,this},E.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},E.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(t,e,r){r(new p("_write()"))},E.prototype._writev=null,E.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,P(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),E.prototype.destroy=l.destroy,E.prototype._undestroy=l.undestroy,E.prototype._destroy=function(t,e){e(t)}},5850:function(t,e,r){"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(8610),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[h].read();null!==r&&(t[l]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function m(t){process.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(d(void 0,!0));if(this[h].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[u]?r(t[u]):e(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(d(void 0,!0)):e[f](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[f])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),g);t.exports=function(t){var e,r=Object.create(y,(i(e={},h,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[h].read();n?(r[l]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[l]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[l]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[l]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}},7327:function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e0,(function(t){l||(l=t),t&&h.forEach(u),o||(h.forEach(u),f(l))}))}));return e.reduce(c)}},2457:function(t,e,r){"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:function(t,e,r){t.exports=r(7187).EventEmitter},4626:function(t,e,r){"use strict";var n=r(9509).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=f,e=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},8473:function(t,e,r){(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9785:function(t,e,r){"use strict";var n=r(8764).Buffer,i=r(5717),o=r(3349),s=new Array(16),a=[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],u=[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],c=[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],l=[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],f=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<>>32-e}function m(t,e,r,n,i,o,s,a){return p(t+(e^r^n)+o+s|0,a)+i|0}function g(t,e,r,n,i,o,s,a){return p(t+(e&r|~e&n)+o+s|0,a)+i|0}function y(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function v(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function b(t,e,r,n,i,o,s,a){return p(t+(e^(r|~n))+o+s|0,a)+i|0}i(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,A=0|this._d,E=0|this._e,x=0;x<80;x+=1){var k,S;x<16?(k=m(r,n,i,o,d,t[a[x]],f[0],c[x]),S=b(w,_,M,A,E,t[u[x]],h[0],l[x])):x<32?(k=g(r,n,i,o,d,t[a[x]],f[1],c[x]),S=v(w,_,M,A,E,t[u[x]],h[1],l[x])):x<48?(k=y(r,n,i,o,d,t[a[x]],f[2],c[x]),S=y(w,_,M,A,E,t[u[x]],h[2],l[x])):x<64?(k=v(r,n,i,o,d,t[a[x]],f[3],c[x]),S=g(w,_,M,A,E,t[u[x]],h[3],l[x])):(k=b(r,n,i,o,d,t[a[x]],f[4],c[x]),S=m(w,_,M,A,E,t[u[x]],h[4],l[x])),r=d,d=o,o=p(i,10),i=n,n=k,w=E,E=A,A=p(M,10),M=_,_=S}var R=this._b+i+A|0;this._b=this._c+o+E|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+M|0,this._a=R},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},1675:function(t,e,r){"use strict";var n=r(8764).Buffer,i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLength=e.decode=e.encode=void 0;var o=i(r(3493));function s(t,e){if("0"===t[0]&&"0"===t[1])throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function a(t,e){if(t<56)return n.from([t+e]);var r=l(t),i=l(e+55+r.length/2);return n.from(i+r,"hex")}function u(t){var e,r,i,o,a,c=[],l=t[0];if(l<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(l<=183){if(e=l-127,i=128===l?n.from([]):t.slice(1,e),2===e&&i[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:i,remainder:t.slice(e)}}if(l<=191){if(r=l-182,t.length-1t.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(o=t.slice(r,f)).length)throw new Error("invalid rlp, List has a invalid length");for(;o.length;)a=u(o),c.push(a.data),o=a.remainder;return{data:c,remainder:t.slice(f)}}function c(t){return"0x"===t.slice(0,2)}function l(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");var e=t.toString(16);return e.length%2?"0"+e:e}function f(t){if(!n.isBuffer(t)){if("string"==typeof t)return c(t)?n.from((r="string"!=typeof(i=t)?i:c(i)?i.slice(2):i).length%2?"0"+r:r,"hex"):n.from(t);if("number"==typeof t||"bigint"==typeof t)return t?(e=l(t),n.from(e,"hex")):n.from([]);if(null==t)return n.from([]);if(t instanceof Uint8Array)return n.from(t);if(o.default.isBN(t))return n.from(t.toArray());throw new Error("invalid type")}var e,r,i;return t}e.encode=function t(e){if(Array.isArray(e)){for(var r=[],i=0;i=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(R){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(l).toString(t);r=(f=f.idivn(l)).isZero()?m+r:h[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],y=8191&g,v=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],k=8191&x,S=x>>>13,R=0|s[6],I=8191&R,P=R>>>13,C=0|s[7],T=8191&C,O=C>>>13,N=0|s[8],B=8191&N,L=N>>>13,j=0|s[9],q=8191&j,U=j>>>13,F=0|a[0],D=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,Z=W>>>13,J=0|a[3],Y=8191&J,Q=J>>>13,X=0|a[4],$=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ft=8191<,ht=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,D))|0)+((8191&(i=(i=Math.imul(f,z))+Math.imul(h,D)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,D),i=(i=Math.imul(p,z))+Math.imul(m,D)|0,o=Math.imul(m,z);var yt=(c+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,D),i=(i=Math.imul(y,z))+Math.imul(v,D)|0,o=Math.imul(v,z),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,G)|0;var vt=(c+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(w,D),i=(i=Math.imul(w,z))+Math.imul(_,D)|0,o=Math.imul(_,z),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,Z)|0;var bt=(c+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,Q)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,D),i=(i=Math.imul(A,z))+Math.imul(E,D)|0,o=Math.imul(E,z),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Z)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,Q)|0;var wt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(k,D),i=(i=Math.imul(k,z))+Math.imul(S,D)|0,o=Math.imul(S,z),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(I,D),i=(i=Math.imul(I,z))+Math.imul(P,D)|0,o=Math.imul(P,z),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Mt=(c+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,D),i=(i=Math.imul(T,z))+Math.imul(O,D)|0,o=Math.imul(O,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,G)|0,n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,Q)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var At=(c+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,D),i=(i=Math.imul(B,z))+Math.imul(L,D)|0,o=Math.imul(L,z),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Z)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,Q)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,Q)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Et=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(q,D),i=(i=Math.imul(q,z))+Math.imul(U,D)|0,o=Math.imul(U,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(L,K)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,Q)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,ut)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(q,K),i=(i=Math.imul(q,G))+Math.imul(U,K)|0,o=Math.imul(U,G),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,Z)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(y,ft)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(v,ft)|0,o=o+Math.imul(v,ht)|0;var kt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(q,V),i=(i=Math.imul(q,Z))+Math.imul(U,V)|0,o=Math.imul(U,Z),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,Q)|0)+Math.imul(L,Y)|0,o=o+Math.imul(L,Q)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(q,Y),i=(i=Math.imul(q,Q))+Math.imul(U,Y)|0,o=Math.imul(U,Q),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(k,ut)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ht)|0;var Rt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(q,$),i=(i=Math.imul(q,tt))+Math.imul(U,$)|0,o=Math.imul(U,tt),n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ct)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,ht)|0;var It=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(q,rt),i=(i=Math.imul(q,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(P,ft)|0,o=o+Math.imul(P,ht)|0;var Pt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(q,ot),i=(i=Math.imul(q,st))+Math.imul(U,ot)|0,o=Math.imul(U,st),n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ht)|0;var Ct=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(q,ut),i=(i=Math.imul(q,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ht)|0;var Tt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(q,ft),i=(i=Math.imul(q,ht))+Math.imul(U,ft)|0,o=Math.imul(U,ht);var Ot=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Nt=(c+(n=Math.imul(q,pt))|0)+((8191&(i=(i=Math.imul(q,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,u[0]=gt,u[1]=yt,u[2]=vt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=Et,u[9]=xt,u[10]=kt,u[11]=St,u[12]=Rt,u[13]=It,u[14]=Pt,u[15]=Ct,u[16]=Tt,u[17]=Ot,u[18]=Nt,0!==c&&(u[19]=c,r.length++),r};function y(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(t,e,r){return y(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?y(this,t,e):v(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=h)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(M,_),M.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},M.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new M;else if("p224"===t)e=new A;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new x}return w[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},9509:function(t,e,r){var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},7253:function(t,e,r){const n=r(9539),i=r(7187);var o="object"==typeof Reflect?Reflect:null,s=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};function a(){i.call(this)}function u(t,e,r){try{s(t,e,r)}catch(n){setTimeout((()=>{throw n}))}}t.exports=a,n.inherits(a,i),a.prototype.emit=function(t){for(var e=[],r=1;r0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)u(a,this,e);else{var c=a.length,l=function(t,e){for(var r=new Array(e),n=0;n=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let s=new o(e),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===t||7===t)&&a.isOdd()!==(7===t))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function a(t,e){const r=e.encode(null,33===t.length);for(let n=0;n=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify(t){return null===s(t)?1:0},publicKeyCreate(t,e){const r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;return a(t,n.keyFromPrivate(e).getPublic()),0},publicKeyConvert(t,e){const r=s(e);if(null===r)return 1;return a(t,r.getPublic()),0},publicKeyNegate(t,e){const r=s(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let i=0;i=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(t,u),0)},publicKeyTweakMul(t,e,r){const n=s(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0||r.isZero())return 2;return a(t,n.getPublic().mul(r)),0},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=t;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,c=0;for(;u>1&&0===a[c]&&!(128&a[c+1]);--u,++c);if(a=a.subarray(c),128&a[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let l=s.subarray(39,72);l[0]=0,l.set(n,1);let f=33,h=0;for(;f>1&&0===l[h]&&!(128&l[h+1]);--f,++h);return l=l.subarray(h),128&l[0]||f>1&&0===l[0]&&!(128&l[1])?1:(t.outputlen=6+u+f,s[0]=48,s[1]=t.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=l.length,s.set(l,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let s=e.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=e.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let c=new o(e.subarray(6+r));return c.cmp(i.n)>=0&&(c=new o(0)),t.set(u.toArrayLike(Uint8Array,"be",32),0),t.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,s,a){if(a){const t=a;a=n=>{const i=t(e,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)}}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let c;try{c=n.sign(e,r,{canonical:!0,k:a,pers:s})}catch(l){return 1}return t.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),t.recid=c.recoveryParam,0},ecdsaVerify(t,e,r){const a={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(a.r),c=new o(a.s);if(u.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||u.isZero()||c.isZero())return 3;const l=s(r);if(null===l)return 2;const f=l.getPublic();return n.verify(e,a,f)?0:3},ecdsaRecover(t,e,r,s){const u={r:e.slice(0,32),s:e.slice(32,64)},c=new o(u.r),l=new o(u.s);if(c.cmp(i.n)>=0||l.cmp(i.n)>=0)return 1;if(c.isZero()||l.isZero())return 2;let f;try{f=n.recoverPubKey(s,u,r)}catch(h){return 2}return a(t,f),0},ecdh(t,e,r,a,u,c,l){const f=s(e);if(null===f)return 1;const h=new o(r);if(h.cmp(i.n)>=0||h.isZero())return 2;const d=f.getPublic().mul(h);if(void 0===u){const e=d.encode(null,!0),r=n.hash().update(e).digest();for(let n=0;n<32;++n)t[n]=r[n]}else{c||(c=new Uint8Array(32));const e=d.getX().toArray("be",32);for(let t=0;t<32;++t)c[t]=e[t];l||(l=new Uint8Array(32));const r=d.getY().toArray("be",32);for(let t=0;t<32;++t)l[t]=r[t];const n=u(c,l,a);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},9119:function(t){const e="Impossible case. Please create issue.",r="The tweak was out of range or the resulted private key is invalid",n="The tweak was out of range or equal to zero",i="Unknow error on context randomization",o="Private Key is invalid",s="Public Key could not be parsed",a="Public Key serialization error",u="The sum of the public keys is not valid",c="Signature could not be parsed",l="The nonce generation function failed, or the private key was invalid",f="Public key could not be recover",h="Scalar was invalid (zero or overflow)";function d(t,e){if(!t)throw new Error(e)}function p(t,e,r){if(d(e instanceof Uint8Array,`Expected ${t} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${t} to be an Uint8Array with length [${r.join(", ")}]`;d(r.includes(e.length),n)}else{const n=`Expected ${t} to be an Uint8Array with length ${r}`;d(e.length===r,n)}}function m(t){d("Boolean"===y(t),"Expected compressed to be a Boolean")}function g(t=(t=>new Uint8Array(t)),e){return"function"==typeof t&&(t=t(e)),p("output",t,e),t}function y(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){if(d(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&p("seed",e,32),1===t.contextRandomize(e))throw new Error(i)},privateKeyVerify(e){return p("private key",e,32),0===t.privateKeyVerify(e)},privateKeyNegate(r){switch(p("private key",r,32),t.privateKeyNegate(r)){case 0:return r;case 1:throw new Error(e)}},privateKeyTweakAdd(e,n){switch(p("private key",e,32),p("tweak",n,32),t.privateKeyTweakAdd(e,n)){case 0:return e;case 1:throw new Error(r)}},privateKeyTweakMul(e,r){switch(p("private key",e,32),p("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(n)}},publicKeyVerify(e){return p("public key",e,[33,65]),0===t.publicKeyVerify(e)},publicKeyCreate(e,r=!0,n){switch(p("private key",e,32),m(r),n=g(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(a)}},publicKeyConvert(e,r=!0,n){switch(p("public key",e,[33,65]),m(r),n=g(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(a)}},publicKeyNegate(r,n=!0,i){switch(p("public key",r,[33,65]),m(n),i=g(i,n?33:65),t.publicKeyNegate(i,r)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(e);case 3:throw new Error(a)}},publicKeyCombine(e,r=!0,n){d(Array.isArray(e),"Expected public keys to be an Array"),d(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)p("public key",t,[33,65]);switch(m(r),n=g(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(s);case 2:throw new Error(u);case 3:throw new Error(a)}},publicKeyTweakAdd(e,n,i=!0,o){switch(p("public key",e,[33,65]),p("tweak",n,32),m(i),o=g(o,i?33:65),t.publicKeyTweakAdd(o,e,n)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(r)}},publicKeyTweakMul(e,r,i=!0,o){switch(p("public key",e,[33,65]),p("tweak",r,32),m(i),o=g(o,i?33:65),t.publicKeyTweakMul(o,e,r)){case 0:return o;case 1:throw new Error(s);case 2:throw new Error(n)}},signatureNormalize(e){switch(p("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(r,n){p("signature",r,64);const i={output:n=g(n,72),outputlen:72};switch(t.signatureExport(i,r)){case 0:return n.slice(0,i.outputlen);case 1:throw new Error(c);case 2:throw new Error(e)}},signatureImport(r,n){switch(p("signature",r),n=g(n,64),t.signatureImport(n,r)){case 0:return n;case 1:throw new Error(c);case 2:throw new Error(e)}},ecdsaSign(r,n,i={},o){p("message",r,32),p("private key",n,32),d("Object"===y(i),"Expected options to be an Object"),void 0!==i.data&&p("options.data",i.data),void 0!==i.noncefn&&d("Function"===y(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:o=g(o,64),recid:null};switch(t.ecdsaSign(s,r,n,i.data,i.noncefn)){case 0:return s;case 1:throw new Error(l);case 2:throw new Error(e)}},ecdsaVerify(e,r,n){switch(p("signature",e,64),p("message",r,32),p("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(s)}},ecdsaRecover(r,n,i,o=!0,s){switch(p("signature",r,64),d("Number"===y(n)&&n>=0&&n<=3,"Expected recovery id to be a Number within interval [0, 3]"),p("message",i,32),m(o),s=g(s,o?33:65),t.ecdsaRecover(s,r,n,i)){case 0:return s;case 1:throw new Error(c);case 2:throw new Error(f);case 3:throw new Error(e)}},ecdh(e,r,n={},i){switch(p("public key",e,[33,65]),p("private key",r,32),d("Object"===y(n),"Expected options to be an Object"),void 0!==n.data&&p("options.data",n.data),void 0!==n.hashfn?(d("Function"===y(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&p("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&p("options.ybuf",n.ybuf,32),p("output",i)):i=g(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(s);case 2:throw new Error(h)}}})},45:function(t){!function(e){"use strict";var r=function(t){setTimeout(t,0)};"undefined"!=typeof process&&process&&"function"==typeof process.nextTick&&(r=process.nextTick),t.exports=function(t){var e={capacity:t||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===e.firstHere){e.current++,e.firstHere=!0;var t=1}else t=0;var r={n:1};"function"==typeof arguments[0]?r.task=arguments[0]:r.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var n=r.task;if(r.task=function(){n(e.leave)},e.current+r.n-t>e.capacity)return 1===t&&(e.current--,e.firstHere=!1),e.queue.push(r);e.current+=r.n-t,r.task(e.leave),1===t&&(e.firstHere=!1)},leave:function(t){if(t=t||1,e.current-=t,e.queue.length){var n=e.queue[0];n.n+e.current>e.capacity||(e.queue.shift(),e.current+=n.n,r(n.task))}else if(e.current<0)throw new Error("leave called too many times.")},available:function(t){return t=t||1,e.current+t<=e.capacity}};return e}}()},4189:function(t,e,r){var n=r(9509).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},9072:function(t,e,r){var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(2349),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},2349:function(t,e,r){var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(t){return t<<30|t>>>2}function l(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var h=0;h<80;++h){var d=~~(h/20),p=0|((e=n)<<5|e>>>27)+l(d,i,o,a)+u+r[h]+s[d];u=a,a=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},8336:function(t,e,r){var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(t){return t<<5|t>>>27}function l(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=c(n)+f(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=l(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},8432:function(t,e,r){var n=r(5717),i=r(7499),o=r(4189),s=r(9509).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},7499:function(t,e,r){var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[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],a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}function c(t,e,r){return r^t&(e^r)}function l(t,e,r){return t&e|r&(t|e)}function f(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function h(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+d(r[y-15])+r[y-16];for(var v=0;v<64;++v){var b=g+h(u)+c(u,p,m)+s[v]+r[v]|0,w=f(n)+l(n,i,o)|0;g=m,m=p,p=u,u=a+b|0,a=o,o=i,i=n,n=b+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},1686:function(t,e,r){var n=r(5717),i=r(7816),o=r(4189),s=r(9509).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},7816:function(t,e,r){var n=r(5717),i=r(4189),o=r(9509).Buffer,s=[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],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function c(t,e,r){return r^t&(e^r)}function l(t,e,r){return t&e|r&(t|e)}function f(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,v=0|this._gh,b=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,A=0|this._dl,E=0|this._el,x=0|this._fl,k=0|this._gl,S=0|this._hl,R=0;R<32;R+=2)e[R]=t.readInt32BE(4*R),e[R+1]=t.readInt32BE(4*R+4);for(;R<160;R+=2){var I=e[R-30],P=e[R-30+1],C=d(I,P),T=p(P,I),O=m(I=e[R-4],P=e[R-4+1]),N=g(P,I),B=e[R-14],L=e[R-14+1],j=e[R-32],q=e[R-32+1],U=T+L|0,F=C+B+y(U,T)|0;F=(F=F+O+y(U=U+N|0,N)|0)+j+y(U=U+q|0,q)|0,e[R]=F,e[R+1]=U}for(var D=0;D<160;D+=2){F=e[D],U=e[D+1];var z=l(r,n,i),H=l(w,_,M),K=f(r,w),G=f(w,r),W=h(a,E),V=h(E,a),Z=s[D],J=s[D+1],Y=c(a,u,v),Q=c(E,x,k),X=S+V|0,$=b+W+y(X,S)|0;$=($=($=$+Y+y(X=X+Q|0,Q)|0)+Z+y(X=X+J|0,J)|0)+F+y(X=X+U|0,U)|0;var tt=G+H|0,et=K+z+y(tt,G)|0;b=v,S=k,v=u,k=x,u=a,x=E,a=o+$+y(E=A+X|0,A)|0,o=i,A=M,i=n,M=_,n=r,_=w,r=$+et+y(w=X+tt|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+A|0,this._el=this._el+E|0,this._fl=this._fl+x|0,this._gl=this._gl+k|0,this._hl=this._hl+S|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,_)|0,this._ch=this._ch+i+y(this._cl,M)|0,this._dh=this._dh+o+y(this._dl,A)|0,this._eh=this._eh+a+y(this._el,E)|0,this._fh=this._fh+u+y(this._fl,x)|0,this._gh=this._gh+v+y(this._gl,k)|0,this._hh=this._hh+b+y(this._hl,S)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},500:function(t){"use strict";t.exports=(t,e)=>{if("string"!=typeof t||"string"!=typeof e)throw new TypeError("Expected the arguments to be of type `string`");if(""===e)return[t];const r=t.indexOf(e);return-1===r?[t]:[t.slice(0,r),t.slice(r+e.length)]}},2830:function(t,e,r){t.exports=i;var n=r(7187).EventEmitter;function i(){n.call(this)}r(5717)(i,n),i.Readable=r(9481),i.Writable=r(4229),i.Duplex=r(6753),i.Transform=r(4605),i.PassThrough=r(2725),i.finished=r(8610),i.pipeline=r(9946),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("error",c),t.on("error",c),r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t}},8501:function(t,e,r){var n=r(1989),i=r(5676),o=r(7529),s=r(584),a=r(8575),u=e;u.request=function(t,e){t="string"==typeof t?a.parse(t):o(t);var i=-1===r.g.location.protocol.search(/^https?:$/)?"http:":"",s=t.protocol||i,u=t.hostname||t.host,c=t.port,l=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?s+"//"+u:"")+(c?":"+c:"")+l,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var f=new n(t);return e&&f.on("response",e),f},u.get=function(t,e){var r=u.request(t,e);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=s,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},8725:function(t,e,r){var n;function i(){if(void 0!==n)return n;if(r.g.XMLHttpRequest){n=new r.g.XMLHttpRequest;try{n.open("GET",r.g.XDomainRequest?"/":"https://example.com")}catch(t){n=null}}else n=null;return n}function o(t){var e=i();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(r){}return!1}function s(t){return"function"==typeof t}e.fetch=s(r.g.fetch)&&s(r.g.ReadableStream),e.writableStream=s(r.g.WritableStream),e.abortController=s(r.g.AbortController),e.arraybuffer=e.fetch||o("arraybuffer"),e.msstream=!e.fetch&&o("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!i()&&s(i().overrideMimeType),n=null},1989:function(t,e,r){var n=r(8764).Buffer,i=r(8725),o=r(5717),s=r(5676),a=r(8473),u=s.IncomingMessage,c=s.readyStates;var l=t.exports=function(t){var e,r=this;a.Writable.call(r),r._opts=t,r._body=[],r._headers={},t.auth&&r.setHeader("Authorization","Basic "+n.from(t.auth).toString("base64")),Object.keys(t.headers).forEach((function(e){r.setHeader(e,t.headers[e])}));var o=!0;if("disable-fetch"===t.mode||"requestTimeout"in t&&!i.abortController)o=!1,e=!0;else if("prefer-streaming"===t.mode)e=!1;else if("allow-wrong-content-type"===t.mode)e=!i.overrideMimeType;else{if(t.mode&&"default"!==t.mode&&"prefer-fast"!==t.mode)throw new Error("Invalid value for opts.mode");e=!0}r._mode=function(t,e){return i.fetch&&e?"fetch":i.mozchunkedarraybuffer?"moz-chunked-arraybuffer":i.msstream?"ms-stream":i.arraybuffer&&t?"arraybuffer":"text"}(e,o),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};o(l,a.Writable),l.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===f.indexOf(r)&&(this._headers[r]={name:t,value:e})},l.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},l.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},l.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&0!==e.timeout&&t.setTimeout(e.timeout);var n=t._headers,o=null;"GET"!==e.method&&"HEAD"!==e.method&&(o=new Blob(t._body,{type:(n["content-type"]||{}).value||""}));var s=[];if(Object.keys(n).forEach((function(t){var e=n[t].name,r=n[t].value;Array.isArray(r)?r.forEach((function(t){s.push([e,t])})):s.push([e,r])})),"fetch"===t._mode){var a=null;if(i.abortController){var u=new AbortController;a=u.signal,t._fetchAbortController=u,"requestTimeout"in e&&0!==e.requestTimeout&&(t._fetchTimer=r.g.setTimeout((function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()}),e.requestTimeout))}r.g.fetch(t._opts.url,{method:t._opts.method,headers:s,body:o||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:a}).then((function(e){t._fetchResponse=e,t._resetTimers(!1),t._connect()}),(function(e){t._resetTimers(!0),t._destroyed||t.emit("error",e)}))}else{var l=t._xhr=new r.g.XMLHttpRequest;try{l.open(t._opts.method,t._opts.url,!0)}catch(f){return void process.nextTick((function(){t.emit("error",f)}))}"responseType"in l&&(l.responseType=t._mode),"withCredentials"in l&&(l.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(l.timeout=e.requestTimeout,l.ontimeout=function(){t.emit("requestTimeout")}),s.forEach((function(t){l.setRequestHeader(t[0],t[1])})),t._response=null,l.onreadystatechange=function(){switch(l.readyState){case c.LOADING:case c.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(l.onprogress=function(){t._onXHRProgress()}),l.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{l.send(o)}catch(f){return void process.nextTick((function(){t.emit("error",f)}))}}}},l.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(r){return!1}}(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))},l.prototype._connect=function(){var t=this;t._destroyed||(t._response=new u(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",(function(e){t.emit("error",e)})),t.emit("response",t._response))},l.prototype._write=function(t,e,r){this._body.push(t),r()},l.prototype._resetTimers=function(t){var e=this;r.g.clearTimeout(e._socketTimer),e._socketTimer=null,t?(r.g.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=r.g.setTimeout((function(){e.emit("timeout")}),e._socketTimeout))},l.prototype.abort=l.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)},l.prototype.end=function(t,e,r){"function"==typeof t&&(r=t,t=void 0),a.Writable.prototype.end.call(this,t,e,r)},l.prototype.setTimeout=function(t,e){var r=this;e&&r.once("timeout",e),r._socketTimeout=t,r._resetTimers(!1)},l.prototype.flushHeaders=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},5676:function(t,e,r){var n=r(8764).Buffer,i=r(8725),o=r(5717),s=r(8473),a=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},u=e.IncomingMessage=function(t,e,r,o){var a=this;if(s.Readable.call(a),a._mode=r,a.headers={},a.rawHeaders=[],a.trailers={},a.rawTrailers=[],a.on("end",(function(){process.nextTick((function(){a.emit("close")}))})),"fetch"===r){if(a._fetchResponse=e,a.url=e.url,a.statusCode=e.status,a.statusMessage=e.statusText,e.headers.forEach((function(t,e){a.headers[e.toLowerCase()]=t,a.rawHeaders.push(e,t)})),i.writableStream){var u=new WritableStream({write:function(t){return o(!1),new Promise((function(e,r){a._destroyed?r():a.push(n.from(t))?e():a._resumeFetch=e}))},close:function(){o(!0),a._destroyed||a.push(null)},abort:function(t){o(!0),a._destroyed||a.emit("error",t)}});try{return void e.body.pipeTo(u).catch((function(t){o(!0),a._destroyed||a.emit("error",t)}))}catch(h){}}var c=e.body.getReader();!function t(){c.read().then((function(e){a._destroyed||(o(e.done),e.done?a.push(null):(a.push(n.from(e.value)),t()))})).catch((function(t){o(!0),a._destroyed||a.emit("error",t)}))}()}else{if(a._xhr=t,a._pos=0,a.url=t.responseURL,a.statusCode=t.status,a.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===a.headers[r]&&(a.headers[r]=[]),a.headers[r].push(e[2])):void 0!==a.headers[r]?a.headers[r]+=", "+e[2]:a.headers[r]=e[2],a.rawHeaders.push(e[1],e[2])}})),a._charset="x-user-defined",!i.overrideMimeType){var l=a.rawHeaders["mime-type"];if(l){var f=l.match(/;\s*charset=([^;])(;|$)/);f&&(a._charset=f[1].toLowerCase())}a._charset||(a._charset="utf-8")}}};o(u,s.Readable),u.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},u.prototype._onXHRProgress=function(t){var e=this,i=e._xhr,o=null;switch(e._mode){case"text":if((o=i.responseText).length>e._pos){var s=o.substr(e._pos);if("x-user-defined"===e._charset){for(var u=n.alloc(s.length),c=0;ce._pos&&(e.push(n.from(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){t(!0),e.push(null)},l.readAsArrayBuffer(o)}e._xhr.readyState===a.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}},610:function(t){"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))},6941:function(t,e,r){var n=r(8764).Buffer,i=n.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=e.s=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!i(t))throw new Error("Unknown encoding: "+t)}(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=s)}this.charBuffer=new n(6),this.charReceived=0,this.charLength=0};function s(t){return t.toString(this.encoding)}function a(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function u(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived);var i;n=(e+=t.toString(this.encoding,0,n)).length-1;if((i=e.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},o.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},o.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},9604:function(t,e,r){var n=r(3944);t.exports=function(t){return"string"!=typeof t?t:n(t)?t.slice(2):t}},1742:function(t){t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s}function u(t,e){return function(r,n){e(r,n,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(e){o(e)}}function a(t){try{u(n.throw(t))}catch(e){o(e)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function f(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(r=i[t](e)).value instanceof b?Promise.resolve(r.value.v).then(u,c):l(o[0][2],r)}catch(n){l(o[0][3],n)}var r}function u(t){a("next",t)}function c(t){a("throw",t)}function l(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function _(t){var e,r;return e={},n("next"),n("throw",(function(t){throw t})),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,i){e[n]=t[n]?function(e){return(r=!r)?{value:b(t[n](e)),done:"return"===n}:i?i(e):e}:i}}function M(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,r=t[Symbol.asyncIterator];return r?r.call(t):(t=p(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=t[r]&&function(e){return new Promise((function(n,i){(function(t,e,r,n){Promise.resolve(n).then((function(e){t({value:e,done:r})}),e)})(n,i,(e=t[r](e)).done,e.value)}))}}}function A(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var E=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function x(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&h(e,t,r);return E(e,t),e}function k(t){return t&&t.__esModule?t:{default:t}}function S(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function R(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r}function I(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}},5054:function(t,e,r){var n=r(8764).Buffer,i=r(4501).strict;t.exports=function(t){if(i(t)){var e=n.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(e=e.slice(t.byteOffset,t.byteOffset+t.byteLength)),e}return n.from(t)}},2511:function(t,e,r){var n;t=r.nmd(t),function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,u=36,c=1,l=26,f=38,h=700,d=72,p=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-c,_=Math.floor,M=String.fromCharCode;function A(t){throw RangeError(b[t])}function E(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function x(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+E((t=t.replace(v,".")).split("."),e).join(".")}function k(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=M((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=M(t)})).join("")}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function I(t,e,r){var n=0;for(t=r?_(t/h):t>>1,t+=_(t/e);t>w*l>>1;n+=u)t=_(t/w);return _(n+(w+1)*t/(t+f))}function P(t){var e,r,n,i,o,s,f,h,g,y,v,b=[],w=t.length,M=0,E=p,x=d;for((r=t.lastIndexOf(m))<0&&(r=0),n=0;n=128&&A("not-basic"),b.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=w&&A("invalid-input"),((h=(v=t.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:u)>=u||h>_((a-M)/s))&&A("overflow"),M+=h*s,!(h<(g=f<=x?c:f>=x+l?l:f-x));f+=u)s>_(a/(y=u-g))&&A("overflow"),s*=y;x=I(M-o,e=b.length+1,0==o),_(M/e)>a-E&&A("overflow"),E+=_(M/e),M%=e,b.splice(M++,0,E)}return S(b)}function C(t){var e,r,n,i,o,s,f,h,g,y,v,b,w,E,x,S=[];for(b=(t=k(t)).length,e=p,r=0,o=d,s=0;s=e&&v_((a-r)/(w=n+1))&&A("overflow"),r+=(f-e)*w,e=f,s=0;sa&&A("overflow"),v==e){for(h=r,g=u;!(h<(y=g<=o?c:g>=o+l?l:g-o));g+=u)x=h-y,E=u-y,S.push(M(R(y+x%E,0))),h=_(x/E);S.push(M(R(h,0))),o=I(r,w,n==i),r=0,++n}++r,++e}return S.join("")}s={version:"1.3.2",ucs2:{decode:k,encode:S},decode:P,encode:C,toASCII:function(t){return x(t,(function(t){return y.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return x(t,(function(t){return g.test(t)?P(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return s}.call(e,r,e,t))||(t.exports=n)}()},8575:function(t,e,r){"use strict";var n=r(2511),i=r(2502);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),f=["%","/","?",";","#"].concat(l),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(7673);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?O+="x":O+=T[N];if(!O.match(d)){var L=P.slice(0,S),j=P.slice(S+1),q=T.match(p);q&&(L.push(q[1]),j.unshift(q[2])),j.length&&(b="/"+j.join(".")+b),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[M])for(S=0,C=l.length;S0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!A.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var x=A.slice(-1)[0],k=(r.host||t.host||A.length>1)&&("."===x||".."===x)||""===x,S=0,R=A.length;R>=0;R--)"."===(x=A[R])?A.splice(R,1):".."===x?(A.splice(R,1),S++):S&&(A.splice(R,1),S--);if(!_&&!M)for(;S--;S)A.unshift("..");!_||""===A[0]||A[0]&&"/"===A[0].charAt(0)||A.unshift(""),k&&"/"!==A.join("/").substr(-1)&&A.push("");var I,P=""===A[0]||A[0]&&"/"===A[0].charAt(0);E&&(r.hostname=r.host=P?"":A.length?A.shift():"",(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift()));return(_=_||r.host&&A.length)&&!P&&A.unshift(""),A.length?r.pathname=A.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},2502:function(t){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},4927:function(t,e,r){function n(t){try{if(!r.g.localStorage)return!1}catch(n){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:function(t){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:function(t,e,r){"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(u)var p=a(BigInt.prototype.valueOf);if(c)var m=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(r){return!1}}function y(t){return"[object Map]"===l(t)}function v(t){return"[object Set]"===l(t)}function b(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function _(t){return"[object ArrayBuffer]"===l(t)}function M(t){return"undefined"!=typeof ArrayBuffer&&(_.working?_(t):t instanceof ArrayBuffer)}function A(t){return"[object DataView]"===l(t)}function E(t){return"undefined"!=typeof DataView&&(A.working?A(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},y.working="undefined"!=typeof Map&&y(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(y.working?y(t):t instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(v.working?v(t):t instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(b.working?b(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),e.isArrayBuffer=M,A.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&A(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var x="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function k(t){return"[object SharedArrayBuffer]"===l(t)}function S(t){return void 0!==x&&(void 0===k.working&&(k.working=k(new x)),k.working?k(t):t instanceof x)}function R(t){return g(t,f)}function I(t){return g(t,h)}function P(t){return g(t,d)}function C(t){return u&&g(t,p)}function T(t){return c&&g(t,m)}e.isSharedArrayBuffer=S,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=I,e.isBooleanObject=P,e.isBigIntObject=C,e.isSymbolObject=T,e.isBoxedPrimitive=function(t){return R(t)||I(t)||P(t)||C(t)||T(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(M(t)||S(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:function(t,e,r){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&e._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),f(n,t,n.depth)}function c(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function l(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&E(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=f(t,i,n)),i}var o=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(y(e))return t.stylize(""+e,"number");if(m(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(r);if(0===s.length){if(E(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(M(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return h(r)}var c,l="",_=!1,x=["{","}"];(p(r)&&(_=!0,x=["[","]"]),E(r))&&(l=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(l=" "+RegExp.prototype.toString.call(r)),M(r)&&(l=" "+Date.prototype.toUTCString.call(r)),A(r)&&(l=" "+h(r)),0!==s.length||_&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=_?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,x)):x[0]+l+x[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),R(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),b(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return"number"==typeof t}function v(t){return"string"==typeof t}function b(t){return void 0===t}function w(t){return _(t)&&"[object RegExp]"===x(t)}function _(t){return"object"==typeof t&&null!==t}function M(t){return _(t)&&"[object Date]"===x(t)}function A(t){return _(t)&&("[object Error]"===x(t)||t instanceof Error)}function E(t){return"function"==typeof t}function x(t){return Object.prototype.toString.call(t)}function k(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!o[t])if(s.test(t)){var r=process.pid;o[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else o[t]=function(){};return o[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=p,e.isBoolean=m,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=y,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=w,e.types.isRegExp=w,e.isObject=_,e.isDate=M,e.types.isDate=M,e.isError=A,e.types.isNativeError=A,e.isFunction=E,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(t=new Date,r=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{e._getBlockByNumberWithRetry(t,((t,r)=>{if(t)return void this.emit("error",t);if(!r)return console.log(r),void this.emit("error",new Error("Could not find block"));const n=(i=r,{number:o.toBuffer(i.number),hash:o.toBuffer(i.hash),parentHash:o.toBuffer(i.parentHash),nonce:o.toBuffer(i.nonce),mixHash:o.toBuffer(i.mixHash),sha3Uncles:o.toBuffer(i.sha3Uncles),logsBloom:o.toBuffer(i.logsBloom),transactionsRoot:o.toBuffer(i.transactionsRoot),stateRoot:o.toBuffer(i.stateRoot),receiptsRoot:o.toBuffer(i.receiptRoot||i.receiptsRoot),miner:o.toBuffer(i.miner),difficulty:o.toBuffer(i.difficulty),totalDifficulty:o.toBuffer(i.totalDifficulty),size:o.toBuffer(i.size),extraData:o.toBuffer(i.extraData),gasLimit:o.toBuffer(i.gasLimit),gasUsed:o.toBuffer(i.gasUsed),timestamp:o.toBuffer(i.timestamp),transactions:i.transactions});var i;e._setCurrentBlock(n),e.emit("rawBlock",r),e.emit("latest",r)}))})),e._blockTracker.on("sync",e.emit.bind(e,"sync")),e._blockTracker.on("error",e.emit.bind(e,"error")),e._running=!0,e.emit("start")},h.prototype.stop=function(){const t=this;t._blockTracker.removeAllListeners(),t._running=!1,t.emit("stop")},h.prototype.isRunning=function(){return this._running},h.prototype.addProvider=function(t,e){const r=this;"number"==typeof e?r._providers.splice(e,0,t):r._providers.push(t),t.setEngine(this)},h.prototype.removeProvider=function(t){const e=this._providers.indexOf(t);if(e<0)throw new Error("Provider not found.");this._providers.splice(e,1)},h.prototype.send=function(t){throw new Error("Web3ProviderEngine does not support synchronous requests.")},h.prototype.sendAsync=function(t,e){const r=this;r._ready.await((function(){Array.isArray(t)?a(t,r._handleAsync.bind(r),e):r._handleAsync(t,e)}))},h.prototype._getBlockByNumberWithRetry=function(t,e){const r=this;let n=5;return void i();function i(){r._getBlockByNumber(t,o)}function o(t,r){return t?e(t):r?void e(null,r):n>0?(n--,void setTimeout((function(){i()}),1e3)):void e(null,null)}},h.prototype._getBlockByNumber=function(t,e){const r=l({method:"eth_getBlockByNumber",params:[t,!1],skipCache:!0});this._handleAsync(r,((t,r)=>t?e(t):e(null,r.result)))},h.prototype._handleAsync=function(t,e){var r=this,n=-1,i=null,o=null,s=[];function a(r,n){o=r,i=n,u(s,(function(t,e){t?t(o,i,e):e()}),(function(){var r={id:t.id,jsonrpc:t.jsonrpc,result:i};null!=o?(r.error={message:o.stack||o.message||o,code:-32e3},e(o,r)):e(null,r)}))}!function e(i){if(n+=1,s.unshift(i),n>=r._providers.length)a(new Error('Request for method "'+t.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{r._providers[n].handleRequest(t,e,a)}catch(o){a(o)}}()},h.prototype._setCurrentBlock=function(t){this.currentBlock=t,this.emit("block",t)}},1955:function(t,e,r){const n=r(6403),i=r(7870);t.exports=class extends n{constructor(t){super((({blockTracker:e})=>i(Object.assign({blockTracker:e},t))))}}},2455:function(t,e,r){const n=r(6403),i=r(8406);t.exports=class extends n{constructor(){super((({blockTracker:t,provider:e,engine:r})=>i({blockTracker:t,provider:e})))}}},2110:function(t,e,r){const n=r(9539).inherits,i=r(398);function o(t){t=t||{},this.staticResponses=t}t.exports=o,n(o,i),o.prototype.handleRequest=function(t,e,r){var n=this.staticResponses[t.method];"function"==typeof n?n(t,e,r):void 0!==n?setTimeout((()=>r(null,n))):e()}},8747:function(t,e,r){const n=r(7879),i=r(47),o=r(9539).inherits,s=r(1964),a=r(2843),u=r(7529),c=r(45),l=r(398),f=r(8372),h=/^[0-9A-Fa-f]+$/g;function d(t){const e=this;e.nonceLock=c(1),t.getAccounts&&(e.getAccounts=t.getAccounts),t.processTransaction&&(e.processTransaction=t.processTransaction),t.processMessage&&(e.processMessage=t.processMessage),t.processPersonalMessage&&(e.processPersonalMessage=t.processPersonalMessage),t.processTypedMessage&&(e.processTypedMessage=t.processTypedMessage),e.approveTransaction=t.approveTransaction||e.autoApprove,e.approveMessage=t.approveMessage||e.autoApprove,e.approvePersonalMessage=t.approvePersonalMessage||e.autoApprove,e.approveDecryptMessage=t.approveDecryptMessage||e.autoApprove,e.approveEncryptionPublicKey=t.approveEncryptionPublicKey||e.autoApprove,e.approveTypedMessage=t.approveTypedMessage||e.autoApprove,t.signTransaction&&(e.signTransaction=t.signTransaction||v("signTransaction")),t.signMessage&&(e.signMessage=t.signMessage||v("signMessage")),t.signPersonalMessage&&(e.signPersonalMessage=t.signPersonalMessage||v("signPersonalMessage")),t.decryptMessage&&(e.decryptMessage=t.decryptMessage||v("decryptMessage")),t.encryptionPublicKey&&(e.encryptionPublicKey=t.encryptionPublicKey||v("encryptionPublicKey")),t.signTypedMessage&&(e.signTypedMessage=t.signTypedMessage||v("signTypedMessage")),t.recoverPersonalSignature&&(e.recoverPersonalSignature=t.recoverPersonalSignature),t.publishTransaction&&(e.publishTransaction=t.publishTransaction),e.estimateGas=t.estimateGas||e.estimateGas,e.getGasPrice=t.getGasPrice||e.getGasPrice}function p(t){return t.toLowerCase()}function m(t){const e=s.addHexPrefix(t);return s.isValidAddress(e)}function g(t){const e=s.addHexPrefix(t);return!s.isValidAddress(e)&&y(t)}function y(t){if(!("string"==typeof t))return!1;if(!("0x"===t.slice(0,2)))return!1;return t.slice(2).match(h)}function v(t){return function(e,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+t+'" fn in constructor options'))}}t.exports=d,o(d,l),d.prototype.handleRequest=function(t,e,r){const i=this;let o,s,a,c,l;switch(i._parityRequests={},i._parityRequestCount=0,t.method){case"eth_coinbase":return void i.getAccounts((function(t,e){if(t)return r(t);let n=e[0]||null;r(null,n)}));case"eth_accounts":return void i.getAccounts((function(t,e){if(t)return r(t);r(null,e)}));case"eth_sendTransaction":return o=t.params[0],void n([t=>i.validateTransaction(o,t),t=>i.processTransaction(o,t)],r);case"eth_signTransaction":return o=t.params[0],void n([t=>i.validateTransaction(o,t),t=>i.processSignTransaction(o,t)],r);case"eth_sign":return l=t.params[0],c=t.params[1],a=t.params[2]||{},s=u(a,{from:l,data:c}),void n([t=>i.validateMessage(s,t),t=>i.processMessage(s,t)],r);case"personal_sign":return function(){const e=t.params[0];if(g(t.params[1])&&m(e)){let e="The eth_personalSign method requires params ordered ";e+="[message, address]. This was previously handled incorrectly, ",e+="and has been corrected automatically. ",e+="Please switch this param order for smooth behavior in the future.",console.warn(e),l=t.params[0],c=t.params[1]}else c=t.params[0],l=t.params[1];a=t.params[2]||{},s=u(a,{from:l,data:c}),n([t=>i.validatePersonalMessage(s,t),t=>i.processPersonalMessage(s,t)],r)}();case"eth_decryptMessage":return function(){const e=t.params[0];if(g(t.params[1])&&m(e)){let e="The eth_decryptMessage method requires params ordered ";e+="[message, address]. This was previously handled incorrectly, ",e+="and has been corrected automatically. ",e+="Please switch this param order for smooth behavior in the future.",console.warn(e),l=t.params[0],c=t.params[1]}else c=t.params[0],l=t.params[1];a=t.params[2]||{},s=u(a,{from:l,data:c}),n([t=>i.validateDecryptMessage(s,t),t=>i.processDecryptMessage(s,t)],r)}();case"encryption_public_key":return function(){const e=t.params[0];n([t=>i.validateEncryptionPublicKey(e,t),t=>i.processEncryptionPublicKey(e,t)],r)}();case"personal_ecRecover":return function(){c=t.params[0];let e=t.params[1];a=t.params[2]||{},s=u(a,{sig:e,data:c}),i.recoverPersonalSignature(s,r)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){const e=t.params[0],o=t.params[1];m(e)?(l=e,c=o):(c=e,l=o),a=t.params[2]||{},s=u(a,{from:l,data:c}),n([t=>i.validateTypedMessage(s,t),t=>i.processTypedMessage(s,t)],r)}();case"parity_postTransaction":return o=t.params[0],void i.parityPostTransaction(o,r);case"parity_postSign":return l=t.params[0],c=t.params[1],void i.parityPostSign(l,c,r);case"parity_checkRequest":return function(){const e=t.params[0];i.parityCheckRequest(e,r)}();case"parity_defaultAccount":return void i.getAccounts((function(t,e){if(t)return r(t);const n=e[0]||null;r(null,n)}));default:return void e()}},d.prototype.getAccounts=function(t){t(null,[])},d.prototype.processTransaction=function(t,e){const r=this;n([e=>r.approveTransaction(t,e),(t,e)=>r.checkApproval("transaction",t,e),e=>r.finalizeAndSubmitTx(t,e)],e)},d.prototype.processSignTransaction=function(t,e){const r=this;n([e=>r.approveTransaction(t,e),(t,e)=>r.checkApproval("transaction",t,e),e=>r.finalizeTx(t,e)],e)},d.prototype.processMessage=function(t,e){const r=this;n([e=>r.approveMessage(t,e),(t,e)=>r.checkApproval("message",t,e),e=>r.signMessage(t,e)],e)},d.prototype.processPersonalMessage=function(t,e){const r=this;n([e=>r.approvePersonalMessage(t,e),(t,e)=>r.checkApproval("message",t,e),e=>r.signPersonalMessage(t,e)],e)},d.prototype.processDecryptMessage=function(t,e){const r=this;n([e=>r.approveDecryptMessage(t,e),(t,e)=>r.checkApproval("decryptMessage",t,e),e=>r.decryptMessage(t,e)],e)},d.prototype.processEncryptionPublicKey=function(t,e){const r=this;n([e=>r.approveEncryptionPublicKey(t,e),(t,e)=>r.checkApproval("encryptionPublicKey",t,e),e=>r.encryptionPublicKey(t,e)],e)},d.prototype.processTypedMessage=function(t,e){const r=this;n([e=>r.approveTypedMessage(t,e),(t,e)=>r.checkApproval("message",t,e),e=>r.signTypedMessage(t,e)],e)},d.prototype.autoApprove=function(t,e){e(null,!0)},d.prototype.checkApproval=function(t,e,r){r(e?null:new Error("User denied "+t+" signature."))},d.prototype.parityPostTransaction=function(t,e){const r=this,n=`0x${r._parityRequestCount.toString(16)}`;r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[t]},(function(t,e){if(t)return void(r._parityRequests[n]={error:t});const i=e.result;r._parityRequests[n]=i})),e(null,n)},d.prototype.parityPostSign=function(t,e,r){const n=this,i=`0x${n._parityRequestCount.toString(16)}`;n._parityRequestCount++,n.emitPayload({method:"eth_sign",params:[t,e]},(function(t,e){if(t)return void(n._parityRequests[i]={error:t});const r=e.result;n._parityRequests[i]=r})),r(null,i)},d.prototype.parityCheckRequest=function(t,e){const r=this._parityRequests[t]||null;return r?r.error?e(r.error):void e(null,r):e(null,null)},d.prototype.recoverPersonalSignature=function(t,e){let r;try{r=a.recoverPersonalSignature(t)}catch(n){return e(n)}e(null,r)},d.prototype.validateTransaction=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign transaction."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error(`Unknown address - unable to sign transaction for this address: "${t.from}"`))}))},d.prototype.validateMessage=function(t,e){if(void 0===t.from)return e(new Error("Undefined address - from address required to sign message."));this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error(`Unknown address - unable to sign message for this address: "${t.from}"`))}))},d.prototype.validatePersonalMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign personal message.")):void 0===t.data?e(new Error("Undefined message - message required to sign personal message.")):y(t.data)?void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error(`Unknown address - unable to sign message for this address: "${t.from}"`))})):e(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},d.prototype.validateDecryptMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to decrypt message.")):void 0===t.data?e(new Error("Undefined message - message required to decrypt message.")):y(t.data)?void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error(`Unknown address - unable to decrypt message for this address: "${t.from}"`))})):e(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},d.prototype.validateEncryptionPublicKey=function(t,e){this.validateSender(t,(function(r,n){return r?e(r):n?void e():e(new Error(`Unknown address - unable to obtain encryption public key for this address: "${t}"`))}))},d.prototype.validateTypedMessage=function(t,e){return void 0===t.from?e(new Error("Undefined address - from address required to sign typed data.")):void 0===t.data?e(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(t.from,(function(r,n){return r?e(r):n?void e():e(new Error(`Unknown address - unable to sign message for this address: "${t.from}"`))}))},d.prototype.validateSender=function(t,e){if(!t)return e(null,!1);this.getAccounts((function(r,n){if(r)return e(r);const i=-1!==n.map(p).indexOf(t.toLowerCase());e(null,i)}))},d.prototype.finalizeAndSubmitTx=function(t,e){const r=this;r.nonceLock.take((function(){n([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(t,n){if(r.nonceLock.leave(),t)return e(t);e(null,n)}))}))},d.prototype.finalizeTx=function(t,e){const r=this;r.nonceLock.take((function(){n([r.fillInTxExtras.bind(r,t),r.signTransaction.bind(r)],(function(n,i){if(r.nonceLock.leave(),n)return e(n);e(null,{raw:i,tx:t})}))}))},d.prototype.publishTransaction=function(t,e){this.emitPayload({method:"eth_sendRawTransaction",params:[t]},(function(t,r){if(t)return e(t);e(null,r.result)}))},d.prototype.estimateGas=function(t,e){f(this.engine,t,e)},d.prototype.getGasPrice=function(t){this.emitPayload({method:"eth_gasPrice",params:[]},(function(e,r){if(e)return t(e);t(null,r.result)}))},d.prototype.fillInTxExtras=function(t,e){const r=this,n=t.from,o={};void 0===t.gasPrice&&(o.gasPrice=r.getGasPrice.bind(r)),void 0===t.nonce&&(o.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[n,"pending"]})),void 0===t.gas&&(o.gas=r.estimateGas.bind(r,function(t){return{from:t.from,to:t.to,value:t.value,data:t.data,gas:t.gas,gasPrice:t.gasPrice,nonce:t.nonce}}(t))),i(o,(function(r,n){if(r)return e(r);const i={};n.gasPrice&&(i.gasPrice=n.gasPrice),n.nonce&&(i.nonce=n.nonce.result),n.gas&&(i.gas=n.gas),e(null,u(t,i))}))}},6403:function(t,e,r){const n=r(398);t.exports=class extends n{constructor(t){if(super(),!t)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");this._constructorFn=t}setEngine(t){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");const e=t._blockTracker,r=this._constructorFn({engine:t,provider:t,blockTracker:e});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!=typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}handleRequest(t,e,r){const n={id:t.id};this.middleware(t,n,(function(t){e(((e,r,i)=>{e?(delete n.result,n.error={message:e.message||e}):n.result=r,t?t(i):i()}))}),(function(t){if(t)return r(t);r(null,n.result)}))}}},3621:function(t,e,r){var n=r(8764).Buffer;const i=r(9539).inherits,o=r(9847),s=r(1964),a=r(398),u=r(6496).blockTagForPayload;function c(t){this.nonceCache={}}t.exports=c,i(c,a),c.prototype.handleRequest=function(t,e,r){const i=this;switch(t.method){case"eth_getTransactionCount":var a=u(t),c=t.params[0].toLowerCase(),l=i.nonceCache[c];return void("pending"===a?l?r(null,l):e((function(t,e,r){if(t)return r();void 0===i.nonceCache[c]&&(i.nonceCache[c]=e),r()})):e());case"eth_sendRawTransaction":return void e((function(e,r,a){if(e)return a();var u=t.params[0],c=(s.stripHexPrefix(u),n.from(s.stripHexPrefix(u),"hex"),new o(n.from(s.stripHexPrefix(u),"hex"))),l="0x"+c.getSenderAddress().toString("hex").toLowerCase(),f=s.bufferToInt(c.nonce),h=(++f).toString(16);h.length%2&&(h="0"+h),h="0x"+h,i.nonceCache[l]=h,a()}));case"evm_revert":return i.nonceCache={},void e();default:return void e()}}},398:function(t,e,r){const n=r(9728);function i(){}t.exports=i,i.prototype.setEngine=function(t){const e=this;e.engine||(e.engine=t,t.on("block",(function(t){e.currentBlock=t})),t.on("start",(function(){e.start()})),t.on("stop",(function(){e.stop()})))},i.prototype.handleRequest=function(t,e,r){throw new Error("Subproviders should override `handleRequest`.")},i.prototype.emitPayload=function(t,e){this.engine.sendAsync(n(t),e)},i.prototype.stop=function(){},i.prototype.start=function(){}},8191:function(t,e,r){const n=r(6403),i=r(8961);t.exports=class extends n{constructor(){super((({blockTracker:t,provider:e,engine:r})=>{const{events:n,middleware:o}=i({blockTracker:t,provider:e});return n.on("notification",(t=>r.emit("data",null,t))),o}))}}},9728:function(t,e,r){const n=r(8620),i=r(7529);t.exports=function(t){return i({id:n(),jsonrpc:"2.0",params:[]},t)}},8372:function(t,e,r){const n=r(9728);t.exports=function(t,e,r){t.sendAsync(n({method:"eth_estimateGas",params:[e]}),(function(t,e){if(t)return"no contract code at given address"===t.message?r(null,"0xcf08"):r(t);r(null,e.result)}))}},8620:function(t){t.exports=function(){return Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}},6496:function(t,e,r){const n=r(7266);function i(t){return"never"!==a(t)}function o(t){var e=s(t);return e>=t.params.length?t.params:"eth_getBlockByNumber"===t.method?t.params.slice(1):t.params.slice(0,e)}function s(t){switch(t.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function a(t){switch(t.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}t.exports={cacheIdentifierForPayload:function(t,e={}){if(!i(t))return null;const{includeBlockRef:r}=e,s=r?t.params:o(t);return t.method+":"+n(s)},canCache:i,blockTagForPayload:function(t){var e=s(t);if(e>=t.params.length)return null;return t.params[e]},paramsWithoutBlockTag:o,blockTagParamIndex:s,cacheTypeForPayload:a}},2698:function(t,e,r){const n=r(7187).EventEmitter,i=r(9539).inherits;function o(){n.call(this),this.isLocked=!0}t.exports=o,i(o,n),o.prototype.go=function(){this.isLocked=!1,this.emit("unlock")},o.prototype.stop=function(){this.isLocked=!0,this.emit("lock")},o.prototype.await=function(t){const e=this;e.isLocked?e.once("unlock",t):setTimeout(t)}},6430:function(t,e,r){"use strict";var n=r(4029),i=r(3083),o=r(1924),s=r(5275),a=o("Object.prototype.toString"),u=r(6410)(),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),f=o("String.prototype.slice"),h={},d=Object.getPrototypeOf;u&&s&&d&&n(l,(function(t){if("function"==typeof c[t]){var e=new c[t];if(Symbol.toStringTag in e){var r=d(e),n=s(r,Symbol.toStringTag);if(!n){var i=d(r);n=s(i,Symbol.toStringTag)}h[t]=n.get}}}));var p=r(5692);t.exports=function(t){return!!p(t)&&(u&&Symbol.toStringTag in t?function(t){var e=!1;return n(h,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(o){}})),e}(t):f(a(t),8,-1))}},8355:function(t,e){"use strict";var r,n=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(Error);e.SecurityError=i;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(Error);e.InvalidStateError=o;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(Error);e.NetworkError=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(Error);e.SyntaxError=a},9536:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(6763));var n=r(335);e.XMLHttpRequestEventTarget=n.XMLHttpRequestEventTarget},7296:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){this.type=t,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0};e.ProgressEvent=r},335:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.listeners={}}return t.prototype.addEventListener=function(t,e){t=t.toLowerCase(),this.listeners[t]=this.listeners[t]||[],this.listeners[t].push(e.handleEvent||e)},t.prototype.removeEventListener=function(t,e){if(t=t.toLowerCase(),this.listeners[t]){var r=this.listeners[t].indexOf(e.handleEvent||e);r<0||this.listeners[t].splice(r,1)}},t.prototype.dispatchEvent=function(t){var e=t.type.toLowerCase();if(t.target=this,this.listeners[e])for(var r=0,n=this.listeners[e];r=0)return this._url=this._parseUrl(r.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=r,this._response.on("data",(function(t){return n._onHttpResponseData(r,t)})),this._response.on("end",(function(){return n._onHttpResponseEnd(r)})),this._response.on("close",(function(){return n._onHttpResponseClose(r)})),this.responseUrl=this._url.href.split("#")[0],this.status=r.statusCode,this.statusText=a.STATUS_CODES[this.status],this._parseResponseHeaders(r);var i=this._responseHeaders["content-length"]||"";this._totalBytes=+i,this._lengthComputable=!!i,this._setReadyState(e.HEADERS_RECEIVED)}},e.prototype._onHttpResponseData=function(t,r){this._response===t&&(this._responseParts.push(new i(r)),this._loadedBytes+=r.length,this.readyState!==e.LOADING&&this._setReadyState(e.LOADING),this._dispatchProgress("progress"))},e.prototype._onHttpResponseEnd=function(t){this._response===t&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(e.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},e.prototype._onHttpResponseClose=function(t){if(this._response===t){var r=this._request;this._setError(),r.abort(),this._setReadyState(e.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},e.prototype._onHttpTimeout=function(t){this._request===t&&(this._setError(),t.abort(),this._setReadyState(e.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},e.prototype._onHttpRequestError=function(t,r){this._request===t&&(this._setError(),t.abort(),this._setReadyState(e.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},e.prototype._dispatchProgress=function(t){var r=new e.ProgressEvent(t);r.lengthComputable=this._lengthComputable,r.loaded=this._loadedBytes,r.total=this._totalBytes,this.dispatchEvent(r)},e.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},e.prototype._parseUrl=function(t,e,r){var n=null==this.nodejsBaseUrl?t:l.resolve(this.nodejsBaseUrl,t),i=l.parse(n,!1,!0);i.hash=null;var o=(i.auth||"").split(":"),s=o[0],a=o[1];return(s||a||e||r)&&(i.auth=(e||s||"")+":"+(r||a||"")),i},e.prototype._parseResponseHeaders=function(t){for(var e in this._responseHeaders={},t.headers){var r=e.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=t.headers[e])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},e.prototype._parseResponse=function(){var t=i.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(t.toString("utf-8"))}catch(o){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=t);case"arraybuffer":this.responseText=null;for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),n=0;n