/*! For license information please see reachsdk.min.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.reachsdk=e():t.reachsdk=e()}(self,(()=>(()=>{var __webpack_modules__={9847: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(t){}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<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=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<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=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,f=r;f<a;f+=n)u=c(t,f,f+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","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],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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?f[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=l[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:f[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),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[o-a-1]=s}return c},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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,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<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 E(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 b={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 w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(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){E.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():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<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(_,y),i(A,y),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;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 A}return b[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.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")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.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)},E.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},E.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)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,E),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)},9502:function(t){"use strict";!function(e){function r(t){return parseInt(t)===t}function n(t){if(!r(t.length))return!1;for(var e=0;e<t.length;e++)if(!r(t[e])||t[e]<0||t[e]>255)return!1;return!0}function i(t,e){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return e&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw new Error("Array contains invalid value: "+t);return new Uint8Array(t)}if(r(t.length)&&n(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function o(t){return new Uint8Array(t)}function s(t,e,r,n,i){null==n&&null==i||(t=t.slice?t.slice(n,i):Array.prototype.slice.call(t,n,i)),e.set(t,r)}var a,u={toBytes:function(t){var e=[],r=0;for(t=encodeURI(t);r<t.length;){var n=t.charCodeAt(r++);37===n?(e.push(parseInt(t.substr(r,2),16)),r+=2):e.push(n)}return i(e)},fromBytes:function(t){for(var e=[],r=0;r<t.length;){var n=t[r];n<128?(e.push(String.fromCharCode(n)),r++):n>191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&t[r+1])),r+=2):(e.push(String.fromCharCode((15&n)<<12|(63&t[r+1])<<6|63&t[r+2])),r+=3)}return e.join("")}},c=(a="0123456789abcdef",{toBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},fromBytes:function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];e.push(a[(240&n)>>4]+a[15&n])}return e.join("")}}),f={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],g=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],w=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],_=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],E=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],S=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],M=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function x(t){for(var e=[],r=0;r<t.length;r+=4)e.push(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]);return e}var k=function(t){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(t,!0)}),this._prepare()};k.prototype._prepare=function(){var t=f[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(t+1),i=this.key.length/4,o=x(this.key);for(e=0;e<i;e++)r=e>>2,this._Ke[r][e%4]=o[e],this._Kd[t-r][e%4]=o[e];for(var s,a=0,u=i;u<n;){if(s=o[i-1],o[0]^=h[s>>16&255]<<24^h[s>>8&255]<<16^h[255&s]<<8^h[s>>24&255]^l[a]<<24,a+=1,8!=i)for(e=1;e<i;e++)o[e]^=o[e-1];else{for(e=1;e<i/2;e++)o[e]^=o[e-1];for(s=o[i/2-1],o[i/2]^=h[255&s]^h[s>>8&255]<<8^h[s>>16&255]<<16^h[s>>24&255]<<24,e=i/2+1;e<i;e++)o[e]^=o[e-1]}for(e=0;e<i&&u<n;)c=u>>2,d=u%4,this._Ke[c][d]=o[e],this._Kd[t-c][d]=o[e++],u++}for(var c=1;c<t;c++)for(var d=0;d<4;d++)s=this._Kd[c][d],this._Kd[c][d]=A[s>>24&255]^E[s>>16&255]^S[s>>8&255]^M[255&s]},k.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,r=[0,0,0,0],n=x(t),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var s=1;s<e;s++){for(i=0;i<4;i++)r[i]=p[n[i]>>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^b[255&n[(i+3)%4]]^this._Ke[s][i];n=r.slice()}var a,u=o(16);for(i=0;i<4;i++)a=this._Ke[e][i],u[4*i]=255&(h[n[i]>>24&255]^a>>24),u[4*i+1]=255&(h[n[(i+1)%4]>>16&255]^a>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(h[255&n[(i+3)%4]]^a);return u},k.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,r=[0,0,0,0],n=x(t),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var s=1;s<e;s++){for(i=0;i<4;i++)r[i]=y[n[i]>>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^_[255&n[(i+1)%4]]^this._Kd[s][i];n=r.slice()}var a,u=o(16);for(i=0;i<4;i++)a=this._Kd[e][i],u[4*i]=255&(d[n[i]>>24&255]^a>>24),u[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^a>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^a>>8),u[4*i+3]=255&(d[255&n[(i+1)%4]]^a);return u};var T=function(t){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(t)};T.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n<t.length;n+=16)s(t,r,0,n,n+16),s(r=this._aes.encrypt(r),e,n);return e},T.prototype.decrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n<t.length;n+=16)s(t,r,0,n,n+16),s(r=this._aes.decrypt(r),e,n);return e};var I=function(t,e){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=o(16);this._lastCipherblock=i(e,!0),this._aes=new k(t)};I.prototype.encrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n<t.length;n+=16){s(t,r,0,n,n+16);for(var a=0;a<16;a++)r[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(r),s(this._lastCipherblock,e,n)}return e},I.prototype.decrypt=function(t){if((t=i(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=o(t.length),r=o(16),n=0;n<t.length;n+=16){s(t,r,0,n,n+16),r=this._aes.decrypt(r);for(var a=0;a<16;a++)e[n+a]=r[a]^this._lastCipherblock[a];s(t,this._lastCipherblock,0,n,n+16)}return e};var C=function(t,e,r){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 size)")}else e=o(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(e,!0),this._aes=new k(t)};C.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,r=i(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=e[o];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},C.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,r=i(t,!0),n=0;n<r.length;n+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=e[o];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(t,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var R=function(t,e){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",e){if(16!=e.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else e=o(16);this._lastPrecipher=i(e,!0),this._lastPrecipherIndex=16,this._aes=new k(t)};R.prototype.encrypt=function(t){for(var e=i(t,!0),r=0;r<e.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},R.prototype.decrypt=R.prototype.encrypt;var B=function(t){if(!(this instanceof B))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=o(16),this.setValue(t)):this.setBytes(t)};B.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");for(var e=15;e>=0;--e)this._counter[e]=t%256,t>>=8},B.prototype.setBytes=function(t){if(16!=(t=i(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},B.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var N=function(t,e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",e instanceof B||(e=new B(e)),this._counter=e,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(t)};N.prototype.encrypt=function(t){for(var e=i(t,!0),r=0;r<e.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[r]^=this._remainingCounter[this._remainingCounterIndex++];return e},N.prototype.decrypt=N.prototype.encrypt;var O={AES:k,Counter:B,ModeOfOperation:{ecb:T,cbc:I,cfb:C,ofb:R,ctr:N},utils:{hex:c,utf8:u},padding:{pkcs7:{pad:function(t){var e=16-(t=i(t,!0)).length%16,r=o(t.length+e);s(t,r);for(var n=t.length;n<r.length;n++)r[n]=e;return r},strip:function(t){if((t=i(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var r=t.length-e,n=0;n<e;n++)if(t[r+n]!==e)throw new Error("PKCS#7 invalid padding byte");var a=o(r);return s(t,a,0,0,r),a}}},_arrayTest:{coerceArray:i,createArray:o,copyArray:s}};t.exports=O}()},8409: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(t){}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<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=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<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=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,f=r;f<a;f+=n)u=c(t,f,f+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","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],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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?f[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=l[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:f[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),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[o-a-1]=s}return c},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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,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<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 E(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 b={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 w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(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){E.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():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<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(_,y),i(A,y),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;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 A}return b[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.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")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.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)},E.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},E.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)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,E),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)},2234:(t,e,r)=>{t.exports=r(4473)},4473:t=>{t.exports=class{constructor(t,e){this.channelName=t,this.onMessage=e,this._installListener(),this._requests=new Map,this._nextId=0,this._defaultTimeout=4e3}_installListener(){const t=this;this._listener=function(e){if(!e.data||"string"!=typeof e.data)return;let r;try{if(r=JSON.parse(e.data),!r.channel||r.channel!==t.channelName)return;if("object"!=typeof r.message)return}catch(t){return}if(void 0!==r.replyId){if("number"!=typeof r.replyId||r.replyId%1!=0)return;const e=t._requests.get(r.replyId);e&&(clearTimeout(e.timeout),t._requests.delete(r.replyId),e.resolve(r.message))}else{if("number"!=typeof r.id||r.id%1!=0||!t.onMessage)return;const n=t.channelName,i=r.id,o=e.origin,s=function(t){const r={channel:n,replyId:i,message:t};e.source.postMessage(JSON.stringify(r),o)};t.onMessage(r.message,e.origin,e.source,s,t)}},window.addEventListener("message",this._listener)}sendMessage(t,e,r,n){const i={channel:this.channelName,id:this.getNextId(),message:e};if(n&&n.waitForReply){const e=this;return new Promise((function(o,s){const a=setTimeout((function(){e._requests.get(i.id)&&(e._requests.delete(i.id),s(new Error("Timeout expired for the message response")))}),n&&n.timeout?n.timeout:e._defaultTimeout);e._requests.set(i.id,{timeout:a,resolve:o}),t.postMessage(JSON.stringify(i),r)}))}t.postMessage(JSON.stringify(i),r)}close(){window.removeEventListener("message",this._listener),this._listener=null,delete this._requests}getNextId(){return this._nextId+=1,this._nextId}}},3406:(t,e,r)=>{t.exports=r(8594)},8594:(t,e,r)=>{var n=r(2486).Buffer;const{openPopup:i}=r(823),{sleep:o,prepareTxn:s}=r(9247),a=r(3743),u=new(r(5468));t.exports=class{constructor(t){this.bridge=u,this.timeout=t&&t.timeout?t.timeout:16e5,this.url=t&&t.bridgeUrl?t.bridgeUrl:"https://wallet.myalgo.com/bridge",this.url.endsWith("/")&&(this.url=this.url.slice(0,-1)),this.currentConnectPopup=null,this.currentSigntxPopup=null,this.currentSignLogicSigPopup=null,this.options={waitForReply:!0,timeout:this.timeout},this.disableLedgerNano=!(!t||!t.disableLedgerNano)&&t.disableLedgerNano}async connect(t={shouldSelectOneAccount:!1,openManager:!1}){this.currentConnectPopup&&(this.currentConnectPopup.closed?this.currentConnectPopup=null:this.focusWindow(this.currentConnectPopup));try{this.currentConnectPopup=i(this.url+"/connect.html"),await this.waitForWindowToLoad(this.currentConnectPopup);const e=await this.bridge.sendMessage(this.currentConnectPopup,{method:"unlock",params:Object.assign(t,{disableLedgerNano:this.disableLedgerNano})},this.url,this.options);if(this.closeWindow(this.currentConnectPopup),this.currentConnectPopup=null,"error"===e.status)throw new Error(e.message);return e.data.accounts}catch(t){throw this.closeWindow(this.currentConnectPopup),this.currentConnectPopup=null,t}}async signTransaction(t){let e;this.currentSigntxPopup&&(this.currentSigntxPopup.closed?this.currentSigntxPopup=null:this.focusWindow(this.currentSigntxPopup)),e=Array.isArray(t)?Array.from(t).map((t=>s(t))):s(t);try{this.currentSigntxPopup=i(this.url+"/signtx.html"),await this.waitForWindowToLoad(this.currentSigntxPopup);const t=await this.bridge.sendMessage(this.currentSigntxPopup,{method:"transaction",params:{txn:e,settings:{disableLedgerNano:this.disableLedgerNano}}},this.url,this.options);if(this.closeWindow(this.currentSigntxPopup),this.currentSigntxPopup=null,"error"===t.status)throw new Error(t.message);if(Array.isArray(t.data)){const e=[];for(const r of t.data)r.blob=new Uint8Array(n.from(r.blob,"hex")),e.push(r);return e}return t.data.blob=new Uint8Array(n.from(t.data.blob,"hex")),t.data}catch(t){throw this.closeWindow(this.currentSigntxPopup),this.currentSigntxPopup=null,t}}async signLogicSig(t,e){this.currentSignLogicSigPopup&&(this.currentSignLogicSigPopup.closed?this.currentSignLogicSigPopup=null:this.focusWindow(this.currentSignLogicSigPopup));try{this.currentSignLogicSigPopup=i(this.url+"/logicsigtx.html"),await this.waitForWindowToLoad(this.currentSignLogicSigPopup);let r=t;t.constructor===Uint8Array&&(r=n.from(t).toString("base64"));const o=await this.bridge.sendMessage(this.currentSignLogicSigPopup,{method:"logicsig",params:{logic:r,address:e}},this.url,this.options);if(this.closeWindow(this.currentSignLogicSigPopup),this.currentSignLogicSigPopup=null,"error"===o.status)throw new Error(o.message);return new Uint8Array(n.from(o.data.signedTeal,"base64"))}catch(t){throw this.closeWindow(this.currentSignLogicSigPopup),this.currentSignLogicSigPopup=null,t}}async waitForWindowToLoad(t,e=30){for(let r=0;r<e&&(await o(300),t);r++)try{if("success"==(await u.sendMessage(t,{method:"status"},this.url)).status)return}catch(t){}throw new Error(a.WINDOW_NOT_LOADED)}closeWindow(t){t&&!t.closed&&t.close&&t.close()}focusWindow(t){throw t&&t.focus?(t.focus(),new Error(a.WINDOW_IS_OPENED)):new Error(a.INVALID_WINDOW)}}},5468:(t,e,r)=>{const n=r(2234);t.exports=class{constructor(t){const e=this;this.options={waitForReply:!0,timeout:250},this.listenerCallback=t,this.bridge=new n("wallet-bridge-communication-channel",(function(t,r,n,i){e.listenerCallback&&e.listenerCallback(t,n)}))}sendMessage(t,e,r,n){return this.bridge.sendMessage(t,e,r,n||this.options)}setNewListener(t){this.listenerCallback=t}close(){this.bridge.close()}}},823:(t,e,r)=>{const{WINDOW_NOT_OPENED:n}=r(3743),i={width:400,height:600};t.exports={openPopup:function(t,e=i){let{name:r="",width:o,height:s,top:a=0,left:u=0}=e;o&&(window.outerWidth?u=Math.round((window.outerWidth-o)/2)+window.screenX:window.screen.width&&(u=Math.round((window.screen.width-o)/2))),s&&(window.outerHeight?a=Math.round((window.outerHeight-s)/2)+window.screenY:window.screen.height&&(a=Math.round((window.screen.height-s)/2))),o&&s&&(e={top:a,left:u,width:o,height:s,status:1,toolbar:0,menubar:0,resizable:1,scrollbars:1});const c=Object.keys(e).map((t=>{const r=e[t];if(null!=r&&"function"==typeof r.toString)return`${t}=${r.toString()}`})).filter(Boolean).join(",");let f;try{f=window.open(t,r,c)}catch(t){throw new Error(`${n} - ${t.stack||t.message}`)}if(!f||window.closed)throw new Error(`${n} - blocked`);return f}}},3743:t=>{t.exports={WINDOW_NOT_LOADED:"Window not loaded",WINDOW_IS_OPENED:"Windows is opened",WINDOW_NOT_OPENED:"Can not open popup window",INVALID_WINDOW:"Invalid window"}},9247:(t,e,r)=>{var n=r(2486).Buffer;t.exports={sleep:function(t=200){return new Promise((e=>setTimeout(e,t)))},prepareTxn:function(t){if(t.constructor===Uint8Array)return n.from(t).toString("base64");if("string"==typeof t)return t;const e=Object.assign({},t);if(e.note&&e.note.constructor===Uint8Array&&(e.note=n.from(e.note).toString("base64")),e.assetMetadataHash&&e.assetMetadataHash.constructor===Uint8Array&&(e.assetMetadataHash=n.from(e.assetMetadataHash).toString("base64")),e.group&&e.group.constructor===Uint8Array&&(e.group=n.from(e.group).toString("base64")),"appl"===e.type&&e.appApprovalProgram&&e.appApprovalProgram.constructor===Uint8Array&&(e.appApprovalProgram=n.from(e.appApprovalProgram).toString("base64")),"appl"===e.type&&e.appClearProgram&&e.appClearProgram.constructor===Uint8Array&&(e.appClearProgram=n.from(e.appClearProgram).toString("base64")),"appl"===e.type&&e.appArgs&&e.appArgs.length>0)for(let t=0;t<e.appArgs.length;t++)e.appArgs[t].constructor===Uint8Array&&(e.appArgs[t]=n.from(e.appArgs[t]).toString("base64"));return e}}},2034:(t,e,r)=>{"use strict";r.r(e),r.d(e,{detectEnv:()=>p,detectOS:()=>m,formatIOSMobile:()=>F,formatMobileRegistry:()=>$,formatMobileRegistryEntry:()=>V,getClientMeta:()=>N,getCrypto:()=>C,getCryptoOrThrow:()=>I,getDappRegistryUrl:()=>W,getDocument:()=>S,getDocumentOrThrow:()=>E,getFromWindow:()=>_,getFromWindowOrThrow:()=>A,getLocal:()=>L,getLocalStorage:()=>B,getLocalStorageOrThrow:()=>R,getLocation:()=>T,getLocationOrThrow:()=>k,getMobileLinkRegistry:()=>H,getMobileRegistryEntry:()=>z,getNavigator:()=>x,getNavigatorOrThrow:()=>M,getWalletRegistryUrl:()=>G,isAndroid:()=>g,isBrowser:()=>w,isIOS:()=>b,isMobile:()=>y,isNode:()=>v,mobileLinkChoiceKey:()=>j,removeLocal:()=>U,safeJsonParse:()=>O,safeJsonStringify:()=>P,saveMobileLinkInfo:()=>q,setLocal:()=>D});var n=r(3212),i=r(1958),o=function(t,e,r){this.name=t,this.version=e,this.os=r,this.type="browser"},s=function(t){this.version=t,this.type="node",this.name="node",this.os=process.platform},a=function(t,e,r,n){this.name=t,this.version=e,this.os=r,this.bot=n,this.type="bot-device"},u=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},c=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},f=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,l=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],h=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function d(t){var e=function(t){return""!==t&&l.reduce((function(e,r){var n=r[0],i=r[1];if(e)return e;var o=i.exec(t);return!!o&&[n,o]}),!1)}(t);if(!e)return null;var r=e[0],n=e[1];if("searchbot"===r)return new u;var i=n[1]&&n[1].split(/[._]/).slice(0,3);i?i.length<3&&(i=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),i=0;for(e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}(i,function(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}(3-i.length))):i=[];var s=i.join("."),c=function(t){for(var e=0,r=h.length;e<r;e++){var n=h[e],i=n[0];if(n[1].exec(t))return i}return null}(t),d=f.exec(t);return d&&d[1]?new a(r,s,c,d[1]):new o(r,s,c)}function p(t){return function(t){return t?d(t):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new c:"undefined"!=typeof navigator?d(navigator.userAgent):"undefined"!=typeof process&&process.version?new s(process.version.slice(1)):null}(t)}function m(){const t=p();return t&&t.os?t.os:void 0}function g(){const t=m();return!!t&&t.toLowerCase().includes("android")}function b(){const t=m();return!!t&&(t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1)}function y(){return!!m()&&(g()||b())}function v(){const t=p();return!(!t||!t.name)&&"node"===t.name.toLowerCase()}function w(){return!v()&&!!x()}const _=i.getFromWindow,A=i.getFromWindowOrThrow,E=i.getDocumentOrThrow,S=i.getDocument,M=i.getNavigatorOrThrow,x=i.getNavigator,k=i.getLocationOrThrow,T=i.getLocation,I=i.getCryptoOrThrow,C=i.getCrypto,R=i.getLocalStorageOrThrow,B=i.getLocalStorage;function N(){return n.D()}const O=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}},P=function(t){return"string"==typeof t?t:JSON.stringify(t)};function D(t,e){const r=P(e),n=B();n&&n.setItem(t,r)}function L(t){let e=null,r=null;const n=B();return n&&(r=n.getItem(t)),e=r?O(r):r,e}function U(t){const e=B();e&&e.removeItem(t)}const j="WALLETCONNECT_DEEPLINK_CHOICE";function F(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 q(t){const e=t.href.split("?")[0];D(j,Object.assign(Object.assign({},t),{href:e}))}function z(t,e){return t.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())))[0]}function H(t,e){let r=t;return e&&(r=e.map((e=>z(t,e))).filter(Boolean)),r}const K="https://registry.walletconnect.com";function G(){return K+"/api/v2/wallets"}function W(){return K+"/api/v2/dapps"}function V(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 $(t,e="mobile"){return Object.values(t).filter((t=>!!t[e].universal||!!t[e].native)).map((t=>V(t,e)))}},8849:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>Q});var n={};r.r(n),r.d(n,{decrypt:()=>Z,encrypt:()=>J,generateKey:()=>X,verifyHmac:()=>Y});var i=r(2034);const o=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],s=["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"];var a=r(9611),u=r.n(a),c=(r(7811),r(4243)),f=r.n(c),l=r(2486).Buffer;const h="utf8";function d(t){return new Uint8Array(t)}function p(t,e=!1){const r=t.toString("hex");return e?A(r):r}function m(t){return f()(t)}function g(t,e=!1){return p(m(t),e)}function b(t){return m(t).toString(h)}function y(t){return d(function(t){return l.from(_(t),"hex")}(t))}function v(t){return l.from(t,h)}function w(...t){let e=[];return t.forEach((t=>e=e.concat(Array.from(t)))),new Uint8Array([...e])}function _(t){return t.replace(/^0x/,"")}function A(t){return t.startsWith("0x")?t:`0x${t}`}function E(t){return(t=function(t,e=8,r="0"){return function(t,e,r="0"){return function(t,e,r,n="0"){const i=e-t.length;let o=t;if(i>0){const e=n.repeat(i);o=r?e+t:t+e}return o}(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)}(t=_(t),2))&&(t=A(t)),t}function S(t){return m(new Uint8Array(t))}function M(t,e){const r=_(E(new(u())(t).toString(16)));return e?r:A(r)}var x=r(583),k=r(8798);function T(t){return E(t)}const I=function(){return Date.now()*Math.pow(10,3)+Math.floor(Math.random()*Math.pow(10,3))};function C(){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 R(t,e){return function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}(t,e)}function B(t){return void 0!==t.result}function N(t){return void 0!==t.error}function O(t){return void 0!==t.event}function P(t){var e,r;return(e=t)&&e.length&&!R(t[0])&&(t[0]=function(t,e=!1){return p(v(t),e)}(t[0],!r)),t}function D(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!==function(t){t=_(t.toLowerCase());const e=_((0,x.keccak_256)(v(t)));let r="";for(let n=0;n<t.length;n++)parseInt(e[n],16)>7?r+=t[n].toUpperCase():r+=t[n];return A(r)}(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))&&(R(t)?"string"==typeof t&&(e=T(t)):e=M(t)),"string"==typeof e&&(e=function(t){const e=t.startsWith("0x");return t=(t=_(t)).startsWith("0")?t.substring(1):t,e?A(t):t}(A(e))),e}const n={from:T(t.from),to:void 0===t.to?"":T(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?"":T(t.data)||"0x"},i=["gasPrice","gas","value","nonce"];return Object.keys(n).forEach((t=>{!n[t].trim().length&&i.includes(t)&&delete n[t]})),n}var L=r(6575);function U(t){return L.parse(t)}const j=void 0!==r.g.WebSocket?r.g.WebSocket:r(286),F="Session currently connected",q="Session currently disconnected",z="JSON RPC response format is invalid",H="User close QRCode Modal",K="abcdefghijklmnopqrstuvwxyz0123456789".split("").map((t=>`https://${t}.bridge.walletconnect.org`));const G="AES-CBC",W="HMAC";async function V(t,e="AES-CBC"){return k.getSubtleCrypto().importKey("raw",t,function(t){return t===G?{length:256,name:G}:{hash:{name:"SHA-256"},name:W}}(e),!0,function(t){return t===G?["encrypt","decrypt"]:["sign","verify"]}(e))}async function $(t,e){const r=await async function(t,e){const r=k.getSubtleCrypto(),n=await V(t,W),i=await r.sign({length:256,name:W},n,e);return new Uint8Array(i)}(t,e);return r}async function X(t){const e=function(t){return k.getBrowerCrypto().getRandomValues(new Uint8Array(t))}((t||256)/8);return d(m(e)).buffer}async function Y(t,e){const r=y(t.data),n=y(t.iv),i=g(y(t.hmac),!1),o=w(r,n),s=g(await $(e,o),!1);return _(i)===_(s)}async function J(t,e,r){const n=d(S(e)),i=d(S(r||await X(128))),o=g(i,!1),s=d(v(JSON.stringify(t))),a=await function(t,e,r){return async function(t,e,r){const n=k.getSubtleCrypto(),i=await V(e,G),o=await n.encrypt({iv:t,name:G},i,r);return new Uint8Array(o)}(t,e,r)}(i,n,s),u=g(a,!1),c=w(a,i);return{data:u,hmac:g(await $(n,c),!1),iv:o}}async function Z(t,e){const r=d(S(e));if(!r)throw new Error("Missing key: required for decryption");if(!await Y(t,r))return null;const n=y(t.data),i=y(t.iv),o=b(await function(t,e,r){return async function(t,e,r){const n=k.getSubtleCrypto(),i=await V(e,G),o=await n.decrypt({iv:t,name:G},i,r);return new Uint8Array(o)}(t,e,r)}(i,r,n));let s;try{s=JSON.parse(o)}catch(t){return null}return s}const Q=class extends 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 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:B(t)||N(t)?`response:${t.id}`:O(t)?t.event:"",e&&(r=this._eventEmitters.filter((t=>t.event===e))),r&&r.length||function(t){return o.includes(t)||t.startsWith("wc_")}(e)||O(e)||(r=this._eventEmitters.filter((t=>"call_request"===t.event))),r.forEach((e=>{if(N(t)){const r=new Error(t.error.message);e.callback(r,null)}else e.callback(null,t)}))}},this._clientMeta=(0,i.getClientMeta)()||t.connectorOpts.clientMeta||null,this._cryptoLib=t.cryptoLib,this._sessionStorage=t.sessionStorage||new class{constructor(t="walletconnect"){this.storageId=t}getSession(){let t=null;const e=(0,i.getLocal)(this.storageId);return e&&void 0!==e.bridge&&(t=e),t}setSession(t){return(0,i.setLocal)(this.storageId,t),t}removeSession(){(0,i.removeLocal)(this.storageId)}}(t.connectorOpts.storageId),this._qrcodeModal=t.connectorOpts.qrcodeModal,this._qrcodeModalOptions=t.connectorOpts.qrcodeModalOptions,this._signingMethods=[...s,...t.connectorOpts.signingMethods||[]],!t.connectorOpts.bridge&&!t.connectorOpts.uri&&!t.connectorOpts.session)throw new Error("Missing one of the required parameters: bridge / uri / session");var e;t.connectorOpts.bridge&&(this.bridge=function(t){return"walletconnect.org"===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)}(e=t.connectorOpts.bridge)?K[Math.floor(Math.random()*K.length)]:e),t.connectorOpts.uri&&(this.uri=t.connectorOpts.uri);const r=t.connectorOpts.session||this._getStorageSession();r&&(this.session=r),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=t.transport||new 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 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()}))}},!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,o;const s=(t.startsWith("https")?t.replace("https","wss"):t.startsWith("http")?t.replace("http","ws"):t).split("?"),a=(0,i.isBrowser)()?{protocol:e,version:r,env:"browser",host:(null===(n=(0,i.getLocation)())||void 0===n?void 0:n.host)||""}:{protocol:e,version:r,env:(null===(o=(0,i.detectEnv)())||void 0===o?void 0:o.name)||""},u=function(t,e){let r=U(t);return r=Object.assign(Object.assign({},r),e),t=function(t){return L.stringify(t)}(r),t}(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 j(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(t){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=[]}}({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=y(t).buffer;this._key=e}get key(){return this._key?(t=this._key,!0,g(new Uint8Array(t),!1)):"";var t}set clientId(t){t&&(this._clientId=t)}get clientId(){let t=this._clientId;return t||(t=this._clientId=C()),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,i.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=C(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(()=>{throw new Error(H)}));const r=()=>{this.killSession()};try{const t=await this._sendCallRequest(e);return t&&r(),t}catch(t){throw r(),t}}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(H)))),this.on("connect",((r,n)=>{if(r)return e(r);t(n.params[0])}))})))}async createSession(t){if(this._connected)throw new Error(F);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=C(),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(F);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(F);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(q);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(q);const e=D(t),r=this._formatRequest({method:"eth_sendTransaction",params:[e]});return await this._sendCallRequest(r)}async signTransaction(t){if(!this._connected)throw new Error(q);const e=D(t),r=this._formatRequest({method:"eth_signTransaction",params:[e]});return await this._sendCallRequest(r)}async signMessage(t){if(!this._connected)throw new Error(q);const e=this._formatRequest({method:"eth_sign",params:t});return await this._sendCallRequest(e)}async signPersonalMessage(t){if(!this._connected)throw new Error(q);t=P(t);const e=this._formatRequest({method:"personal_sign",params:t});return await this._sendCallRequest(e)}async signTypedData(t){if(!this._connected)throw new Error(q);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(q);switch(t.method){case"eth_accounts":return this.accounts;case"eth_chainId":return M(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":t.params&&(t.params[0]=D(t.params[0]));break;case"personal_sign":t.params&&(t.params=P(t.params))}const r=this._formatRequest(t);return await this._sendCallRequest(r,e)}approveRequest(t){if(!B(t))throw new Error('JSON-RPC success response must include "result" field');{const e=this._formatResponse(t);this._sendResponse(e)}}rejectRequest(t){if(!N(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),a=void 0!==(null==e?void 0:e.forcePushNotification)?!e.forcePushNotification:function(t){return!!t.method.startsWith("wc_")||!s.includes(t.method)}(r);this._transport.send(o,i,a)}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?I():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(N(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}return{code:r,message:e}}(t.error);return Object.assign(Object.assign(Object.assign({},e),t),{error:r})}if(B(t))return Object.assign(Object.assign({},e),t);throw new Error(z)}_handleSessionDisconnect(t){const e=t||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),(0,i.removeLocal)(i.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(t){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):r.result?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):n.result?e(n.result):n.error&&n.error.message?r(new Error(n.error.message)):r(new Error(z))}))}))}_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,i.isMobile)()&&this._signingMethods.includes(r.method)){const t=(0,i.getLocal)(i.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=U(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(){return this._cryptoLib?await this._cryptoLib.generateKey():null}async _encrypt(t){const e=this._key;return this._cryptoLib&&e?await this._cryptoLib.encrypt(t,e):null}async _decrypt(t){const e=this._key;return this._cryptoLib&&e?await this._cryptoLib.decrypt(t,e):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")}}))}}{constructor(t,e){super({cryptoLib:n,connectorOpts:t,pushServerOpts:e})}}},6313:(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()}},5084:(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()}},8798: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||e.hasOwnProperty(r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6313),e),i(r(5084),e)},1958:(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")}},3212:(t,e,r)=>{"use strict";e.D=void 0;const n=r(1958);e.D=function(){let t,e;try{t=n.getDocumentOrThrow(),e=n.getLocationOrThrow()}catch(t){return null}function r(...e){const r=t.getElementsByTagName("meta");for(let t=0;t<r.length;t++){const n=r[t],i=["itemprop","property","name"].map((t=>n.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<r.length;t++){const i=r[t],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-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}}},3882:(t,e,r)=>{function n(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var i=r(2034),o=n(r(2366)),s=n(r(7447)),a=r(5473),u="walletconnect-wrapper",c="walletconnect-style-sheet",f="walletconnect-qrcode-modal",l="walletconnect-qrcode-text";function h(t){return a.createElement("div",{className:"walletconnect-modal__header"},a.createElement("img",{src:"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",className:"walletconnect-modal__headerLogo"}),a.createElement("p",null,"WalletConnect"),a.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:t.onClose},a.createElement("div",{id:"walletconnect-qrcode-close",className:"walletconnect-modal__close__icon"},a.createElement("div",{className:"walletconnect-modal__close__line1"}),a.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function d(t){return a.createElement("a",{className:"walletconnect-connect__button",href:t.href,id:"walletconnect-connect-button-"+t.name,onClick:t.onClick,rel:"noopener noreferrer",style:{backgroundColor:t.color},target:"_blank"},t.name)}function p(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:"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",className:"walletconnect-modal__base__row__right__caret"})))}function m(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))}function g(t){var e=i.isAndroid(),r=a.useState(""),n=r[0],o=r[1],s=a.useState(""),u=s[0],c=s[1],f=a.useState(1),h=f[0],g=f[1],b=u?t.links.filter((function(t){return t.name.toLowerCase().includes(u.toLowerCase())})):t.links,y=t.errorMessage,v=u||b.length>5,w=Math.ceil(b.length/12),_=[12*(h-1)+1,12*h],A=b.length?b.filter((function(t,e){return e+1>=_[0]&&e+1<=_[1]})):[],E=!(e||!(w>1)),S=void 0;return a.createElement("div",null,a.createElement("p",{id:l,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),g(1)}),1e3):(o(""),c(""),g(1))}}),a.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(e?"__android":v&&b.length?"__wrap":"")},e?a.createElement(d,{name:t.text.connect,color:"rgb(64, 153, 255)",href:t.uri,onClick:a.useCallback((function(){i.saveMobileLinkInfo({name:"Unknown",href:t.uri})}),[])}):A.length?A.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})}),[A]);return v?a.createElement(m,{color:r,href:u,name:o||n,logo:s,onClick:c}):a.createElement(p,{color:r,href:u,name:n,logo:s,onClick:c})})):a.createElement(a.Fragment,null,a.createElement("p",null,y.length?t.errorMessage:t.links.length&&!b.length?t.text.no_wallets_found:t.text.loading))),E&&a.createElement("div",{className:"walletconnect-modal__footer"},Array(w).fill(0).map((function(t,e){var r=e+1,n=h===r;return a.createElement("a",{style:{margin:"auto 10px",fontWeight:n?"bold":"normal"},onClick:function(){return g(r)}},r)}))))}function b(t){var e=!!t.message.trim();return a.createElement("div",{className:"walletconnect-qrcode__notification"+(e?" notification__show":"")},t.message)}function y(t){var e=a.useState(""),r=e[0],n=e[1],i=a.useState(""),u=i[0],c=i[1];return a.useEffect((function(){try{return Promise.resolve(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("<svg",'<svg class="walletconnect-qrcode__image"')),e}))}catch(t){return Promise.reject(t)}}(t.uri)).then((function(t){c(t)}))}catch(t){Promise.reject(t)}}),[]),a.createElement("div",null,a.createElement("p",{id:l,className:"walletconnect-qrcode__text"},t.text.scan_qrcode_with_wallet),a.createElement("div",{dangerouslySetInnerHTML:{__html:u}}),a.createElement("div",{className:"walletconnect-modal__footer"},a.createElement("a",{onClick:function(){s(t.uri)?(n(t.text.copied_to_clipboard),setInterval((function(){return n("")}),1200)):(n("Error"),setInterval((function(){return n("")}),1200))}},t.text.copy_to_clipboard)),a.createElement(b,{message:r}))}var v={id:"23138217b046ae8d9d07e62b3337fb288c4445f92f64be067809cd0a8f9454b9",name:"Pera Wallet",homepage:"https://perawallet.app",chains:["algorand"],image_id:"1765f9aa-f99e-414e-826b-6b570d480999",image_url:{sm:"https://algorand-app.s3.amazonaws.com/app-icons/Pera-walletconnect-128.png",md:"https://algorand-app.s3.amazonaws.com/app-icons/Pera-walletconnect-128.png",lg:"https://algorand-app.s3.amazonaws.com/app-icons/Pera-walletconnect-128.png"},app:{browser:"",ios:"https://apps.apple.com/us/app/algorand-wallet/id1459898525",android:"https://play.google.com/store/apps/details?id=com.algorand.android",mac:"",windows:"",linux:""},mobile:{native:"algorand-wc:",universal:""},desktop:{native:"",universal:""},metadata:{shortName:"Pera Wallet",colors:{primary:"rgb(255, 238, 85)",secondary:""}}},w={};function _(t){var e=i.isAndroid(),r=i.isMobile(),n=r?t.qrcodeModalOptions&&t.qrcodeModalOptions.mobileLinks?t.qrcodeModalOptions.mobileLinks:void 0:t.qrcodeModalOptions&&t.qrcodeModalOptions.desktopLinks?t.qrcodeModalOptions.desktopLinks:void 0,o=a.useState(!1),s=o[0],u=o[1],c=a.useState(!1),l=c[0],d=c[1],p=a.useState(!r),m=p[0],b=p[1],v={mobile:r,text:t.text,uri:t.uri,qrcodeModalOptions:t.qrcodeModalOptions},_=a.useState(""),A=_[0],E=_[1],S=a.useState(!1),M=S[0],x=S[1],k=a.useState([]),T=k[0],I=k[1],C=a.useState(""),R=C[0],B=C[1],N=function(){l||s||n&&!n.length||T.length>0||a.useEffect((function(){!function(){try{if(e)return Promise.resolve();u(!0);try{var o=r?"mobile":"desktop",s=i.getMobileLinkRegistry(i.formatMobileRegistry(w,o),n);u(!1),d(!0),B(s.length?"":t.text.no_supported_wallets),I(s);var a=1===s.length;a&&(E(i.formatIOSMobile(t.uri,s[0])),b(!0)),x(a)}catch(e){u(!1),d(!0),B(t.text.something_went_wrong),console.error(e)}Promise.resolve()}catch(t){return Promise.reject(t)}}()}))};N();var O=r?m:!m;return a.createElement("div",{id:f,className:"walletconnect-qrcode__base animated fadeIn"},a.createElement("div",{className:"walletconnect-modal__base"},a.createElement(h,{onClose:t.onClose}),M&&m?a.createElement("div",{className:"walletconnect-modal__single_wallet"},a.createElement("a",{onClick:function(){return i.saveMobileLinkInfo({name:T[0].name,href:A})},href:A,rel:"noopener noreferrer",target:"_blank"},t.text.connect_with+" "+(M?T[0].name:"")+" ›")):e||s||!s&&T.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 b(!1),N()}},t.text.mobile),a.createElement("a",{onClick:function(){return b(!0)}},t.text.qrcode)):a.createElement(a.Fragment,null,a.createElement("a",{onClick:function(){return b(!0)}},t.text.qrcode),a.createElement("a",{onClick:function(){return b(!1),N()}},t.text.desktop))):null,a.createElement("div",null,m||!e&&!s&&!T.length?a.createElement(y,Object.assign({},v)):a.createElement(g,Object.assign({},v,{links:T,errorMessage:R})))))}w[v.id]=v;var A={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 E(){var t=i.getDocumentOrThrow(),e=t.getElementById(f);e&&(e.className=e.className.replace("fadeIn","fadeOut"),setTimeout((function(){var e=t.getElementById(u);e&&t.body.removeChild(e)}),300))}function S(t){return function(){E(),t&&t()}}var M=function(){return"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.node},x={open:function(t,e,r){console.log(t),M()?function(t){o.toString(t,{type:"terminal"}).then(console.log)}(t):function(t,e,r){!function(){var t=i.getDocumentOrThrow(),e=t.getElementById(c);e&&t.head.removeChild(e);var r=t.createElement("style");r.setAttribute("id",c),r.innerText=':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',t.head.appendChild(r)}();var n,o=function(){var t=i.getDocumentOrThrow(),e=t.createElement("div");return e.setAttribute("id",u),t.body.appendChild(e),e}();a.render(a.createElement(_,{text:(n=i.getNavigatorOrThrow().language.split("-")[0]||"en",A[n]||A.en),uri:t,onClose:S(e),qrcodeModalOptions:r}),o)}(t,e,r)},close:function(){M()||E()}};t.exports=x},7012:(module,__unused_webpack_exports,__webpack_require__)=>{var t;self,t=function(){return(()=>{var __webpack_modules__={5406:function(t){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){"use strict";r.r(e),r.d(e,"encode",(function(){return T})),r.d(e,"decode",(function(){return z})),r.d(e,"decodeAsync",(function(){return $})),r.d(e,"decodeArrayStream",(function(){return X})),r.d(e,"decodeStream",(function(){return Y})),r.d(e,"Decoder",(function(){return F})),r.d(e,"Encoder",(function(){return x})),r.d(e,"ExtensionCodec",(function(){return E})),r.d(e,"ExtData",(function(){return d})),r.d(e,"EXT_TIMESTAMP",(function(){return g})),r.d(e,"encodeDateToTimeSpec",(function(){return y})),r.d(e,"encodeTimeSpecToTimestamp",(function(){return b})),r.d(e,"decodeTimestampToTimeSpec",(function(){return w})),r.d(e,"encodeTimestampExtension",(function(){return v})),r.d(e,"decodeTimestampExtension",(function(){return _}));var n=function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(n(arguments[e]));return t},o="undefined"!=typeof process&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function s(t){for(var e=t.length,r=0,n=0;n<e;){var i=t.charCodeAt(n++);if(0!=(4294967168&i))if(0==(4294965248&i))r+=2;else{if(i>=55296&&i<=56319&&n<e){var o=t.charCodeAt(n);56320==(64512&o)&&(++n,i=((1023&i)<<10)+(1023&o)+65536)}r+=0==(4294901760&i)?3:4}else r++}return r}var a=o?new TextEncoder:void 0,u="undefined"!=typeof process?200:0,c=(null==a?void 0:a.encodeInto)?function(t,e,r){a.encodeInto(t,e.subarray(r))}:function(t,e,r){e.set(a.encode(t),r)};function f(t,e,r){for(var n=e,o=n+r,s=[],a="";n<o;){var u=t[n++];if(0==(128&u))s.push(u);else if(192==(224&u)){var c=63&t[n++];s.push((31&u)<<6|c)}else if(224==(240&u)){c=63&t[n++];var f=63&t[n++];s.push((31&u)<<12|c<<6|f)}else if(240==(248&u)){var l=(7&u)<<18|(c=63&t[n++])<<12|(f=63&t[n++])<<6|63&t[n++];l>65535&&(l-=65536,s.push(l>>>10&1023|55296),l=56320|1023&l),s.push(l)}else s.push(u);s.length>=4096&&(a+=String.fromCharCode.apply(String,i(s)),s.length=0)}return s.length>0&&(a+=String.fromCharCode.apply(String,i(s))),a}var l=o?new TextDecoder:null,h="undefined"!=typeof process?200:0,d=function(t,e){this.type=t,this.data=e};function p(t,e,r){var n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function m(t,e){var r=t.getInt32(e),n=t.getUint32(e+4),i=r<Math.floor(Number.MIN_SAFE_INTEGER/4294967296)||r===Math.floor(Number.MIN_SAFE_INTEGER/4294967296)&&0===n,o=r>Math.floor(Number.MAX_SAFE_INTEGER/4294967296);return i||o?BigInt(r)*BigInt(4294967296)+BigInt(n):4294967296*r+n}var g=-1;function b(t){var e,r=t.sec,n=t.nsec;if(r>=0&&n>=0&&r<=17179869183){if(0===n&&r<=4294967295){var i=new Uint8Array(4);return(e=new DataView(i.buffer)).setUint32(0,r),i}var o=r/4294967296,s=4294967295&r;return i=new Uint8Array(8),(e=new DataView(i.buffer)).setUint32(0,n<<2|3&o),e.setUint32(4,s),i}return i=new Uint8Array(12),(e=new DataView(i.buffer)).setUint32(0,n),p(e,4,r),i}function y(t){var e=t.getTime(),r=Math.floor(e/1e3),n=1e6*(e-1e3*r),i=Math.floor(n/1e9);return{sec:r+i,nsec:n-1e9*i}}function v(t){return t instanceof Date?b(y(t)):null}function w(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:var r=e.getUint32(0);return{sec:4294967296*(3&r)+e.getUint32(4),nsec:r>>>2};case 12:return{sec:m(e,4),nsec:e.getUint32(0)};default:throw new Error("Unrecognized data size for timestamp: "+t.length)}}function _(t){var e=w(t);return new Date(1e3*e.sec+e.nsec/1e6)}var A={type:g,encode:v,decode:_},E=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(A)}return t.prototype.register=function(t){var e=t.type,r=t.encode,n=t.decode;if(e>=0)this.encoders[e]=r,this.decoders[e]=n;else{var i=1+e;this.builtInEncoders[i]=r,this.builtInDecoders[i]=n}},t.prototype.tryToEncode=function(t,e){for(var r=0;r<this.builtInEncoders.length;r++)if(null!=(n=this.builtInEncoders[r])&&null!=(i=n(t,e)))return new d(-1-r,i);for(r=0;r<this.encoders.length;r++){var n,i;if(null!=(n=this.encoders[r])&&null!=(i=n(t,e)))return new d(r,i)}return t instanceof d?t:null},t.prototype.decode=function(t,e,r){var n=e<0?this.builtInDecoders[-1-e]:this.decoders[e];return n?n(t,e,r):new d(e,t)},t.defaultCodec=new t,t}();function S(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}var M=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},x=function(){function t(t,e,r,n,i,o,s,a){void 0===t&&(t=E.defaultCodec),void 0===e&&(e=void 0),void 0===r&&(r=100),void 0===n&&(n=2048),void 0===i&&(i=!1),void 0===o&&(o=!1),void 0===s&&(s=!1),void 0===a&&(a=!1),this.extensionCodec=t,this.context=e,this.maxDepth=r,this.initialBufferSize=n,this.sortKeys=i,this.forceFloat32=o,this.ignoreUndefined=s,this.forceIntegerToFloat=a,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return t.prototype.getUint8Array=function(){return this.bytes.subarray(0,this.pos)},t.prototype.reinitializeState=function(){this.pos=0},t.prototype.encode=function(t){return this.reinitializeState(),this.doEncode(t,1),this.getUint8Array()},t.prototype.doEncode=function(t,e){if(e>this.maxDepth)throw new Error("Too deep objects in depth "+e);null==t?this.encodeNil():"boolean"==typeof t?this.encodeBoolean(t):"number"==typeof t?this.encodeNumber(t):"string"==typeof t?this.encodeString(t):"bigint"==typeof t?this.encodebigint(t):this.encodeObject(t,e)},t.prototype.ensureBufferSizeToWrite=function(t){var e=this.pos+t;this.view.byteLength<e&&this.resizeBuffer(2*e)},t.prototype.resizeBuffer=function(t){var e=new ArrayBuffer(t),r=new Uint8Array(e),n=new DataView(e);r.set(this.bytes),this.view=n,this.bytes=r},t.prototype.encodeNil=function(){this.writeU8(192)},t.prototype.encodeBoolean=function(t){!1===t?this.writeU8(194):this.writeU8(195)},t.prototype.encodeNumber=function(t){Number.isSafeInteger(t)&&!this.forceIntegerToFloat?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):(this.writeU8(211),this.writeI64(t)):this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))},t.prototype.encodebigint=function(t){t>=BigInt(0)?t<BigInt(128)?this.writeU8(Number(t)):t<BigInt(256)?(this.writeU8(204),this.writeU8(Number(t))):t<BigInt(65536)?(this.writeU8(205),this.writeU16(Number(t))):t<BigInt(4294967296)?(this.writeU8(206),this.writeU32(Number(t))):(this.writeU8(207),this.writeBig64(t)):t>=BigInt(-32)?this.writeU8(224|Number(t)+32):t>=BigInt(-128)?(this.writeU8(208),this.writeI8(Number(t))):t>=BigInt(-32768)?(this.writeU8(209),this.writeI16(Number(t))):t>=BigInt(-2147483648)?(this.writeU8(210),this.writeI32(Number(t))):(this.writeU8(211),this.writeBig64(t))},t.prototype.writeStringHeader=function(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else{if(!(t<4294967296))throw new Error("Too long string: "+t+" bytes in UTF-8");this.writeU8(219),this.writeU32(t)}},t.prototype.encodeString=function(t){var e=t.length;if(o&&e>u){var r=s(t);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),c(t,this.bytes,this.pos),this.pos+=r}else r=s(t),this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),function(t,e,r){for(var n=t.length,i=r,o=0;o<n;){var s=t.charCodeAt(o++);if(0!=(4294967168&s)){if(0==(4294965248&s))e[i++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&o<n){var a=t.charCodeAt(o);56320==(64512&a)&&(++o,s=((1023&s)<<10)+(1023&a)+65536)}0==(4294901760&s)?(e[i++]=s>>12&15|224,e[i++]=s>>6&63|128):(e[i++]=s>>18&7|240,e[i++]=s>>12&63|128,e[i++]=s>>6&63|128)}e[i++]=63&s|128}else e[i++]=s}}(t,this.bytes,this.pos),this.pos+=r},t.prototype.encodeObject=function(t,e){var r=this.extensionCodec.tryToEncode(t,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(t))this.encodeArray(t,e);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else{if("object"!=typeof t)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(t));this.encodeMap(t,e)}},t.prototype.encodeBinary=function(t){var e=t.byteLength;if(e<256)this.writeU8(196),this.writeU8(e);else if(e<65536)this.writeU8(197),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too large binary: "+e);this.writeU8(198),this.writeU32(e)}var r=S(t);this.writeU8a(r)},t.prototype.encodeArray=function(t,e){var r,n,i=t.length;if(i<16)this.writeU8(144+i);else if(i<65536)this.writeU8(220),this.writeU16(i);else{if(!(i<4294967296))throw new Error("Too large array: "+i);this.writeU8(221),this.writeU32(i)}try{for(var o=M(t),s=o.next();!s.done;s=o.next()){var a=s.value;this.doEncode(a,e+1)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.countWithoutUndefined=function(t,e){var r,n,i=0;try{for(var o=M(e),s=o.next();!s.done;s=o.next())void 0!==t[s.value]&&i++}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},t.prototype.encodeMap=function(t,e){var r,n,i=Object.keys(t);this.sortKeys&&i.sort();var o=this.ignoreUndefined?this.countWithoutUndefined(t,i):i.length;if(o<16)this.writeU8(128+o);else if(o<65536)this.writeU8(222),this.writeU16(o);else{if(!(o<4294967296))throw new Error("Too large map object: "+o);this.writeU8(223),this.writeU32(o)}try{for(var s=M(i),a=s.next();!a.done;a=s.next()){var u=a.value,c=t[u];this.ignoreUndefined&&void 0===c||(this.encodeString(u),this.doEncode(c,e+1))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},t.prototype.encodeExtension=function(t){var e=t.data.length;if(1===e)this.writeU8(212);else if(2===e)this.writeU8(213);else if(4===e)this.writeU8(214);else if(8===e)this.writeU8(215);else if(16===e)this.writeU8(216);else if(e<256)this.writeU8(199),this.writeU8(e);else if(e<65536)this.writeU8(200),this.writeU16(e);else{if(!(e<4294967296))throw new Error("Too large extension object: "+e);this.writeU8(201),this.writeU32(e)}this.writeI8(t.type),this.writeU8a(t.data)},t.prototype.writeU8=function(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++},t.prototype.writeU8a=function(t){var e=t.length;this.ensureBufferSizeToWrite(e),this.bytes.set(t,this.pos),this.pos+=e},t.prototype.writeI8=function(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++},t.prototype.writeU16=function(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2},t.prototype.writeI16=function(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2},t.prototype.writeU32=function(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4},t.prototype.writeI32=function(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4},t.prototype.writeF32=function(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4},t.prototype.writeF64=function(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8},t.prototype.writeU64=function(t){this.ensureBufferSizeToWrite(8),function(t,e,r){var n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}(this.view,this.pos,t),this.pos+=8},t.prototype.writeI64=function(t){this.ensureBufferSizeToWrite(8),p(this.view,this.pos,t),this.pos+=8},t.prototype.writeBig64=function(t){this.ensureBufferSizeToWrite(8),function(t,e,r){var n=Number(r/BigInt(4294967296)),i=Number(r%BigInt(4294967296));n<0&&0!==i&&(n-=1),t.setUint32(e,n),t.setUint32(e+4,i)}(this.view,this.pos,t),this.pos+=8},t}(),k={};function T(t,e){return void 0===e&&(e=k),new x(e.extensionCodec,e.context,e.maxDepth,e.initialBufferSize,e.sortKeys,e.forceFloat32,e.ignoreUndefined,e.forceIntegerToFloat).encode(t)}function I(t){return(t<0?"-":"")+"0x"+Math.abs(t).toString(16).padStart(2,"0")}var C=function(){function t(t,e){void 0===t&&(t=16),void 0===e&&(e=16),this.maxKeyLength=t,this.maxLengthPerKey=e,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return t.prototype.canBeCached=function(t){return t>0&&t<=this.maxKeyLength},t.prototype.get=function(t,e,r){var n=this.caches[r-1],i=n.length;t:for(var o=0;o<i;o++){for(var s=n[o],a=s.bytes,u=0;u<r;u++)if(a[u]!==t[e+u])continue t;return s.value}return null},t.prototype.store=function(t,e){var r=this.caches[t.length-1],n={bytes:t,value:e};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)},t.prototype.decode=function(t,e,r){var n=this.get(t,e,r);if(null!=n)return this.hit++,n;this.miss++;var i=f(t,e,r),o=Uint8Array.prototype.slice.call(t,e,e+r);return this.store(o,i),i},t}(),R=function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},B=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="function"==typeof __values?__values(t):t[Symbol.iterator](),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)}))}}},N=function(t){return this instanceof N?(this.v=t,this):new N(t)},O=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(t){i[t]&&(n[t]=function(e){return new Promise((function(r,n){o.push([t,e,r,n])>1||a(t,e)}))})}function a(t,e){try{(r=i[t](e)).value instanceof N?Promise.resolve(r.value.v).then(u,c):f(o[0][2],r)}catch(t){f(o[0][3],t)}var r}function u(t){a("next",t)}function c(t){a("throw",t)}function f(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}},P=new DataView(new ArrayBuffer(0)),D=new Uint8Array(P.buffer),L=function(){try{P.getInt8(0)}catch(t){return t.constructor}throw new Error("never reached")}(),U=new L("Insufficient data"),j=new C,F=function(){function t(t,e,r,n,i,o,s,a){void 0===t&&(t=E.defaultCodec),void 0===e&&(e=void 0),void 0===r&&(r=4294967295),void 0===n&&(n=4294967295),void 0===i&&(i=4294967295),void 0===o&&(o=4294967295),void 0===s&&(s=4294967295),void 0===a&&(a=j),this.extensionCodec=t,this.context=e,this.maxStrLength=r,this.maxBinLength=n,this.maxArrayLength=i,this.maxMapLength=o,this.maxExtLength=s,this.keyDecoder=a,this.totalPos=0,this.pos=0,this.view=P,this.bytes=D,this.headByte=-1,this.stack=[]}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=-1},t.prototype.setBuffer=function(t){this.bytes=S(t),this.view=function(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=S(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}(this.bytes),this.pos=0},t.prototype.appendBuffer=function(t){if(-1!==this.headByte||this.hasRemaining()){var e=this.bytes.subarray(this.pos),r=S(t),n=new Uint8Array(e.length+r.length);n.set(e),n.set(r,e.length),this.setBuffer(n)}else this.setBuffer(t)},t.prototype.hasRemaining=function(t){return void 0===t&&(t=1),this.view.byteLength-this.pos>=t},t.prototype.createNoExtraBytesError=function(t){var e=this.view,r=this.pos;return new RangeError("Extra "+(e.byteLength-r)+" of "+e.byteLength+" byte(s) found at buffer["+t+"]")},t.prototype.decode=function(t){return this.reinitializeState(),this.setBuffer(t),this.doDecodeSingleSync()},t.prototype.doDecodeSingleSync=function(){var t=this.doDecodeSync();if(this.hasRemaining())throw this.createNoExtraBytesError(this.pos);return t},t.prototype.decodeAsync=function(t){var e,r,n,i;return function(t,e,r,n){return new(r||(r=Promise))((function(e,i){function o(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,s)}a((n=n.apply(t,[])).next())}))}(this,0,void 0,(function(){var o,s,a,u,c,f,l,h;return R(this,(function(d){switch(d.label){case 0:o=!1,d.label=1;case 1:d.trys.push([1,6,7,12]),e=B(t),d.label=2;case 2:return[4,e.next()];case 3:if((r=d.sent()).done)return[3,5];if(a=r.value,o)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(a);try{s=this.doDecodeSync(),o=!0}catch(t){if(!(t instanceof L))throw t}this.totalPos+=this.pos,d.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return u=d.sent(),n={error:u},[3,12];case 7:return d.trys.push([7,,10,11]),r&&!r.done&&(i=e.return)?[4,i.call(e)]:[3,9];case 8:d.sent(),d.label=9;case 9:return[3,11];case 10:if(n)throw n.error;return[7];case 11:return[7];case 12:if(o){if(this.hasRemaining())throw this.createNoExtraBytesError(this.totalPos);return[2,s]}throw f=(c=this).headByte,l=c.pos,h=c.totalPos,new RangeError("Insufficient data in parcing "+I(f)+" at "+h+" ("+l+" in the current buffer)")}}))}))},t.prototype.decodeArrayStream=function(t){return this.decodeMultiAsync(t,!0)},t.prototype.decodeStream=function(t){return this.decodeMultiAsync(t,!1)},t.prototype.decodeMultiAsync=function(t,e){return O(this,arguments,(function(){var r,n,i,o,s,a,u,c,f;return R(this,(function(l){switch(l.label){case 0:r=e,n=-1,l.label=1;case 1:l.trys.push([1,13,14,19]),i=B(t),l.label=2;case 2:return[4,N(i.next())];case 3:if((o=l.sent()).done)return[3,12];if(s=o.value,e&&0===n)throw this.createNoExtraBytesError(this.totalPos);this.appendBuffer(s),r&&(n=this.readArraySize(),r=!1,this.complete()),l.label=4;case 4:l.trys.push([4,9,,10]),l.label=5;case 5:return[4,N(this.doDecodeSync())];case 6:return[4,l.sent()];case 7:return l.sent(),0==--n?[3,8]:[3,5];case 8:return[3,10];case 9:if(!((a=l.sent())instanceof L))throw a;return[3,10];case 10:this.totalPos+=this.pos,l.label=11;case 11:return[3,2];case 12:return[3,19];case 13:return u=l.sent(),c={error:u},[3,19];case 14:return l.trys.push([14,,17,18]),o&&!o.done&&(f=i.return)?[4,N(f.call(i))]:[3,16];case 15:l.sent(),l.label=16;case 16:return[3,18];case 17:if(c)throw c.error;return[7];case 18:return[7];case 19:return[2]}}))}))},t.prototype.doDecodeSync=function(){t:for(;;){var t=this.readHeadByte(),e=void 0;if(t>=224)e=t-256;else if(t<192)if(t<128)e=t;else if(t<144){if(0!=(n=t-128)){this.pushMapState(n),this.complete();continue t}e={}}else if(t<160){if(0!=(n=t-144)){this.pushArrayState(n),this.complete();continue t}e=[]}else{var r=t-160;e=this.decodeUtf8String(r,0)}else if(192===t)e=null;else if(194===t)e=!1;else if(195===t)e=!0;else if(202===t)e=this.readF32();else if(203===t)e=this.readF64();else if(204===t)e=this.readU8();else if(205===t)e=this.readU16();else if(206===t)e=this.readU32();else if(207===t)e=this.readU64();else if(208===t)e=this.readI8();else if(209===t)e=this.readI16();else if(210===t)e=this.readI32();else if(211===t)e=this.readI64();else if(217===t)r=this.lookU8(),e=this.decodeUtf8String(r,1);else if(218===t)r=this.lookU16(),e=this.decodeUtf8String(r,2);else if(219===t)r=this.lookU32(),e=this.decodeUtf8String(r,4);else if(220===t){if(0!==(n=this.readU16())){this.pushArrayState(n),this.complete();continue t}e=[]}else if(221===t){if(0!==(n=this.readU32())){this.pushArrayState(n),this.complete();continue t}e=[]}else if(222===t){if(0!==(n=this.readU16())){this.pushMapState(n),this.complete();continue t}e={}}else if(223===t){if(0!==(n=this.readU32())){this.pushMapState(n),this.complete();continue t}e={}}else if(196===t){var n=this.lookU8();e=this.decodeBinary(n,1)}else if(197===t)n=this.lookU16(),e=this.decodeBinary(n,2);else if(198===t)n=this.lookU32(),e=this.decodeBinary(n,4);else if(212===t)e=this.decodeExtension(1,0);else if(213===t)e=this.decodeExtension(2,0);else if(214===t)e=this.decodeExtension(4,0);else if(215===t)e=this.decodeExtension(8,0);else if(216===t)e=this.decodeExtension(16,0);else if(199===t)n=this.lookU8(),e=this.decodeExtension(n,1);else if(200===t)n=this.lookU16(),e=this.decodeExtension(n,2);else{if(201!==t)throw new Error("Unrecognized type byte: "+I(t));n=this.lookU32(),e=this.decodeExtension(n,4)}this.complete();for(var i=this.stack;i.length>0;){var o=i[i.length-1];if(0===o.type){if(o.array[o.position]=e,o.position++,o.position!==o.size)continue t;i.pop(),e=o.array}else{if(1===o.type){if("string"!=(s=typeof e)&&"number"!==s)throw new Error("The type of key must be string or number but "+typeof e);o.key=e,o.type=2;continue t}if(o.map[o.key]=e,o.readCount++,o.readCount!==o.size){o.key=null,o.type=1;continue t}i.pop(),e=o.map}}return e}var s},t.prototype.readHeadByte=function(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=-1},t.prototype.readArraySize=function(){var t=this.readHeadByte();switch(t){case 220:return this.readU16();case 221:return this.readU32();default:if(t<160)return t-144;throw new Error("Unrecognized array type byte: "+I(t))}},t.prototype.pushMapState=function(t){if(t>this.maxMapLength)throw new Error("Max length exceeded: map length ("+t+") > maxMapLengthLength ("+this.maxMapLength+")");this.stack.push({type:1,size:t,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(t){if(t>this.maxArrayLength)throw new Error("Max length exceeded: array length ("+t+") > maxArrayLength ("+this.maxArrayLength+")");this.stack.push({type:0,size:t,array:new Array(t),position:0})},t.prototype.decodeUtf8String=function(t,e){var r;if(t>this.maxStrLength)throw new Error("Max length exceeded: UTF-8 byte length ("+t+") > maxStrLength ("+this.maxStrLength+")");if(this.bytes.byteLength<this.pos+e+t)throw U;var n,i=this.pos+e;return n=this.stateIsMapKey()&&(null===(r=this.keyDecoder)||void 0===r?void 0:r.canBeCached(t))?this.keyDecoder.decode(this.bytes,i,t):o&&t>h?function(t,e,r){var n=t.subarray(e,e+r);return l.decode(n)}(this.bytes,i,t):f(this.bytes,i,t),this.pos+=e+t,n},t.prototype.stateIsMapKey=function(){return this.stack.length>0&&1===this.stack[this.stack.length-1].type},t.prototype.decodeBinary=function(t,e){if(t>this.maxBinLength)throw new Error("Max length exceeded: bin length ("+t+") > maxBinLength ("+this.maxBinLength+")");if(!this.hasRemaining(t+e))throw U;var r=this.pos+e,n=this.bytes.subarray(r,r+t);return this.pos+=e+t,n},t.prototype.decodeExtension=function(t,e){if(t>this.maxExtLength)throw new Error("Max length exceeded: ext length ("+t+") > maxExtLength ("+this.maxExtLength+")");var r=this.view.getInt8(this.pos+e),n=this.decodeBinary(t,e+1);return this.extensionCodec.decode(n,r,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var t=this.view.getUint8(this.pos);return this.pos++,t},t.prototype.readI8=function(){var t=this.view.getInt8(this.pos);return this.pos++,t},t.prototype.readU16=function(){var t=this.view.getUint16(this.pos);return this.pos+=2,t},t.prototype.readI16=function(){var t=this.view.getInt16(this.pos);return this.pos+=2,t},t.prototype.readU32=function(){var t=this.view.getUint32(this.pos);return this.pos+=4,t},t.prototype.readI32=function(){var t=this.view.getInt32(this.pos);return this.pos+=4,t},t.prototype.readU64=function(){var t,e,r,n,i=(t=this.view,e=this.pos,r=t.getUint32(e),n=t.getUint32(e+4),r>Math.floor(Number.MAX_SAFE_INTEGER/4294967296)?BigInt(r)*BigInt(4294967296)+BigInt(n):4294967296*r+n);return this.pos+=8,i},t.prototype.readI64=function(){var t=m(this.view,this.pos);return this.pos+=8,t},t.prototype.readF32=function(){var t=this.view.getFloat32(this.pos);return this.pos+=4,t},t.prototype.readF64=function(){var t=this.view.getFloat64(this.pos);return this.pos+=8,t},t}(),q={};function z(t,e){return void 0===e&&(e=q),new F(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength).decode(t)}var H=function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},K=function(t){return this instanceof K?(this.v=t,this):new K(t)},G=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(t){i[t]&&(n[t]=function(e){return new Promise((function(r,n){o.push([t,e,r,n])>1||a(t,e)}))})}function a(t,e){try{(r=i[t](e)).value instanceof K?Promise.resolve(r.value.v).then(u,c):f(o[0][2],r)}catch(t){f(o[0][3],t)}var r}function u(t){a("next",t)}function c(t){a("throw",t)}function f(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}};function W(t){if(null==t)throw new Error("Assertion Failure: value must not be null nor undefined")}function V(t){return null!=t[Symbol.asyncIterator]?t:function(t){return G(this,arguments,(function(){var e,r,n,i;return H(this,(function(o){switch(o.label){case 0:e=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,K(e.read())];case 3:return r=o.sent(),n=r.done,i=r.value,n?[4,K(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return W(i),[4,K(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}(t)}function $(t,e){return void 0===e&&(e=q),function(t,e,r,n){return new(r||(r=Promise))((function(e,i){function o(t){try{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,s)}a((n=n.apply(t,[])).next())}))}(this,0,void 0,(function(){var r;return function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}(this,(function(n){return r=V(t),[2,new F(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength).decodeAsync(r)]}))}))}function X(t,e){void 0===e&&(e=q);var r=V(t);return new F(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength).decodeArrayStream(r)}function Y(t,e){void 0===e&&(e=q);var r=V(t);return new F(e.extensionCodec,e.context,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength).decodeStream(r)}}])},5155:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(t,a,a+s>u?u:a+s));return 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]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(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 c(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5117:function(t,e,r){var n;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,u=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,h=14,d=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,g=1e9;function b(t){var e=0|t;return t>0||t===e?e:e-1}function y(t){for(var e,r,n=1,i=t.length,o=t[0]+"";n<i;){for(e=t[n++]+"",r=h-e.length;r--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function v(t,e){var r,n,i=t.c,o=e.c,s=t.s,a=e.s,u=t.e,c=e.e;if(!s||!a)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-a:s;if(s!=a)return s;if(r=s<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(t,e,r,n){if(t<e||t>r||t!==u(t))throw Error(c+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _(t){var e=t.c.length-1;return b(t.e/h)==e&&t.c[e]%2!=0}function A(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function E(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(o=function t(e){var r,n,i,o,S,M,x,k,T,I,C=H.prototype={constructor:H,toString:null,valueOf:null},R=new H(1),B=20,N=4,O=-7,P=21,D=-1e7,L=1e7,U=!1,j=1,F=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz";function H(t,e){var r,o,a,c,l,p,m,g,b=this;if(!(b instanceof H))return new H(t,e);if(null==e){if(t&&!0===t._isBigNumber)return b.s=t.s,void(!t.c||t.e>L?b.c=b.e=null:t.e<D?b.c=[b.e=0]:(b.e=t.e,b.c=t.c.slice()));if((p="number"==typeof t)&&0*t==0){if(b.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,l=t;l>=10;l/=10,c++);return void(c>L?b.c=b.e=null:(b.e=c,b.c=[t]))}g=String(t)}else{if(!s.test(g=String(t)))return i(b,g,p);b.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(c<0&&(c=l),c+=+g.slice(l+1),g=g.substring(0,l)):c<0&&(c=g.length)}else{if(w(e,2,z.length,"Base"),10==e)return V(b=new H(t),B+b.e+1,N);if(g=String(t),p="number"==typeof t){if(0*t!=0)return i(b,g,p,e);if(b.s=1/t<0?(g=g.slice(1),-1):1,H.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(f+t)}else b.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=z.slice(0,e),c=l=0,m=g.length;l<m;l++)if(r.indexOf(o=g.charAt(l))<0){if("."==o){if(l>c){c=m;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,l=-1,c=0;continue}return i(b,String(t),p,e)}p=!1,(c=(g=n(g,e,10,b.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(l=0;48===g.charCodeAt(l);l++);for(m=g.length;48===g.charCodeAt(--m););if(g=g.slice(l,++m)){if(m-=l,p&&H.DEBUG&&m>15&&(t>d||t!==u(t)))throw Error(f+b.s*t);if((c=c-l-1)>L)b.c=b.e=null;else if(c<D)b.c=[b.e=0];else{if(b.e=c,b.c=[],l=(c+1)%h,c<0&&(l+=h),l<m){for(l&&b.c.push(+g.slice(0,l)),m-=h;l<m;)b.c.push(+g.slice(l,l+=h));l=h-(g=g.slice(l)).length}else l-=m;for(;l--;g+="0");b.c.push(+g)}}else b.c=[b.e=0]}function K(t,e,r,n){var i,o,s,a,u;if(null==r?r=N:w(r,0,8),!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)u=y(t.c),u=1==n||2==n&&(s<=O||s>=P)?A(u,s):E(u,s,"0");else if(o=(t=V(new H(t),e,r)).e,a=(u=y(t.c)).length,1==n||2==n&&(e<=o||o<=O)){for(;a<e;u+="0",a++);u=A(u,o)}else if(e-=s,u=E(u,o,"0"),o+1>a){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-a)>0)for(o+1==a&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function G(t,e){for(var r,n=1,i=new H(t[0]);n<t.length;n++){if(!(r=new H(t[n])).s){i=r;break}e.call(i,r)&&(i=r)}return i}function W(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,n++);return(r=n+r*h-1)>L?t.c=t.e=null:r<D?t.c=[t.e=0]:(t.e=r,t.c=e),t}function V(t,e,r,n){var i,o,s,c,f,d,m,g=t.c,b=p;if(g){t:{for(i=1,c=g[0];c>=10;c/=10,i++);if((o=e-i)<0)o+=h,s=e,m=(f=g[d=0])/b[i-s-1]%10|0;else if((d=a((o+1)/h))>=g.length){if(!n)break t;for(;g.length<=d;g.push(0));f=m=0,i=1,s=(o%=h)-h+1}else{for(f=c=g[d],i=1;c>=10;c/=10,i++);m=(s=(o%=h)-h+i)<0?0:f/b[i-s-1]%10|0}if(n=n||e<0||null!=g[d+1]||(s<0?f:f%b[i-s-1]),n=r<4?(m||n)&&(0==r||r==(t.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(o>0?s>0?f/b[i-s]:0:g[d-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,n?(e-=t.e+1,g[0]=b[(h-e%h)%h],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=d,c=1,d--):(g.length=d+1,c=b[h-o],g[d]=s>0?u(f/b[i-s]%b[s])*c:0),n)for(;;){if(0==d){for(o=1,s=g[0];s>=10;s/=10,o++);for(s=g[0]+=c,c=1;s>=10;s/=10,c++);o!=c&&(t.e++,g[0]==l&&(g[0]=1));break}if(g[d]+=c,g[d]!=l)break;g[d--]=0,c=1}for(o=g.length;0===g[--o];g.pop());}t.e>L?t.c=t.e=null:t.e<D&&(t.c=[t.e=0])}return t}function $(t){var e,r=t.e;return null===r?t.toString():(e=y(t.c),e=r<=O||r>=P?A(e,r):E(e,r,"0"),t.s<0?"-"+e:e)}return H.clone=t,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(c+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(w(r=t[e],0,g,e),B=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(w(r=t[e],0,8,e),N=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(w(r[0],-g,0,e),w(r[1],0,g,e),O=r[0],P=r[1]):(w(r,-g,g,e),O=-(P=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)w(r[0],-g,-1,e),w(r[1],1,g,e),D=r[0],L=r[1];else{if(w(r,-g,g,e),!r)throw Error(c+e+" cannot be zero: "+r);D=-(L=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(c+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(c+"crypto unavailable");U=r}else U=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(w(r=t[e],0,9,e),j=r),t.hasOwnProperty(e="POW_PRECISION")&&(w(r=t[e],0,g,e),F=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(c+e+" not an object: "+r);q=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(c+e+" invalid: "+r);z=r}}return{DECIMAL_PLACES:B,ROUNDING_MODE:N,EXPONENTIAL_AT:[O,P],RANGE:[D,L],CRYPTO:U,MODULO_MODE:j,POW_PRECISION:F,FORMAT:q,ALPHABET:z}},H.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!H.DEBUG)return!0;var e,r,n=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%h)<1&&(e+=h),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=l||r!==u(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+t)},H.maximum=H.max=function(){return G(arguments,C.lt)},H.minimum=H.min=function(){return G(arguments,C.gt)},H.random=(o=9007199254740992,S=Math.random()*o&2097151?function(){return u(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,o,s=0,f=[],l=new H(R);if(null==t?t=B:w(t,0,g),i=a(t/h),U)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*e[s]+(e[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[s]=r[0],e[s+1]=r[1]):(f.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(c+"crypto unavailable");for(e=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&e[s])+1099511627776*e[s+1]+4294967296*e[s+2]+16777216*e[s+3]+(e[s+4]<<16)+(e[s+5]<<8)+e[s+6])>=9e15?crypto.randomBytes(7).copy(e,s):(f.push(o%1e14),s+=7);s=i/7}if(!U)for(;s<i;)(o=S())<9e15&&(f[s++]=o%1e14);for(i=f[--s],t%=h,i&&t&&(o=p[h-t],f[s]=u(i/o)*o);0===f[s];f.pop(),s--);if(s<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=h);for(s=1,o=f[0];o>=10;o/=10,s++);s<h&&(n-=h-s)}return l.e=n,l.c=f,l}),H.sum=function(){for(var t=1,e=arguments,r=new H(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){var t="0123456789";function e(t,e,r,n){for(var i,o,s=[0],a=0,u=t.length;a<u;){for(o=s.length;o--;s[o]*=e);for(s[0]+=n.indexOf(t.charAt(a++)),i=0;i<s.length;i++)s[i]>r-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,f,l,h,d,p,m,g=n.indexOf("."),b=B,v=N;for(g>=0&&(l=F,F=0,n=n.replace(".",""),d=(m=new H(i)).pow(n.length-g),F=l,m.c=e(E(y(d.c),d.e,"0"),10,o,t),m.e=m.c.length),f=l=(p=e(n,i,o,a?(u=z,t):(u=t,z))).length;0==p[--l];p.pop());if(!p[0])return u.charAt(0);if(g<0?--f:(d.c=p,d.e=f,d.s=s,p=(d=r(d,m,b,v,o)).c,h=d.r,f=d.e),g=p[c=f+b+1],l=o/2,h=h||c<0||null!=p[c+1],h=v<4?(null!=g||h)&&(0==v||v==(d.s<0?3:2)):g>l||g==l&&(4==v||h||6==v&&1&p[c-1]||v==(d.s<0?8:7)),c<1||!p[0])n=h?E(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(p.length=c,h)for(--o;++p[--c]>o;)p[c]=0,c||(++f,p=[1].concat(p));for(l=p.length;!p[--l];);for(g=0,n="";g<=l;n+=u.charAt(p[g++]));n=E(n,f,u.charAt(0))}return n}}(),r=function(){function t(t,e,r){var n,i,o,s,a=0,u=t.length,c=e%m,f=e/m|0;for(t=t.slice();u--;)a=((i=c*(o=t[u]%m)+(n=f*o+(s=t[u]/m|0)*c)%m*m+a)/r|0)+(n/m|0)+f*s,t[u]=i%r;return a&&(t=[a].concat(t)),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,i,o,s,a){var c,f,d,p,m,g,y,v,w,_,A,E,S,M,x,k,T,I=n.s==i.s?1:-1,C=n.c,R=i.c;if(!(C&&C[0]&&R&&R[0]))return new H(n.s&&i.s&&(C?!R||C[0]!=R[0]:R)?C&&0==C[0]||!R?0*I:I/0:NaN);for(w=(v=new H(I)).c=[],I=o+(f=n.e-i.e)+1,a||(a=l,f=b(n.e/h)-b(i.e/h),I=I/h|0),d=0;R[d]==(C[d]||0);d++);if(R[d]>(C[d]||0)&&f--,I<0)w.push(1),p=!0;else{for(M=C.length,k=R.length,d=0,I+=2,(m=u(a/(R[0]+1)))>1&&(R=t(R,m,a),C=t(C,m,a),k=R.length,M=C.length),S=k,A=(_=C.slice(0,k)).length;A<k;_[A++]=0);T=R.slice(),T=[0].concat(T),x=R[0],R[1]>=a/2&&x++;do{if(m=0,(c=e(R,_,k,A))<0){if(E=_[0],k!=A&&(E=E*a+(_[1]||0)),(m=u(E/x))>1)for(m>=a&&(m=a-1),y=(g=t(R,m,a)).length,A=_.length;1==e(g,_,y,A);)m--,r(g,k<y?T:R,y,a),y=g.length,c=1;else 0==m&&(c=m=1),y=(g=R.slice()).length;if(y<A&&(g=[0].concat(g)),r(_,g,A,a),A=_.length,-1==c)for(;e(R,_,k,A)<1;)m++,r(_,k<A?T:R,A,a),A=_.length}else 0===c&&(m++,_=[0]);w[d++]=m,_[0]?_[A++]=C[S]||0:(_=[C[S]],A=1)}while((S++<M||null!=_[0])&&I--);p=null!=_[0],w[0]||w.splice(0,1)}if(a==l){for(d=1,I=w[0];I>=10;I/=10,d++);V(v,o+(v.e=d+f*h-1)+1,s,p)}else v.e=f,v.r=+p;return v}}(),M=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,k=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,I=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var i,o=r?e:e.replace(I,"");if(T.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(M,(function(t,e,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?t:e})),n&&(i=n,o=o.replace(x,"$1").replace(k,"0.$1")),e!=o))return new H(o,i);if(H.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},C.absoluteValue=C.abs=function(){var t=new H(this);return t.s<0&&(t.s=1),t},C.comparedTo=function(t,e){return v(this,new H(t,e))},C.decimalPlaces=C.dp=function(t,e){var r,n,i,o=this;if(null!=t)return w(t,0,g),null==e?e=N:w(e,0,8),V(new H(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=((i=r.length-1)-b(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},C.dividedBy=C.div=function(t,e){return r(this,new H(t,e),B,N)},C.dividedToIntegerBy=C.idiv=function(t,e){return r(this,new H(t,e),0,1)},C.exponentiatedBy=C.pow=function(t,e){var r,n,i,o,s,f,l,d,p=this;if((t=new H(t)).c&&!t.isInteger())throw Error(c+"Exponent not an integer: "+$(t));if(null!=e&&(e=new H(e)),s=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return d=new H(Math.pow(+$(p),s?2-_(t):+$(t))),e?d.mod(e):d;if(f=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new H(NaN);(n=!f&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&_(t)?-0:0,p.e>-1&&(o=1/o),new H(f?1/o:o);F&&(o=a(F/h+2))}for(s?(r=new H(.5),f&&(t.s=1),l=_(t)):l=(i=Math.abs(+$(t)))%2,d=new H(R);;){if(l){if(!(d=d.times(p)).c)break;o?d.c.length>o&&(d.c.length=o):n&&(d=d.mod(e))}if(i){if(0===(i=u(i/2)))break;l=i%2}else if(V(t=t.times(r),t.e+1,1),t.e>14)l=_(t);else{if(0==(i=+$(t)))break;l=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(e))}return n?d:(f&&(d=R.div(d)),e?d.mod(e):o?V(d,F,N,void 0):d)},C.integerValue=function(t){var e=new H(this);return null==t?t=N:w(t,0,8),V(e,e.e+1,t)},C.isEqualTo=C.eq=function(t,e){return 0===v(this,new H(t,e))},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(t,e){return v(this,new H(t,e))>0},C.isGreaterThanOrEqualTo=C.gte=function(t,e){return 1===(e=v(this,new H(t,e)))||0===e},C.isInteger=function(){return!!this.c&&b(this.e/h)>this.c.length-2},C.isLessThan=C.lt=function(t,e){return v(this,new H(t,e))<0},C.isLessThanOrEqualTo=C.lte=function(t,e){return-1===(e=v(this,new H(t,e)))||0===e},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.minus=function(t,e){var r,n,i,o,s=this,a=s.s;if(e=(t=new H(t,e)).s,!a||!e)return new H(NaN);if(a!=e)return t.s=-e,s.plus(t);var u=s.e/h,c=t.e/h,f=s.c,d=t.c;if(!u||!c){if(!f||!d)return f?(t.s=-e,t):new H(d?s:NaN);if(!f[0]||!d[0])return d[0]?(t.s=-e,t):new H(f[0]?s:3==N?-0:0)}if(u=b(u),c=b(c),f=f.slice(),a=u-c){for((o=a<0)?(a=-a,i=f):(c=u,i=d),i.reverse(),e=a;e--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(e=d.length))?a:e,a=e=0;e<n;e++)if(f[e]!=d[e]){o=f[e]<d[e];break}if(o&&(i=f,f=d,d=i,t.s=-t.s),(e=(n=d.length)-(r=f.length))>0)for(;e--;f[r++]=0);for(e=l-1;n>a;){if(f[--n]<d[n]){for(r=n;r&&!f[--r];f[r]=e);--f[r],f[n]+=l}f[n]-=d[n]}for(;0==f[0];f.splice(0,1),--c);return f[0]?W(t,f,c):(t.s=3==N?-1:1,t.c=[t.e=0],t)},C.modulo=C.mod=function(t,e){var n,i,o=this;return t=new H(t,e),!o.c||!t.s||t.c&&!t.c[0]?new H(NaN):!t.c||o.c&&!o.c[0]?new H(o):(9==j?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,j),(t=o.minus(n.times(t))).c[0]||1!=j||(t.s=o.s),t)},C.multipliedBy=C.times=function(t,e){var r,n,i,o,s,a,u,c,f,d,p,g,y,v,w,_=this,A=_.c,E=(t=new H(t,e)).c;if(!(A&&E&&A[0]&&E[0]))return!_.s||!t.s||A&&!A[0]&&!E||E&&!E[0]&&!A?t.c=t.e=t.s=null:(t.s*=_.s,A&&E?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=b(_.e/h)+b(t.e/h),t.s*=_.s,(u=A.length)<(d=E.length)&&(y=A,A=E,E=y,i=u,u=d,d=i),i=u+d,y=[];i--;y.push(0));for(v=l,w=m,i=d;--i>=0;){for(r=0,p=E[i]%w,g=E[i]/w|0,o=i+(s=u);o>i;)r=((c=p*(c=A[--s]%w)+(a=g*c+(f=A[s]/w|0)*p)%w*w+y[o]+r)/v|0)+(a/w|0)+g*f,y[o--]=c%v;y[o]=r}return r?++n:y.splice(0,1),W(t,y,n)},C.negated=function(){var t=new H(this);return t.s=-t.s||null,t},C.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new H(t,e)).s,!i||!e)return new H(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/h,s=t.e/h,a=n.c,u=t.c;if(!o||!s){if(!a||!u)return new H(i/0);if(!a[0]||!u[0])return u[0]?t:new H(a[0]?n:0*i)}if(o=b(o),s=b(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(e=u.length)<0&&(r=u,u=a,a=r,e=i),i=0;e;)i=(a[--e]=a[e]+u[e]+i)/l|0,a[e]=l===a[e]?0:a[e]%l;return i&&(a=[i].concat(a),++s),W(t,a,s)},C.precision=C.sd=function(t,e){var r,n,i,o=this;if(null!=t&&t!==!!t)return w(t,1,g),null==e?e=N:w(e,0,8),V(new H(o),t,e);if(!(r=o.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},C.shiftedBy=function(t){return w(t,-9007199254740991,d),this.times("1e"+t)},C.squareRoot=C.sqrt=function(){var t,e,n,i,o,s=this,a=s.c,u=s.s,c=s.e,f=B+4,l=new H("0.5");if(1!==u||!a||!a[0])return new H(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+$(s)))||u==1/0?(((e=y(a)).length+c)%2==0&&(e+="0"),u=Math.sqrt(+e),c=b((c+1)/2)-(c<0||c%2),n=new H(e=u==1/0?"5e"+c:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new H(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(s,o,f,1))),y(o.c).slice(0,u)===(e=y(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(e=e.slice(u-3,u+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(V(n,n.e+B+2,1),t=!n.times(n).eq(s));break}if(!i&&(V(o,o.e+B+2,0),o.times(o).eq(s))){n=o;break}f+=4,u+=4,i=1}return V(n,n.e+B+1,N,t)},C.toExponential=function(t,e){return null!=t&&(w(t,0,g),t++),K(this,t,e,1)},C.toFixed=function(t,e){return null!=t&&(w(t,0,g),t=t+this.e+1),K(this,t,e)},C.toFormat=function(t,e,r){var n,i=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=q;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(t,e),i.c){var o,s=n.split("."),a=+r.groupSize,u=+r.secondaryGroupSize,f=r.groupSeparator||"",l=s[0],h=s[1],d=i.s<0,p=d?l.slice(1):l,m=p.length;if(u&&(o=a,a=u,u=o,m-=o),a>0&&m>0){for(o=m%a||a,l=p.substr(0,o);o<m;o+=a)l+=f+p.substr(o,a);u>0&&(l+=f+p.slice(o)),d&&(l="-"+l)}n=h?l+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):l}return(r.prefix||"")+n+(r.suffix||"")},C.toFraction=function(t){var e,n,i,o,s,a,u,f,l,d,m,g,b=this,v=b.c;if(null!=t&&(!(u=new H(t)).isInteger()&&(u.c||1!==u.s)||u.lt(R)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+$(u));if(!v)return new H(b);for(e=new H(R),l=n=new H(R),i=f=new H(R),g=y(v),s=e.e=g.length-b.e-1,e.c[0]=p[(a=s%h)<0?h+a:a],t=!t||u.comparedTo(e)>0?s>0?e:l:u,a=L,L=1/0,u=new H(g),f.c[0]=0;d=r(u,e,0,1),1!=(o=n.plus(d.times(i))).comparedTo(t);)n=i,i=o,l=f.plus(d.times(o=l)),f=o,e=u.minus(d.times(o=e)),u=o;return o=r(t.minus(n),i,0,1),f=f.plus(o.times(l)),n=n.plus(o.times(i)),f.s=l.s=b.s,m=r(l,i,s*=2,N).minus(b).abs().comparedTo(r(f,n,s,N).minus(b).abs())<1?[l,i]:[f,n],L=a,m},C.toNumber=function(){return+$(this)},C.toPrecision=function(t,e){return null!=t&&w(t,1,g),K(this,t,e,2)},C.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=O||o>=P?A(y(r.c),o):E(y(r.c),o,"0"):10===t?e=E(y((r=V(new H(r),B+o+1,N)).c),r.e,"0"):(w(t,2,z.length,"Base"),e=n(E(y(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},C.valueOf=C.toJSON=function(){return $(this)},C._isBigNumber=!0,null!=e&&H.set(e),H}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}()},2486:(t,e,r)=>{"use strict";const n=r(5155),i=r(4525),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const 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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|m(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const 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(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(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');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(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 f(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 l(t){return f(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=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)||X(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);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(i)return n?-1:W(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let 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 C(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function y(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),Y(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:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let 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){let n=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Y(n))return s;t[r+s]=n}return s}function _(t,e,r,n){return $(W(e,t.length-r),t,r,n)}function A(t,e,r,n){return $(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return $(V(e),t,r,n)}function S(t,e,r,n){return $(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return l(t)},u.allocUnsafeSlow=function(t){return l(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(X(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),X(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(X(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(X(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;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t<a;++t)if(c[t]!==f[t]){o=c[t],s=f[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const 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");let o=!1;for(;;)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 A(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(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)}};const k=4096;function T(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=J[t[n]];return i}function R(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function B(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function P(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function D(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 L(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const 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<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(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||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(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||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(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||N(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let 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||N(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||N(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||N(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||N(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||N(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.writeBigUInt64LE=Z((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(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||N(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||N(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||N(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||N(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.writeBigInt64LE=Z((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(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<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const j={};function F(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function q(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(n,i,o)}function H(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&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 V(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Z(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},7615:(t,e,r)=>{"use strict";var n=r(1801),i=r(2550),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}},2550:(t,e,r)=>{"use strict";var n=r(1930),i=r(1801),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),f=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l},1069:t=>{function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<n.length;i++)if((r=n[i])===e||r.fn===e){n.splice(i,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},5799:t=>{t.exports=n,n.default=n,n.stable=s,n.stableStringify=s;var e=[],r=[];function n(t,n,o){var s;for(i(t,"",[],void 0),s=0===r.length?JSON.stringify(t,n,o):JSON.stringify(t,u(n),o);0!==e.length;){var a=e.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}return s}function i(t,n,o,s){var a;if("object"==typeof t&&null!==t){for(a=0;a<o.length;a++)if(o[a]===t){var u=Object.getOwnPropertyDescriptor(s,n);return void(void 0!==u.get?u.configurable?(Object.defineProperty(s,n,{value:"[Circular]"}),e.push([s,n,t,u])):r.push([t,n]):(s[n]="[Circular]",e.push([s,n,t])))}if(o.push(t),Array.isArray(t))for(a=0;a<t.length;a++)i(t[a],a,o,t);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var f=c[a];i(t[f],f,o,t)}}o.pop()}}function o(t,e){return t<e?-1:t>e?1:0}function s(t,n,i){var o,s=a(t,"",[],void 0)||t;for(o=0===r.length?JSON.stringify(s,n,i):JSON.stringify(s,u(n),i);0!==e.length;){var c=e.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}return o}function a(t,n,i,s){var u;if("object"==typeof t&&null!==t){for(u=0;u<i.length;u++)if(i[u]===t){var c=Object.getOwnPropertyDescriptor(s,n);return void(void 0!==c.get?c.configurable?(Object.defineProperty(s,n,{value:"[Circular]"}),e.push([s,n,t,c])):r.push([t,n]):(s[n]="[Circular]",e.push([s,n,t])))}if("function"==typeof t.toJSON)return;if(i.push(t),Array.isArray(t))for(u=0;u<t.length;u++)a(t[u],u,i,t);else{var f={},l=Object.keys(t).sort(o);for(u=0;u<l.length;u++){var h=l[u];a(t[h],h,i,t),f[h]=t[h]}if(void 0===s)return f;e.push([s,n,t]),s[n]=f}i.pop()}}function u(t){return t=void 0!==t?t:function(t,e){return e},function(e,n){if(r.length>0)for(var i=0;i<r.length;i++){var o=r[i];if(o[1]===e&&o[0]===n){n="[Circular]",r.splice(i,1);break}}return t.call(this,e,n)}}},9930:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),f=[],l=0;l<c;l++)f.push("$"+l);if(s=Function("binder","return function ("+f.join(",")+"){ return binder.apply(this,arguments); }")(u),o.prototype){var h=function(){};h.prototype=o.prototype,s.prototype=new h,h.prototype=null}return s}},1930:(t,e,r)=>{"use strict";var n=r(9930);t.exports=Function.prototype.bind||n},1801:(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(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},f=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,l=r(9905)(),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%":l?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,"%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%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?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&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":f,"%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},g=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},b={"%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"]},y=r(1930),v=r(9284),w=y.call(Function.call,Array.prototype.concat),_=y.call(Function.apply,Array.prototype.splice),A=y.call(Function.call,String.prototype.replace),E=y.call(Function.call,String.prototype.slice),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,x=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,S,(function(t,e,r,i){n[n.length]=r?A(i,M,"$1"):e||t})),n},k=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(m,n)){var o=m[n];if(o===d&&(o=g(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');var r=x(t),n=r.length>0?r[0]:"",o=k("%"+n+"%",e),a=o.name,c=o.value,f=!1,l=o.alias;l&&(n=l[0],_(r,w([0,1],l)));for(var h=1,d=!0;h<r.length;h+=1){var p=r[h],g=E(p,0,1),b=E(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===b||"'"===b||"`"===b)&&g!==b)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&d||(f=!0),v(m,a="%"+(n+="."+p)+"%"))c=m[a];else if(null!=c){if(!(p in c)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&h+1>=r.length){var y=u(c,p);c=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:c[p]}else d=v(c,p),c=c[p];d&&!f&&(m[a]=c)}}return c}},9905:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682: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}},9284:(t,e,r)=>{"use strict";var n=r(1930);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},7267:(t,e,r)=>{var n;!function(){"use strict";var e="object"==typeof window?window:{};!e.HI_BASE32_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);var i=!e.HI_BASE32_NO_COMMON_JS&&t.exports,o=r.amdO,s="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),a={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},u=[0,0,0,0,0,0,0,0],c=function(t,e){e.length>10&&(e="..."+e.substr(-10));var r=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+t+" bytes: "+e+" <-");throw r.position=t,r},f=function(t){if(""===t)return[];if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");for(var e,r,n,i,o,s,u,c,f=[],l=0,h=(t=t.replace(/=/g,"")).length,d=0,p=h>>3<<3;d<p;)e=a[t.charAt(d++)],r=a[t.charAt(d++)],n=a[t.charAt(d++)],i=a[t.charAt(d++)],o=a[t.charAt(d++)],s=a[t.charAt(d++)],u=a[t.charAt(d++)],c=a[t.charAt(d++)],f[l++]=255&(e<<3|r>>>2),f[l++]=255&(r<<6|n<<1|i>>>4),f[l++]=255&(i<<4|o>>>1),f[l++]=255&(o<<7|s<<2|u>>>3),f[l++]=255&(u<<5|c);var m=h-p;return 2===m?(e=a[t.charAt(d++)],r=a[t.charAt(d++)],f[l++]=255&(e<<3|r>>>2)):4===m?(e=a[t.charAt(d++)],r=a[t.charAt(d++)],n=a[t.charAt(d++)],i=a[t.charAt(d++)],f[l++]=255&(e<<3|r>>>2),f[l++]=255&(r<<6|n<<1|i>>>4)):5===m?(e=a[t.charAt(d++)],r=a[t.charAt(d++)],n=a[t.charAt(d++)],i=a[t.charAt(d++)],o=a[t.charAt(d++)],f[l++]=255&(e<<3|r>>>2),f[l++]=255&(r<<6|n<<1|i>>>4),f[l++]=255&(i<<4|o>>>1)):7===m&&(e=a[t.charAt(d++)],r=a[t.charAt(d++)],n=a[t.charAt(d++)],i=a[t.charAt(d++)],o=a[t.charAt(d++)],s=a[t.charAt(d++)],u=a[t.charAt(d++)],f[l++]=255&(e<<3|r>>>2),f[l++]=255&(r<<6|n<<1|i>>>4),f[l++]=255&(i<<4|o>>>1),f[l++]=255&(o<<7|s<<2|u>>>3)),f},l=function(t,e){if(!e)return function(t){for(var e,r,n="",i=t.length,o=0,s=0;o<i;)if((e=t[o++])<=127)n+=String.fromCharCode(e);else{e>191&&e<=223?(r=31&e,s=1):e<=239?(r=15&e,s=2):e<=247?(r=7&e,s=3):c(o,n);for(var a=0;a<s;++a)((e=t[o++])<128||e>191)&&c(o,n),r<<=6,r+=63&e;r>=55296&&r<=57343&&c(o,n),r>1114111&&c(o,n),r<=65535?n+=String.fromCharCode(r):(r-=65536,n+=String.fromCharCode(55296+(r>>10)),n+=String.fromCharCode(56320+(1023&r)))}return n}(f(t));if(""===t)return"";if(!/^[A-Z2-7=]+$/.test(t))throw new Error("Invalid base32 characters");var r,n,i,o,s,u,l,h,d="",p=t.indexOf("=");-1===p&&(p=t.length);for(var m=0,g=p>>3<<3;m<g;)r=a[t.charAt(m++)],n=a[t.charAt(m++)],i=a[t.charAt(m++)],o=a[t.charAt(m++)],s=a[t.charAt(m++)],u=a[t.charAt(m++)],l=a[t.charAt(m++)],h=a[t.charAt(m++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))+String.fromCharCode(255&(s<<7|u<<2|l>>>3))+String.fromCharCode(255&(l<<5|h));var b=p-g;return 2===b?(r=a[t.charAt(m++)],n=a[t.charAt(m++)],d+=String.fromCharCode(255&(r<<3|n>>>2))):4===b?(r=a[t.charAt(m++)],n=a[t.charAt(m++)],i=a[t.charAt(m++)],o=a[t.charAt(m++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))):5===b?(r=a[t.charAt(m++)],n=a[t.charAt(m++)],i=a[t.charAt(m++)],o=a[t.charAt(m++)],s=a[t.charAt(m++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))):7===b&&(r=a[t.charAt(m++)],n=a[t.charAt(m++)],i=a[t.charAt(m++)],o=a[t.charAt(m++)],s=a[t.charAt(m++)],u=a[t.charAt(m++)],l=a[t.charAt(m++)],d+=String.fromCharCode(255&(r<<3|n>>>2))+String.fromCharCode(255&(n<<6|i<<1|o>>>4))+String.fromCharCode(255&(o<<4|s>>>1))+String.fromCharCode(255&(s<<7|u<<2|l>>>3))),d},h={encode:function(t,e){var r="string"!=typeof t;return r&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),r?function(t){for(var e,r,n,i,o,a="",u=t.length,c=0,f=5*parseInt(u/5);c<f;)e=t[c++],r=t[c++],n=t[c++],i=t[c++],o=t[c++],a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[31&(n<<1|i>>>7)]+s[i>>>2&31]+s[31&(i<<3|o>>>5)]+s[31&o];var l=u-f;return 1===l?(e=t[c],a+=s[e>>>3]+s[e<<2&31]+"======"):2===l?(e=t[c++],r=t[c],a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[r<<4&31]+"===="):3===l?(e=t[c++],r=t[c++],n=t[c],a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[n<<1&31]+"==="):4===l&&(e=t[c++],r=t[c++],n=t[c++],i=t[c],a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[31&(n<<1|i>>>7)]+s[i>>>2&31]+s[i<<3&31]+"="),a}(t):e?function(t){for(var e,r,n,i,o,a="",u=t.length,c=0,f=5*parseInt(u/5);c<f;)e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),i=t.charCodeAt(c++),o=t.charCodeAt(c++),a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[31&(n<<1|i>>>7)]+s[i>>>2&31]+s[31&(i<<3|o>>>5)]+s[31&o];var l=u-f;return 1===l?(e=t.charCodeAt(c),a+=s[e>>>3]+s[e<<2&31]+"======"):2===l?(e=t.charCodeAt(c++),r=t.charCodeAt(c),a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[r<<4&31]+"===="):3===l?(e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c),a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[n<<1&31]+"==="):4===l&&(e=t.charCodeAt(c++),r=t.charCodeAt(c++),n=t.charCodeAt(c++),i=t.charCodeAt(c),a+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[31&(n<<1|i>>>7)]+s[i>>>2&31]+s[i<<3&31]+"="),a}(t):function(t){var e,r,n,i,o,a,c,f=!1,l="",h=0,d=0,p=t.length;if(""===t)return l;do{for(u[0]=u[5],u[1]=u[6],u[2]=u[7],c=d;h<p&&c<5;++h)(a=t.charCodeAt(h))<128?u[c++]=a:a<2048?(u[c++]=192|a>>6,u[c++]=128|63&a):a<55296||a>=57344?(u[c++]=224|a>>12,u[c++]=128|a>>6&63,u[c++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++h)),u[c++]=240|a>>18,u[c++]=128|a>>12&63,u[c++]=128|a>>6&63,u[c++]=128|63&a);d=c-5,h===p&&++h,h>p&&c<6&&(f=!0),e=u[0],c>4?(r=u[1],n=u[2],i=u[3],o=u[4],l+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[31&(n<<1|i>>>7)]+s[i>>>2&31]+s[31&(i<<3|o>>>5)]+s[31&o]):1===c?l+=s[e>>>3]+s[e<<2&31]+"======":2===c?(r=u[1],l+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[r<<4&31]+"===="):3===c?(r=u[1],n=u[2],l+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[n<<1&31]+"==="):(r=u[1],n=u[2],i=u[3],l+=s[e>>>3]+s[31&(e<<2|r>>>6)]+s[r>>>1&31]+s[31&(r<<4|n>>>4)]+s[31&(n<<1|i>>>7)]+s[i>>>2&31]+s[i<<3&31]+"=")}while(!f);return l}(t)},decode:l};l.asBytes=f,i?t.exports=h:(e.base32=h,o&&(void 0===(n=function(){return h}.call(h,r,h,t))||(t.exports=n)))}()},4525:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=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,f=(1<<c)-1,l=f>>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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*m}},3477:(module,exports,__nested_webpack_require_96669__)=>{var __WEBPACK_AMD_DEFINE_RESULT__;(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=__nested_webpack_require_96669__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__nested_webpack_require_96669__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];e[n]=createOutputMethod(n,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(r,n){return new HmacSha256(r,e,!0).update(n)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(e){return new HmacSha256(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];e[n]=createHmacOutputMethod(n,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,e,r){var n,i=typeof t;if("string"===i){var o,s=[],a=t.length,u=0;for(n=0;n<a;++n)(o=t.charCodeAt(n))<128?s[u++]=o:o<2048?(s[u++]=192|o>>6,s[u++]=128|63&o):o<55296||o>=57344?(s[u++]=224|o>>12,s[u++]=128|o>>6&63,s[u++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++n)),s[u++]=240|o>>18,s[u++]=128|o>>12&63,s[u++]=128|o>>6&63,s[u++]=128|63&o);t=s}else{if("object"!==i)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(e,!0).update(t).array());var c=[],f=[];for(n=0;n<64;++n){var l=t[n]||0;c[n]=92^l,f[n]=54^l}Sha256.call(this,e,r),this.update(f),this.oKeyPad=c,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(t){if(!this.finalized){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);e=!0}for(var n,i,o=0,s=t.length,a=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),e)for(i=this.start;o<s&&i<64;++o)a[i>>2]|=t[o]<<SHIFT[3&i++];else for(i=this.start;o<s&&i<64;++o)(n=t.charCodeAt(o))<128?a[i>>2]|=n<<SHIFT[3&i++]:n<2048?(a[i>>2]|=(192|n>>6)<<SHIFT[3&i++],a[i>>2]|=(128|63&n)<<SHIFT[3&i++]):n<55296||n>=57344?(a[i>>2]|=(224|n>>12)<<SHIFT[3&i++],a[i>>2]|=(128|n>>6&63)<<SHIFT[3&i++],a[i>>2]|=(128|63&n)<<SHIFT[3&i++]):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++o)),a[i>>2]|=(240|n>>18)<<SHIFT[3&i++],a[i>>2]|=(128|n>>12&63)<<SHIFT[3&i++],a[i>>2]|=(128|n>>6&63)<<SHIFT[3&i++],a[i>>2]|=(128|63&n)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=a[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,e,r,n,i,o,s,a,u,c=this.h0,f=this.h1,l=this.h2,h=this.h3,d=this.h4,p=this.h5,m=this.h6,g=this.h7,b=this.blocks;for(t=16;t<64;++t)e=((i=b[t-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=b[t-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,b[t]=b[t-16]+e+b[t-7]+r<<0;for(u=f&l,t=0;t<64;t+=4)this.first?(this.is224?(o=300032,g=(i=b[0]-1413257819)-150054599<<0,h=i+24177077<<0):(o=704751109,g=(i=b[0]-210244248)-1521486534<<0,h=i+143694565<<0),this.first=!1):(e=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),n=(o=c&f)^c&l^u,g=h+(i=g+(r=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&p^~d&m)+K[t]+b[t])<<0,h=i+(e+n)<<0),e=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),n=(s=h&c)^h&f^o,m=l+(i=m+(r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&d^~g&p)+K[t+1]+b[t+1])<<0,e=((l=i+(e+n)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),n=(a=l&h)^l&c^s,p=f+(i=p+(r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&d)+K[t+2]+b[t+2])<<0,e=((f=i+(e+n)<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(u=f&l)^f&h^a,d=c+(i=d+(r=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&m^~p&g)+K[t+3]+b[t+3])<<0,c=i+(e+n)<<0;this.h0=this.h0+c<<0,this.h1=this.h1+f<<0,this.h2=this.h2+l<<0,this.h3=this.h3+h<<0,this.h4=this.h4+d<<0,this.h5=this.h5+p<<0,this.h6=this.h6+m<<0,this.h7=this.h7+g<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,u=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s];return this.is224||(u+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),u},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,u=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||u.push(a>>24&255,a>>16&255,a>>8&255,255&a),u},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__nested_webpack_require_96669__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},583:(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,f=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="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],b=["hex","buffer","arrayBuffer","array","digest"],y={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!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 v=function(t,e,r){return function(n){return new O(t,e,t).update(n)[r]()}},w=function(t,e,r){return function(n,i){return new O(t,e,i).update(n)[r]()}},_=function(t,e,r){return function(e,n,i,o){return x["cshake"+t].update(e,n,i,o)[r]()}},A=function(t,e,r){return function(e,n,i,o){return x["kmac"+t].update(e,n,i,o)[r]()}},E=function(t,e,r,n){for(var i=0;i<b.length;++i){var o=b[i];t[o]=e(r,n,o)}return t},S=function(t,e){var r=v(t,e,"hex");return r.create=function(){return new O(t,e,t)},r.update=function(t){return r.create().update(t)},E(r,v,t,e)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:m,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:m,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(t,e){var r=w(t,e,"hex");return r.create=function(r){return new O(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},E(r,w,t,e)}},{name:"cshake",padding:h,bits:g,createMethod:function(t,e){var r=y[t],n=_(t,0,"hex");return n.create=function(n,i,o){return i||o?new O(t,e,n).bytepad([i,o],r):x["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},E(n,_,t,e)}},{name:"kmac",padding:h,bits:g,createMethod:function(t,e){var r=y[t],n=A(t,0,"hex");return n.create=function(n,i,o){return new P(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},E(n,A,t,e)}}],x={},k=[],T=0;T<M.length;++T)for(var I=M[T],C=I.bits,R=0;R<C.length;++R){var B=I.name+"_"+C[R];if(k.push(B),x[B]=I.createMethod(C[R],I.padding),"sha3"!==I.name){var N=I.name+C[R];k.push(N),x[N]=x[B]}}function O(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>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 P(t,e,r){O.call(this,t,e,r)}O.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(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&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,l=0,h=this.s;l<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(e)for(n=this.start;l<u&&n<a;++l)s[n>>2]|=t[l]<<d[3&n++];else for(n=this.start;l<u&&n<a;++l)(o=t.charCodeAt(l))<128?s[n>>2]|=o<<d[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<d[3&n++],s[n>>2]|=(128|o>>6&63)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),s[n>>2]|=(240|o>>18)<<d[3&n++],s[n>>2]|=(128|o>>12&63)<<d[3&n++],s[n>>2]|=(128|o>>6&63)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)h[n]^=s[n];D(h),this.reset=!0}else this.start=n}return this},O.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},O.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(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&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<t.length;++s){var a=t.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},O.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];D(n)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<e&&s<n;++o,++s)t=r[o],a+=l[t>>4&15]+l[15&t]+l[t>>12&15]+l[t>>8&15]+l[t>>20&15]+l[t>>16&15]+l[t>>28&15]+l[t>>24&15];s%e==0&&(D(r),o=0)}return i&&(t=r[o],a+=l[t>>4&15]+l[15&t],i>1&&(a+=l[t>>12&15]+l[t>>8&15]),i>2&&(a+=l[t>>20&15]+l[t>>16&15])),a},O.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<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&D(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&D(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},P.prototype=new O,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var D=function(t){var e,r,n,i,o,s,a,u,c,f,l,h,d,m,g,b,y,v,w,_,A,E,S,M,x,k,T,I,C,R,B,N,O,P,D,L,U,j,F,q,z,H,K,G,W,V,$,X,Y,J,Z,Q,tt,et,rt,nt,it,ot,st,at,ut,ct,ft;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],f=t[6]^t[16]^t[26]^t[36]^t[46],l=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^(f<<1|l>>>31),r=a^(l<<1|f>>>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=f^(i<<1|o>>>31),r=l^(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,$=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,C=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,P=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,X=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,B=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,N=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,j=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,Q=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,k=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,q=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~b&v,t[1]=g^~y&w,t[10]=M^~k&I,t[11]=x^~T&C,t[20]=P^~L&j,t[21]=D^~U&F,t[30]=G^~V&X,t[31]=W^~$&Y,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=b^~v&_,t[3]=y^~w&A,t[12]=k^~I&R,t[13]=T^~C&B,t[22]=L^~j&q,t[23]=U^~F&z,t[32]=V^~X&J,t[33]=$^~Y&Z,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=v^~_&E,t[5]=w^~A&S,t[14]=I^~R&N,t[15]=C^~B&O,t[24]=j^~q&H,t[25]=F^~z&K,t[34]=X^~J&Q,t[35]=Y^~Z&tt,t[44]=ot^~at&ct,t[45]=st^~ut&ft,t[6]=_^~E&m,t[7]=A^~S&g,t[16]=R^~N&M,t[17]=B^~O&x,t[26]=q^~H&P,t[27]=z^~K&D,t[36]=J^~Q&G,t[37]=Z^~tt&W,t[46]=at^~ct&et,t[47]=ut^~ft&rt,t[8]=E^~m&b,t[9]=S^~g&y,t[18]=N^~M&k,t[19]=O^~x&T,t[28]=H^~P&L,t[29]=K^~D&U,t[38]=Q^~G&V,t[39]=tt^~W&$,t[48]=ct^~et&nt,t[49]=ft^~rt&it,t[0]^=p[n],t[1]^=p[n+1]};if(u)t.exports=x;else{for(T=0;T<k.length;++T)s[k[T]]=x[k[T]];c&&(void 0===(n=function(){return x}.call(e,r,e,t))||(t.exports=n))}}()},9757:(t,e,r)=>{var n;!function(){"use strict";var e="input is invalid type",i="object"==typeof window,o=i?window:{};o.JS_SHA512_NO_WINDOW&&(i=!1);var s=!i&&"object"==typeof self;!o.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=r.g:s&&(o=self);var a=!o.JS_SHA512_NO_COMMON_JS&&t.exports,u=r.amdO,c=!o.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],h=[24,16,8,0],d=[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],p=["hex","array","digest","arrayBuffer"],m=[];!o.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!o.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var g=function(t,e){return function(r){return new w(e,!0).update(r)[t]()}},b=function(t){var e=g("hex",t);e.create=function(){return new w(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<p.length;++r){var n=p[r];e[n]=g(n,t)}return e},y=function(t,e){return function(r,n){return new _(r,e,!0).update(n)[t]()}},v=function(t){var e=y("hex",t);e.create=function(e){return new _(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<p.length;++r){var n=p[r];e[n]=y(n,t)}return e};function w(t,e){e?(m[0]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=m[16]=m[17]=m[18]=m[19]=m[20]=m[21]=m[22]=m[23]=m[24]=m[25]=m[26]=m[27]=m[28]=m[29]=m[30]=m[31]=m[32]=0,this.blocks=m):this.blocks=[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],384==t?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==t?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==t?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=t,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function _(t,r,n){var i,o=typeof t;if("string"!==o){if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(e);i=!0}var s=t.length;if(!i){for(var a,u=[],f=(s=t.length,0),l=0;l<s;++l)(a=t.charCodeAt(l))<128?u[f++]=a:a<2048?(u[f++]=192|a>>6,u[f++]=128|63&a):a<55296||a>=57344?(u[f++]=224|a>>12,u[f++]=128|a>>6&63,u[f++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++l)),u[f++]=240|a>>18,u[f++]=128|a>>12&63,u[f++]=128|a>>6&63,u[f++]=128|63&a);t=u}t.length>128&&(t=new w(r,!0).update(t).array());var h=[],d=[];for(l=0;l<128;++l){var p=t[l]||0;h[l]=92^p,d[l]=54^p}w.call(this,r,n),this.update(d),this.oKeyPad=h,this.inner=!0,this.sharedMemory=n}w.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,s=0,a=t.length,u=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=u[16]=u[17]=u[18]=u[19]=u[20]=u[21]=u[22]=u[23]=u[24]=u[25]=u[26]=u[27]=u[28]=u[29]=u[30]=u[31]=u[32]=0),r)for(o=this.start;s<a&&o<128;++s)u[o>>2]|=t[s]<<h[3&o++];else for(o=this.start;s<a&&o<128;++s)(i=t.charCodeAt(s))<128?u[o>>2]|=i<<h[3&o++]:i<2048?(u[o>>2]|=(192|i>>6)<<h[3&o++],u[o>>2]|=(128|63&i)<<h[3&o++]):i<55296||i>=57344?(u[o>>2]|=(224|i>>12)<<h[3&o++],u[o>>2]|=(128|i>>6&63)<<h[3&o++],u[o>>2]|=(128|63&i)<<h[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++s)),u[o>>2]|=(240|i>>18)<<h[3&o++],u[o>>2]|=(128|i>>12&63)<<h[3&o++],u[o>>2]|=(128|i>>6&63)<<h[3&o++],u[o>>2]|=(128|63&i)<<h[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=128?(this.block=u[32],this.start=o-128,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[32]=this.block,t[e>>2]|=l[3&e],this.block=t[32],e>=112&&(this.hashed||this.hash(),t[0]=this.block,t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=t[16]=t[17]=t[18]=t[19]=t[20]=t[21]=t[22]=t[23]=t[24]=t[25]=t[26]=t[27]=t[28]=t[29]=t[30]=t[31]=t[32]=0),t[30]=this.hBytes<<3|this.bytes>>>29,t[31]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var t,e,r,n,i,o,s,a,u,c,f,l,h,p,m,g,b,y,v,w,_,A,E,S,M,x=this.h0h,k=this.h0l,T=this.h1h,I=this.h1l,C=this.h2h,R=this.h2l,B=this.h3h,N=this.h3l,O=this.h4h,P=this.h4l,D=this.h5h,L=this.h5l,U=this.h6h,j=this.h6l,F=this.h7h,q=this.h7l,z=this.blocks;for(t=32;t<160;t+=2)e=((w=z[t-30])>>>1|(_=z[t-29])<<31)^(w>>>8|_<<24)^w>>>7,r=(_>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25),n=((w=z[t-4])>>>19|(_=z[t-3])<<13)^(_>>>29|w<<3)^w>>>6,i=(_>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26),w=z[t-32],_=z[t-31],u=((A=z[t-14])>>>16)+(w>>>16)+(e>>>16)+(n>>>16)+((a=(65535&A)+(65535&w)+(65535&e)+(65535&n)+((s=((E=z[t-13])>>>16)+(_>>>16)+(r>>>16)+(i>>>16)+((o=(65535&E)+(65535&_)+(65535&r)+(65535&i))>>>16))>>>16))>>>16),z[t]=u<<16|65535&a,z[t+1]=s<<16|65535&o;var H=x,K=k,G=T,W=I,V=C,$=R,X=B,Y=N,J=O,Z=P,Q=D,tt=L,et=U,rt=j,nt=F,it=q;for(g=G&V,b=W&$,t=0;t<160;t+=8)e=(H>>>28|K<<4)^(K>>>2|H<<30)^(K>>>7|H<<25),r=(K>>>28|H<<4)^(H>>>2|K<<30)^(H>>>7|K<<25),n=(J>>>14|Z<<18)^(J>>>18|Z<<14)^(Z>>>9|J<<23),i=(Z>>>14|J<<18)^(Z>>>18|J<<14)^(J>>>9|Z<<23),y=(c=H&G)^H&V^g,v=(f=K&W)^K&$^b,S=J&Q^~J&et,M=Z&tt^~Z&rt,w=z[t],_=z[t+1],w=(u=((A=d[t])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(nt>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&nt)+((s=((E=d[t+1])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(it>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&it))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,nt=(u=(X>>>16)+(w>>>16)+((a=(65535&X)+(65535&w)+((s=(Y>>>16)+(_>>>16)+((o=(65535&Y)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,it=s<<16|65535&o,e=((X=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|(Y=s<<16|65535&o)<<4)^(Y>>>2|X<<30)^(Y>>>7|X<<25),r=(Y>>>28|X<<4)^(X>>>2|Y<<30)^(X>>>7|Y<<25),n=(nt>>>14|it<<18)^(nt>>>18|it<<14)^(it>>>9|nt<<23),i=(it>>>14|nt<<18)^(it>>>18|nt<<14)^(nt>>>9|it<<23),y=(l=X&H)^X&G^c,v=(h=Y&K)^Y&W^f,S=nt&J^~nt&Q,M=it&Z^~it&tt,w=z[t+2],_=z[t+3],w=(u=((A=d[t+2])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(et>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&et)+((s=((E=d[t+3])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(rt>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&rt))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,et=(u=(V>>>16)+(w>>>16)+((a=(65535&V)+(65535&w)+((s=($>>>16)+(_>>>16)+((o=(65535&$)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,rt=s<<16|65535&o,e=((V=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|($=s<<16|65535&o)<<4)^($>>>2|V<<30)^($>>>7|V<<25),r=($>>>28|V<<4)^(V>>>2|$<<30)^(V>>>7|$<<25),n=(et>>>14|rt<<18)^(et>>>18|rt<<14)^(rt>>>9|et<<23),i=(rt>>>14|et<<18)^(rt>>>18|et<<14)^(et>>>9|rt<<23),y=(p=V&X)^V&H^l,v=(m=$&Y)^$&K^h,S=et&nt^~et&J,M=rt&it^~rt&Z,w=z[t+4],_=z[t+5],w=(u=((A=d[t+4])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(Q>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&Q)+((s=((E=d[t+5])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(tt>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&tt))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,Q=(u=(G>>>16)+(w>>>16)+((a=(65535&G)+(65535&w)+((s=(W>>>16)+(_>>>16)+((o=(65535&W)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,tt=s<<16|65535&o,e=((G=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|(W=s<<16|65535&o)<<4)^(W>>>2|G<<30)^(W>>>7|G<<25),r=(W>>>28|G<<4)^(G>>>2|W<<30)^(G>>>7|W<<25),n=(Q>>>14|tt<<18)^(Q>>>18|tt<<14)^(tt>>>9|Q<<23),i=(tt>>>14|Q<<18)^(tt>>>18|Q<<14)^(Q>>>9|tt<<23),y=(g=G&V)^G&X^p,v=(b=W&$)^W&Y^m,S=Q&et^~Q&nt,M=tt&rt^~tt&it,w=z[t+6],_=z[t+7],w=(u=((A=d[t+6])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(J>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&J)+((s=((E=d[t+7])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(Z>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,J=(u=(H>>>16)+(w>>>16)+((a=(65535&H)+(65535&w)+((s=(K>>>16)+(_>>>16)+((o=(65535&K)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,Z=s<<16|65535&o,H=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,K=s<<16|65535&o;u=(x>>>16)+(H>>>16)+((a=(65535&x)+(65535&H)+((s=(k>>>16)+(K>>>16)+((o=(65535&k)+(65535&K))>>>16))>>>16))>>>16),this.h0h=u<<16|65535&a,this.h0l=s<<16|65535&o,u=(T>>>16)+(G>>>16)+((a=(65535&T)+(65535&G)+((s=(I>>>16)+(W>>>16)+((o=(65535&I)+(65535&W))>>>16))>>>16))>>>16),this.h1h=u<<16|65535&a,this.h1l=s<<16|65535&o,u=(C>>>16)+(V>>>16)+((a=(65535&C)+(65535&V)+((s=(R>>>16)+($>>>16)+((o=(65535&R)+(65535&$))>>>16))>>>16))>>>16),this.h2h=u<<16|65535&a,this.h2l=s<<16|65535&o,u=(B>>>16)+(X>>>16)+((a=(65535&B)+(65535&X)+((s=(N>>>16)+(Y>>>16)+((o=(65535&N)+(65535&Y))>>>16))>>>16))>>>16),this.h3h=u<<16|65535&a,this.h3l=s<<16|65535&o,u=(O>>>16)+(J>>>16)+((a=(65535&O)+(65535&J)+((s=(P>>>16)+(Z>>>16)+((o=(65535&P)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=u<<16|65535&a,this.h4l=s<<16|65535&o,u=(D>>>16)+(Q>>>16)+((a=(65535&D)+(65535&Q)+((s=(L>>>16)+(tt>>>16)+((o=(65535&L)+(65535&tt))>>>16))>>>16))>>>16),this.h5h=u<<16|65535&a,this.h5l=s<<16|65535&o,u=(U>>>16)+(et>>>16)+((a=(65535&U)+(65535&et)+((s=(j>>>16)+(rt>>>16)+((o=(65535&j)+(65535&rt))>>>16))>>>16))>>>16),this.h6h=u<<16|65535&a,this.h6l=s<<16|65535&o,u=(F>>>16)+(nt>>>16)+((a=(65535&F)+(65535&nt)+((s=(q>>>16)+(it>>>16)+((o=(65535&q)+(65535&it))>>>16))>>>16))>>>16),this.h7h=u<<16|65535&a,this.h7l=s<<16|65535&o},w.prototype.hex=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,s=this.h3h,a=this.h3l,u=this.h4h,c=this.h4l,l=this.h5h,h=this.h5l,d=this.h6h,p=this.h6l,m=this.h7h,g=this.h7l,b=this.bits,y=f[t>>28&15]+f[t>>24&15]+f[t>>20&15]+f[t>>16&15]+f[t>>12&15]+f[t>>8&15]+f[t>>4&15]+f[15&t]+f[e>>28&15]+f[e>>24&15]+f[e>>20&15]+f[e>>16&15]+f[e>>12&15]+f[e>>8&15]+f[e>>4&15]+f[15&e]+f[r>>28&15]+f[r>>24&15]+f[r>>20&15]+f[r>>16&15]+f[r>>12&15]+f[r>>8&15]+f[r>>4&15]+f[15&r]+f[n>>28&15]+f[n>>24&15]+f[n>>20&15]+f[n>>16&15]+f[n>>12&15]+f[n>>8&15]+f[n>>4&15]+f[15&n]+f[i>>28&15]+f[i>>24&15]+f[i>>20&15]+f[i>>16&15]+f[i>>12&15]+f[i>>8&15]+f[i>>4&15]+f[15&i]+f[o>>28&15]+f[o>>24&15]+f[o>>20&15]+f[o>>16&15]+f[o>>12&15]+f[o>>8&15]+f[o>>4&15]+f[15&o]+f[s>>28&15]+f[s>>24&15]+f[s>>20&15]+f[s>>16&15]+f[s>>12&15]+f[s>>8&15]+f[s>>4&15]+f[15&s];return b>=256&&(y+=f[a>>28&15]+f[a>>24&15]+f[a>>20&15]+f[a>>16&15]+f[a>>12&15]+f[a>>8&15]+f[a>>4&15]+f[15&a]),b>=384&&(y+=f[u>>28&15]+f[u>>24&15]+f[u>>20&15]+f[u>>16&15]+f[u>>12&15]+f[u>>8&15]+f[u>>4&15]+f[15&u]+f[c>>28&15]+f[c>>24&15]+f[c>>20&15]+f[c>>16&15]+f[c>>12&15]+f[c>>8&15]+f[c>>4&15]+f[15&c]+f[l>>28&15]+f[l>>24&15]+f[l>>20&15]+f[l>>16&15]+f[l>>12&15]+f[l>>8&15]+f[l>>4&15]+f[15&l]+f[h>>28&15]+f[h>>24&15]+f[h>>20&15]+f[h>>16&15]+f[h>>12&15]+f[h>>8&15]+f[h>>4&15]+f[15&h]),512==b&&(y+=f[d>>28&15]+f[d>>24&15]+f[d>>20&15]+f[d>>16&15]+f[d>>12&15]+f[d>>8&15]+f[d>>4&15]+f[15&d]+f[p>>28&15]+f[p>>24&15]+f[p>>20&15]+f[p>>16&15]+f[p>>12&15]+f[p>>8&15]+f[p>>4&15]+f[15&p]+f[m>>28&15]+f[m>>24&15]+f[m>>20&15]+f[m>>16&15]+f[m>>12&15]+f[m>>8&15]+f[m>>4&15]+f[15&m]+f[g>>28&15]+f[g>>24&15]+f[g>>20&15]+f[g>>16&15]+f[g>>12&15]+f[g>>8&15]+f[g>>4&15]+f[15&g]),y},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,s=this.h3h,a=this.h3l,u=this.h4h,c=this.h4l,f=this.h5h,l=this.h5l,h=this.h6h,d=this.h6l,p=this.h7h,m=this.h7l,g=this.bits,b=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s];return g>=256&&b.push(a>>24&255,a>>16&255,a>>8&255,255&a),g>=384&&b.push(u>>24&255,u>>16&255,u>>8&255,255&u,c>>24&255,c>>16&255,c>>8&255,255&c,f>>24&255,f>>16&255,f>>8&255,255&f,l>>24&255,l>>16&255,l>>8&255,255&l),512==g&&b.push(h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,p>>24&255,p>>16&255,p>>8&255,255&p,m>>24&255,m>>16&255,m>>8&255,255&m),b},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var t=this.bits,e=new ArrayBuffer(t/8),r=new DataView(e);return r.setUint32(0,this.h0h),r.setUint32(4,this.h0l),r.setUint32(8,this.h1h),r.setUint32(12,this.h1l),r.setUint32(16,this.h2h),r.setUint32(20,this.h2l),r.setUint32(24,this.h3h),t>=256&&r.setUint32(28,this.h3l),t>=384&&(r.setUint32(32,this.h4h),r.setUint32(36,this.h4l),r.setUint32(40,this.h5h),r.setUint32(44,this.h5l)),512==t&&(r.setUint32(48,this.h6h),r.setUint32(52,this.h6l),r.setUint32(56,this.h7h),r.setUint32(60,this.h7l)),e},w.prototype.clone=function(){var t=new w(this.bits,!1);return this.copyTo(t),t},w.prototype.copyTo=function(t){var e=0,r=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(e=0;e<r.length;++e)t[r[e]]=this[r[e]];for(e=0;e<this.blocks.length;++e)t.blocks[e]=this.blocks[e]},_.prototype=new w,_.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();w.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(t),w.prototype.finalize.call(this)}},_.prototype.clone=function(){var t=new _([],this.bits,!1);this.copyTo(t),t.inner=this.inner;for(var e=0;e<this.oKeyPad.length;++e)t.oKeyPad[e]=this.oKeyPad[e];return t};var A=b(512);A.sha512=A,A.sha384=b(384),A.sha512_256=b(256),A.sha512_224=b(224),A.sha512.hmac=v(512),A.sha384.hmac=v(384),A.sha512_256.hmac=v(256),A.sha512_224.hmac=v(224),a?t.exports=A:(o.sha512=A.sha512,o.sha384=A.sha384,o.sha512_256=A.sha512_256,o.sha512_224=A.sha512_224,u&&(void 0===(n=function(){return A}.call(A,r,A,t))||(t.exports=n)))}()},4360:(t,e,r)=>{var n=r(592).stringify,i=r(9385);t.exports=function(t){return{parse:i(t),stringify:n}},t.exports.parse=i(),t.exports.stringify=n},9385:(t,e,r)=>{var n=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,o=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;t.exports=function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=t){if(!0===t.strict&&(e.strict=!0),!0===t.storeAsString&&(e.storeAsString=!0),e.alwaysParseAsBig=!0===t.alwaysParseAsBig&&t.alwaysParseAsBig,e.useNativeBigInt=!0===t.useNativeBigInt&&t.useNativeBigInt,void 0!==t.constructorAction){if("error"!==t.constructorAction&&"ignore"!==t.constructorAction&&"preserve"!==t.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);e.constructorAction=t.constructorAction}if(void 0!==t.protoAction){if("error"!==t.protoAction&&"ignore"!==t.protoAction&&"preserve"!==t.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`);e.protoAction=t.protoAction}}var s,a,u,c,f={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},l=function(t){throw{name:"SyntaxError",message:t,at:s,text:u}},h=function(t){return t&&t!==a&&l("Expected '"+t+"' instead of '"+a+"'"),a=u.charAt(s),s+=1,a},d=function(){var t,i="";for("-"===a&&(i="-",h("-"));a>="0"&&a<="9";)i+=a,h();if("."===a)for(i+=".";h()&&a>="0"&&a<="9";)i+=a;if("e"===a||"E"===a)for(i+=a,h(),"-"!==a&&"+"!==a||(i+=a,h());a>="0"&&a<="9";)i+=a,h();if(t=+i,isFinite(t))return null==n&&(n=r(5117)),i.length>15?e.storeAsString?i:e.useNativeBigInt?BigInt(i):new n(i):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(t):new n(t):t;l("Bad number")},p=function(){var t,e,r,n="";if('"'===a)for(var i=s;h();){if('"'===a)return s-1>i&&(n+=u.substring(i,s-1)),h(),n;if("\\"===a){if(s-1>i&&(n+=u.substring(i,s-1)),h(),"u"===a){for(r=0,e=0;e<4&&(t=parseInt(h(),16),isFinite(t));e+=1)r=16*r+t;n+=String.fromCharCode(r)}else{if("string"!=typeof f[a])break;n+=f[a]}i=s}}l("Bad string")},m=function(){for(;a&&a<=" ";)h()};return c=function(){switch(m(),a){case"{":return function(){var t,r=Object.create(null);if("{"===a){if(h("{"),m(),"}"===a)return h("}"),r;for(;a;){if(t=p(),m(),h(":"),!0===e.strict&&Object.hasOwnProperty.call(r,t)&&l('Duplicate key "'+t+'"'),!0===i.test(t)?"error"===e.protoAction?l("Object contains forbidden prototype property"):"ignore"===e.protoAction?c():r[t]=c():!0===o.test(t)?"error"===e.constructorAction?l("Object contains forbidden constructor property"):"ignore"===e.constructorAction?c():r[t]=c():r[t]=c(),m(),"}"===a)return h("}"),r;h(","),m()}}l("Bad object")}();case"[":return function(){var t=[];if("["===a){if(h("["),m(),"]"===a)return h("]"),t;for(;a;){if(t.push(c()),m(),"]"===a)return h("]"),t;h(","),m()}}l("Bad array")}();case'"':return p();case"-":return d();default:return a>="0"&&a<="9"?d():function(){switch(a){case"t":return h("t"),h("r"),h("u"),h("e"),!0;case"f":return h("f"),h("a"),h("l"),h("s"),h("e"),!1;case"n":return h("n"),h("u"),h("l"),h("l"),null}l("Unexpected '"+a+"'")}()}},function(t,e){var r;return u=t+"",s=0,a=" ",r=c(),m(),a&&l("Syntax error"),"function"==typeof e?function t(r,n){var i,o=r[n];return o&&"object"==typeof o&&Object.keys(o).forEach((function(e){void 0!==(i=t(o,e))?o[e]=i:delete o[e]})),e.call(r,n,o)}({"":r},""):r}}},592:(t,e,r)=>{var n=r(5117),i=t.exports;!function(){"use strict";var t,e,r,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(t){return o.lastIndex=0,o.test(t)?'"'+t.replace(o,(function(t){var e=s[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}function u(i,o){var s,c,f,l,h,d=t,p=o[i],m=null!=p&&(p instanceof n||n.isBigNumber(p));switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(i)),"function"==typeof r&&(p=r.call(o,i,p)),typeof p){case"string":return m?p:a(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":case"bigint":return String(p);case"object":if(!p)return"null";if(t+=e,h=[],"[object Array]"===Object.prototype.toString.apply(p)){for(l=p.length,s=0;s<l;s+=1)h[s]=u(s,p)||"null";return f=0===h.length?"[]":t?"[\n"+t+h.join(",\n"+t)+"\n"+d+"]":"["+h.join(",")+"]",t=d,f}if(r&&"object"==typeof r)for(l=r.length,s=0;s<l;s+=1)"string"==typeof r[s]&&(f=u(c=r[s],p))&&h.push(a(c)+(t?": ":":")+f);else Object.keys(p).forEach((function(e){var r=u(e,p);r&&h.push(a(e)+(t?": ":":")+r)}));return f=0===h.length?"{}":t?"{\n"+t+h.join(",\n"+t)+"\n"+d+"}":"{"+h.join(",")+"}",t=d,f}}"function"!=typeof i.stringify&&(i.stringify=function(n,i,o){var s;if(t="",e="","number"==typeof o)for(s=0;s<o;s+=1)e+=" ";else"string"==typeof o&&(e=o);if(r=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return u("",{"":n})})}()},3126:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&u&&"function"==typeof u.get?u.get:null,f=a&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,b=String.prototype.match,y="function"==typeof BigInt?BigInt.prototype.valueOf:null,v=Object.getOwnPropertySymbols,w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,_="function"==typeof Symbol&&"object"==typeof Symbol.iterator,A=Object.prototype.propertyIsEnumerable,E=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),S=r(4654).custom,M=S&&C(S)?S:null,x="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null;function k(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function T(t){return String(t).replace(/"/g,"&quot;")}function I(t){return!("[object Array]"!==N(t)||x&&"object"==typeof t&&x in t)}function C(t){if(_)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!w)return!1;try{return w.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,i){var a=r||{};if(B(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(B(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!B(a,"customInspect")||a.customInspect;if("boolean"!=typeof u)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(B(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return P(e,a);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var m=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=m&&m>0&&"object"==typeof e)return I(e)?"[Array]":"[Object]";var v,A=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=Array(t.indent+1).join(" ")}return{base:r,prev:Array(e+1).join(r)}}(a,n);if(void 0===i)i=[];else if(O(i,e)>=0)return"[Circular]";function S(e,r,o){if(r&&(i=i.slice()).push(r),o){var s={depth:a.depth};return B(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),t(e,s,n+1,i)}return t(e,a,n+1,i)}if("function"==typeof e){var R=function(t){if(t.name)return t.name;var e=b.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),D=q(e,S);return"[Function"+(R?": "+R:" (anonymous)")+"]"+(D.length>0?" { "+D.join(", ")+" }":"")}if(C(e)){var z=_?String(e).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):w.call(e);return"object"!=typeof e||_?z:L(z)}if((v=e)&&"object"==typeof v&&("undefined"!=typeof HTMLElement&&v instanceof HTMLElement||"string"==typeof v.nodeName&&"function"==typeof v.getAttribute)){for(var H="<"+String(e.nodeName).toLowerCase(),K=e.attributes||[],G=0;G<K.length;G++)H+=" "+K[G].name+"="+k(T(K[G].value),"double",a);return H+=">",e.childNodes&&e.childNodes.length&&(H+="..."),H+"</"+String(e.nodeName).toLowerCase()+">"}if(I(e)){if(0===e.length)return"[]";var W=q(e,S);return A&&!function(t){for(var e=0;e<t.length;e++)if(O(t[e],"\n")>=0)return!1;return!0}(W)?"["+F(W,A)+"]":"[ "+W.join(", ")+" ]"}if(function(t){return!("[object Error]"!==N(t)||x&&"object"==typeof t&&x in t)}(e)){var V=q(e,S);return 0===V.length?"["+String(e)+"]":"{ ["+String(e)+"] "+V.join(", ")+" }"}if("object"==typeof e&&u){if(M&&"function"==typeof e[M])return e[M]();if("function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var $=[];return s.call(e,(function(t,r){$.push(S(r,e,!0)+" => "+S(t,e))})),j("Map",o.call(e),$,A)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var X=[];return f.call(e,(function(t){X.push(S(t,e))})),j("Set",c.call(e),X,A)}if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t,l);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return U("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{l.call(t,l)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return U("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return U("WeakRef");if(function(t){return!("[object Number]"!==N(t)||x&&"object"==typeof t&&x in t)}(e))return L(S(Number(e)));if(function(t){if(!t||"object"!=typeof t||!y)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return L(S(y.call(e)));if(function(t){return!("[object Boolean]"!==N(t)||x&&"object"==typeof t&&x in t)}(e))return L(p.call(e));if(function(t){return!("[object String]"!==N(t)||x&&"object"==typeof t&&x in t)}(e))return L(S(String(e)));if(!function(t){return!("[object Date]"!==N(t)||x&&"object"==typeof t&&x in t)}(e)&&!function(t){return!("[object RegExp]"!==N(t)||x&&"object"==typeof t&&x in t)}(e)){var Y=q(e,S),J=E?E(e)===Object.prototype:e instanceof Object||e.constructor===Object,Z=e instanceof Object?"":"null prototype",Q=!J&&x&&Object(e)===e&&x in e?N(e).slice(8,-1):Z?"Object":"",tt=(J||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(Q||Z?"["+[].concat(Q||[],Z||[]).join(": ")+"] ":"");return 0===Y.length?tt+"{}":A?tt+"{"+F(Y,A)+"}":tt+"{ "+Y.join(", ")+" }"}return String(e)};var R=Object.prototype.hasOwnProperty||function(t){return t in this};function B(t,e){return R.call(t,e)}function N(t){return m.call(t)}function O(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function P(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return P(t.slice(0,e.maxStringLength),e)+n}return k(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,D),"single",e)}function D(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+e.toString(16).toUpperCase()}function L(t){return"Object("+t+")"}function U(t){return t+" { ? }"}function j(t,e,r,n){return t+" ("+e+") {"+(n?F(r,n):r.join(", "))+"}"}function F(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+t.join(","+r)+"\n"+e.prev}function q(t,e){var r=I(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=B(t,i)?e(t[i],t):""}var o,s="function"==typeof v?v(t):[];if(_){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var u in t)B(t,u)&&(r&&String(Number(u))===u&&u<t.length||_&&o["$"+u]instanceof Symbol||(/[^\w$]/.test(u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if("function"==typeof v)for(var c=0;c<s.length;c++)A.call(t,s[c])&&n.push("["+e(s[c])+"]: "+e(t[s[c]],t));return n}},9368:t=>{"use strict";function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function r(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var t,n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===t&&(t=process.cwd()),s=t),e(s),0!==s.length&&(n=s+"/"+n,i=47===s.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=r(t,!n)).length||n||(t="."),t.length>0&&i&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r)return"";if((t=n.resolve(t))===(r=n.resolve(r)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var o=t.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var u=r.length-a,c=s<u?s:u,f=-1,l=0;l<=c;++l){if(l===c){if(u>c){if(47===r.charCodeAt(a+l))return r.slice(a+l+1);if(0===l)return r.slice(a+l)}else s>c&&(47===t.charCodeAt(i+l)?f=l:0===l&&(f=0));break}var h=t.charCodeAt(i+l);if(h!==r.charCodeAt(a+l))break;47===h&&(f=l)}var d="";for(l=i+f+1;l<=o;++l)l!==o&&47!==t.charCodeAt(l)||(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+f):(a+=f,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,i=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(r=t.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var a=r.length-1,u=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===u&&(s=!1,u=n+1),a>=0&&(c===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=u))}return i===o?o=u:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":t.slice(i,o)},extname:function(t){e(t);for(var r=-1,n=0,i=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===i&&(o=!1,i=a+1),46===u?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":t.slice(r,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,i=t.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,u=-1,c=!0,f=t.length-1,l=0;f>=n;--f)if(47!==(i=t.charCodeAt(f)))-1===u&&(c=!1,u=f+1),46===i?-1===s?s=f:1!==l&&(l=1):-1!==s&&(l=-1);else if(!c){a=f+1;break}return-1===s||-1===u||0===l||1===l&&s===u-1&&s===a+1?-1!==u&&(r.base=r.name=0===a&&o?t.slice(1,u):t.slice(a,u)):(0===a&&o?(r.name=t.slice(1,s),r.base=t.slice(1,u)):(r.name=t.slice(a,s),r.base=t.slice(a,u)),r.ext=t.slice(s,u)),a>0?r.dir=t.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n},9370:(t,e)=>{"use strict";var r=Object.prototype.hasOwnProperty;function n(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function i(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var n,o,s=[];for(o in"string"!=typeof e&&(e="?"),t)if(r.call(t,o)){if((n=t[o])||null!=n&&!isNaN(n)||(n=""),o=i(o),n=i(n),null===o||null===n)continue;s.push(o+"="+n)}return s.length?e+s.join("&"):""},e.parse=function(t){for(var e,r=/([^=?#&]+)=?([^&]*)/g,i={};e=r.exec(t);){var o=n(e[1]),s=n(e[2]);null===o||null===s||o in i||(i[o]=s)}return i}},1926:t=>{"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},3680:(t,e,r)=>{"use strict";var n=r(1801),i=r(7615),o=r(3126),s=n("%TypeError%"),a=n("%WeakMap%",!0),u=n("%Map%",!0),c=i("WeakMap.prototype.get",!0),f=i("WeakMap.prototype.set",!0),l=i("WeakMap.prototype.has",!0),h=i("Map.prototype.get",!0),d=i("Map.prototype.set",!0),p=i("Map.prototype.has",!0),m=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new s("Side channel does not contain "+o(t))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return h(e,n)}else if(r)return function(t,e){var r=m(t,e);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return l(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){return!!m(t,e)}(r,n);return!1},set:function(n,i){a&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new a),f(t,n,i)):u?(e||(e=new u),d(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=m(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n}},2858:t=>{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(t){r.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}})),r.prototype._setDefaults=function(t){this._defaults.forEach((function(r){var n;t[r.fn].apply(t,function(t){if(Array.isArray(t))return e(t)}(n=r.args)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(n)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}))},t.exports=r},5391:(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})(t)}var i;"undefined"!=typeof window?i=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),i=void 0):i=self;var o=r(1069),s=r(5799),a=r(3065),u=r(4287),c=r(1960),f=r(969),l=r(2858);function h(){}t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var d=e=t.exports;e.Request=w,d.getXHR=function(){if(i.XMLHttpRequest&&(!i.location||"file:"!==i.location.protocol||!i.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function m(t){if(!c(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&g(e,r,t[r]);return e.join("&")}function g(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){g(t,e,r)}));else if(c(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&g(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function b(t){for(var e,r,n={},i=t.split("&"),o=0,s=i.length;o<s;++o)-1===(r=(e=i[o]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function y(t){return/[/+]json($|[^-\w])/i.test(t)}function v(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,i,o=t.split(/\r?\n/),s={},a=0,u=o.length;a<u;++a)-1!==(e=(r=o[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),i=p(r.slice(e+1)),s[n]=i);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function w(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new v(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}function _(t,e,r){var n=d("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}d.serializeObject=m,d.parseString=b,d.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},d.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":s},d.parse={"application/x-www-form-urlencoded":b,"application/json":JSON.parse},f(v.prototype),v.prototype._parseBody=function(t){var e=d.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&y(this.type)&&(e=d.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},v.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},d.Response=v,o(w.prototype),u(w.prototype),w.prototype.type=function(t){return this.set("Content-Type",d.types[t]||t),this},w.prototype.accept=function(t){return this.set("Accept",d.types[t]||t),this},w.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var i=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,i)},w.prototype.query=function(t){return"string"!=typeof t&&(t=m(t)),t&&this._query.push(t),this},w.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},w.prototype._getFormData=function(){return this._formData||(this._formData=new i.FormData),this._formData},w.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},w.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},w.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},w.prototype.ca=w.prototype.agent,w.prototype.buffer=w.prototype.ca,w.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},w.prototype.pipe=w.prototype.write,w.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},w.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||h,this._finalizeQueryString(),this._end()},w.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},w.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=d.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||d.serialize[i?i.split(";")[0]:""];!o&&y(i)&&(o=d.serialize["application/json"]),o&&(r=o(r))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&e.setRequestHeader(s,this.header[s]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},d.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){l.prototype[t.toLowerCase()]=function(e,r){var n=new d.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),l.prototype.del=l.prototype.delete,d.get=function(t,e,r){var n=d("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},d.head=function(t,e,r){var n=d("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},d.options=function(t,e,r){var n=d("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},d.del=_,d.delete=_,d.patch=function(t,e,r){var n=d("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},d.post=function(t,e,r){var n=d("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},d.put=function(t,e,r){var n=d("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},1960:t=>{"use strict";function e(t){return(e="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})(t)}t.exports=function(t){return null!==t&&"object"===e(t)}},4287:(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})(t)}var i=r(1960);function o(t){if(t)return function(t){for(var e in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,e)&&(t[e]=o.prototype[e]);return t}(t)}t.exports=o,o.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},o.prototype.parse=function(t){return this._parser=t,this},o.prototype.responseType=function(t){return this._responseType=t,this},o.prototype.serialize=function(t){return this._serializer=t,this},o.prototype.timeout=function(t){if(!t||"object"!==n(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},o.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var s=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),a=new Set([408,413,429,500,502,503,504,521,522,524]);o.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&a.has(e.status))return!0;if(t){if(t.code&&s.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},o.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},o.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},o.prototype.catch=function(t){return this.then(void 0,t)},o.prototype.use=function(t){return t(this),this},o.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},o.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},o.prototype.get=function(t){return this._header[t.toLowerCase()]},o.prototype.getHeader=o.prototype.get,o.prototype.set=function(t,e){if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},o.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},o.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},o.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},o.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},o.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},o.prototype.redirects=function(t){return this._maxRedirects=t,this},o.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},o.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},o.prototype.send=function(t){var e=i(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&i(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},o.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},o.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},o.prototype._appendQueryString=function(){console.warn("Unsupported")},o.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},o.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},969:(t,e,r)=>{"use strict";var n=r(3094);function i(t){if(t)return function(t){for(var e in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,e)&&(t[e]=i.prototype[e]);return t}(t)}t.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(this[i]=r[i]);this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t}},3094:(t,e)=>{"use strict";function r(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){var e,n={},i=r(t.split(/ *; */));try{for(i.s();!(e=i.n()).done;){var o=e.value.split(/ *= */),s=o.shift(),a=o.shift();s&&a&&(n[s]=a)}}catch(t){i.e(t)}finally{i.f()}return n},e.parseLinks=function(t){var e,n={},i=r(t.split(/ *, */));try{for(i.s();!(e=i.n()).done;){var o=e.value.split(/ *; */),s=o[0].slice(1,-1);n[o[1].split(/ *= */)[1].slice(1,-1)]=s}}catch(t){i.e(t)}finally{i.f()}return n},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},5335:t=>{"use strict";var e=String.prototype.replace,r=/%20/g,n="RFC3986";t.exports={default:n,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:n}},3065:(t,e,r)=>{"use strict";var n=r(4246),i=r(1688),o=r(5335);t.exports={formats:o,parse:i,stringify:n}},1688:(t,e,r)=>{"use strict";var n=r(4562),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},u=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},c=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,f=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;f.push(c)}for(var l=0;r.depth>0&&null!==(a=s.exec(o))&&l<r.depth;){if(l+=1,!r.plainObjects&&i.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(a[1])}return a&&f.push("["+o.slice(a.index)+"]"),function(t,e,r,n){for(var i=n?e:u(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,f=parseInt(c,10);r.parseArrays||""!==c?!isNaN(f)&&a!==c&&String(f)===c&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(s=[])[f]=i:s[c]=i:s={0:i}}i=s}return i}(f,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return s;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?s.charset:t.charset;return{allowDots:void 0===t.allowDots?s.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:s.comma,decoder:"function"==typeof t.decoder?t.decoder:s.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:s.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var f="string"==typeof t?function(t,e){var r,c={},f=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,l=e.parameterLimit===1/0?void 0:e.parameterLimit,h=f.split(e.delimiter,l),d=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r<h.length;++r)0===h[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[r]?p="utf-8":"utf8=%26%2310003%3B"===h[r]&&(p="iso-8859-1"),d=r,r=h.length);for(r=0;r<h.length;++r)if(r!==d){var m,g,b=h[r],y=b.indexOf("]="),v=-1===y?b.indexOf("="):y+1;-1===v?(m=e.decoder(b,s.decoder,p,"key"),g=e.strictNullHandling?null:""):(m=e.decoder(b.slice(0,v),s.decoder,p,"key"),g=n.maybeMap(u(b.slice(v+1),e),(function(t){return e.decoder(t,s.decoder,p,"value")}))),g&&e.interpretNumericEntities&&"iso-8859-1"===p&&(g=a(g)),b.indexOf("[]=")>-1&&(g=o(g)?[g]:g),i.call(c,m)?c[m]=n.combine(c[m],g):c[m]=g}return c}(t,r):t,l=r.plainObjects?Object.create(null):{},h=Object.keys(f),d=0;d<h.length;++d){var p=h[d],m=c(p,f[p],r,"string"==typeof t);l=n.merge(l,m,r)}return!0===r.allowSparse?l:n.compact(l)}},4246:(t,e,r)=>{"use strict";var n=r(3680),i=r(4562),o=r(5335),s=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},u=Array.isArray,c=Array.prototype.push,f=function(t,e){c.apply(t,u(e)?e:[e])},l=Date.prototype.toISOString,h=o.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:h,formatter:o.formatters[h],indices:!1,serializeDate:function(t){return l.call(t)},skipNulls:!1,strictNullHandling:!1},p=function t(e,r,o,s,a,c,l,h,p,m,g,b,y,v,w){var _,A=e;if(w.has(e))throw new RangeError("Cyclic object value");if("function"==typeof l?A=l(r,A):A instanceof Date?A=m(A):"comma"===o&&u(A)&&(A=i.maybeMap(A,(function(t){return t instanceof Date?m(t):t}))),null===A){if(s)return c&&!y?c(r,d.encoder,v,"key",g):r;A=""}if("string"==typeof(_=A)||"number"==typeof _||"boolean"==typeof _||"symbol"==typeof _||"bigint"==typeof _||i.isBuffer(A))return c?[b(y?r:c(r,d.encoder,v,"key",g))+"="+b(c(A,d.encoder,v,"value",g))]:[b(r)+"="+b(String(A))];var E,S=[];if(void 0===A)return S;if("comma"===o&&u(A))E=[{value:A.length>0?A.join(",")||null:void 0}];else if(u(l))E=l;else{var M=Object.keys(A);E=h?M.sort(h):M}for(var x=0;x<E.length;++x){var k=E[x],T="object"==typeof k&&void 0!==k.value?k.value:A[k];if(!a||null!==T){var I=u(A)?"function"==typeof o?o(r,k):r:r+(p?"."+k:"["+k+"]");w.set(e,!0);var C=n();f(S,t(T,I,o,s,a,c,l,h,p,m,g,b,y,v,C))}}return S};t.exports=function(t,e){var r,i=t,c=function(t){if(!t)return d;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||d.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==t.format){if(!s.call(o.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=o.formatters[r],i=d.filter;return("function"==typeof t.filter||u(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===t.allowDots?d.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:d.charsetSentinel,delimiter:void 0===t.delimiter?d.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:d.encode,encoder:"function"==typeof t.encoder?t.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:d.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:d.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:d.strictNullHandling}}(e);"function"==typeof c.filter?i=(0,c.filter)("",i):u(c.filter)&&(r=c.filter);var l,h=[];if("object"!=typeof i||null===i)return"";l=e&&e.arrayFormat in a?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var m=a[l];r||(r=Object.keys(i)),c.sort&&r.sort(c.sort);for(var g=n(),b=0;b<r.length;++b){var y=r[b];c.skipNulls&&null===i[y]||f(h,p(i[y],y,m,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var v=h.join(c.delimiter),w=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),v.length>0?w+v:""}},4562:(t,e,r)=>{"use strict";var n=r(5335),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r};t.exports={arrayToObject:a,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],s=i.obj[i.prop],a=Object.keys(s),u=0;u<a.length;++u){var c=a[u],f=s[c];"object"==typeof f&&null!==f&&-1===r.indexOf(f)&&(e.push({obj:s,prop:c}),r.push(f))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,i,o){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var u="",c=0;c<a.length;++c){var f=a.charCodeAt(c);45===f||46===f||95===f||126===f||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===n.RFC1738&&(40===f||41===f)?u+=a.charAt(c):f<128?u+=s[f]:f<2048?u+=s[192|f>>6]+s[128|63&f]:f<55296||f>=57344?u+=s[224|f>>12]+s[128|f>>6&63]+s[128|63&f]:(c+=1,f=65536+((1023&f)<<10|1023&a.charCodeAt(c)),u+=s[240|f>>18]+s[128|f>>12&63]+s[128|f>>6&63]+s[128|63&f])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(o(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var s=e;return o(e)&&!o(r)&&(s=a(e,n)),o(e)&&o(r)?(r.forEach((function(r,o){if(i.call(e,o)){var s=e[o];s&&"object"==typeof s&&r&&"object"==typeof r?e[o]=t(s,r,n):e.push(r)}else e[o]=r})),e):Object.keys(r).reduce((function(e,o){var s=r[o];return i.call(e,o)?e[o]=t(e[o],s,n):e[o]=s,e}),s)}}},7765:function(t,e){!function(t){"use strict";var e=function(t){var e,r=new Float64Array(16);if(t)for(e=0;e<t.length;e++)r[e]=t[e];return r},r=function(){throw new Error("no PRNG")},n=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var o=e(),s=e([1]),a=e([56129,1]),u=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function d(t,e,r,n){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=n>>24&255,t[e+5]=n>>16&255,t[e+6]=n>>8&255,t[e+7]=255&n}function p(t,e,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=t[e+o]^r[n+o];return(1&s-1>>>8)-1}function m(t,e,r,n){return p(t,e,r,n,16)}function g(t,e,r,n){return p(t,e,r,n,32)}function b(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,d=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,m=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=o,A=s,E=a,S=u,M=c,x=f,k=l,T=h,I=d,C=p,R=m,B=g,N=b,O=y,P=v,D=w,L=0;L<20;L+=2)_^=(i=(N^=(i=(I^=(i=(M^=(i=_+N|0)<<7|i>>>25)+_|0)<<9|i>>>23)+M|0)<<13|i>>>19)+I|0)<<18|i>>>14,x^=(i=(A^=(i=(O^=(i=(C^=(i=x+A|0)<<7|i>>>25)+x|0)<<9|i>>>23)+C|0)<<13|i>>>19)+O|0)<<18|i>>>14,R^=(i=(k^=(i=(E^=(i=(P^=(i=R+k|0)<<7|i>>>25)+R|0)<<9|i>>>23)+P|0)<<13|i>>>19)+E|0)<<18|i>>>14,D^=(i=(B^=(i=(T^=(i=(S^=(i=D+B|0)<<7|i>>>25)+D|0)<<9|i>>>23)+S|0)<<13|i>>>19)+T|0)<<18|i>>>14,_^=(i=(S^=(i=(E^=(i=(A^=(i=_+S|0)<<7|i>>>25)+_|0)<<9|i>>>23)+A|0)<<13|i>>>19)+E|0)<<18|i>>>14,x^=(i=(M^=(i=(T^=(i=(k^=(i=x+M|0)<<7|i>>>25)+x|0)<<9|i>>>23)+k|0)<<13|i>>>19)+T|0)<<18|i>>>14,R^=(i=(C^=(i=(I^=(i=(B^=(i=R+C|0)<<7|i>>>25)+R|0)<<9|i>>>23)+B|0)<<13|i>>>19)+I|0)<<18|i>>>14,D^=(i=(P^=(i=(O^=(i=(N^=(i=D+P|0)<<7|i>>>25)+D|0)<<9|i>>>23)+N|0)<<13|i>>>19)+O|0)<<18|i>>>14;_=_+o|0,A=A+s|0,E=E+a|0,S=S+u|0,M=M+c|0,x=x+f|0,k=k+l|0,T=T+h|0,I=I+d|0,C=C+p|0,R=R+m|0,B=B+g|0,N=N+b|0,O=O+y|0,P=P+v|0,D=D+w|0,t[0]=_>>>0&255,t[1]=_>>>8&255,t[2]=_>>>16&255,t[3]=_>>>24&255,t[4]=A>>>0&255,t[5]=A>>>8&255,t[6]=A>>>16&255,t[7]=A>>>24&255,t[8]=E>>>0&255,t[9]=E>>>8&255,t[10]=E>>>16&255,t[11]=E>>>24&255,t[12]=S>>>0&255,t[13]=S>>>8&255,t[14]=S>>>16&255,t[15]=S>>>24&255,t[16]=M>>>0&255,t[17]=M>>>8&255,t[18]=M>>>16&255,t[19]=M>>>24&255,t[20]=x>>>0&255,t[21]=x>>>8&255,t[22]=x>>>16&255,t[23]=x>>>24&255,t[24]=k>>>0&255,t[25]=k>>>8&255,t[26]=k>>>16&255,t[27]=k>>>24&255,t[28]=T>>>0&255,t[29]=T>>>8&255,t[30]=T>>>16&255,t[31]=T>>>24&255,t[32]=I>>>0&255,t[33]=I>>>8&255,t[34]=I>>>16&255,t[35]=I>>>24&255,t[36]=C>>>0&255,t[37]=C>>>8&255,t[38]=C>>>16&255,t[39]=C>>>24&255,t[40]=R>>>0&255,t[41]=R>>>8&255,t[42]=R>>>16&255,t[43]=R>>>24&255,t[44]=B>>>0&255,t[45]=B>>>8&255,t[46]=B>>>16&255,t[47]=B>>>24&255,t[48]=N>>>0&255,t[49]=N>>>8&255,t[50]=N>>>16&255,t[51]=N>>>24&255,t[52]=O>>>0&255,t[53]=O>>>8&255,t[54]=O>>>16&255,t[55]=O>>>24&255,t[56]=P>>>0&255,t[57]=P>>>8&255,t[58]=P>>>16&255,t[59]=P>>>24&255,t[60]=D>>>0&255,t[61]=D>>>8&255,t[62]=D>>>16&255,t[63]=D>>>24&255}(t,e,r,n)}function y(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,c=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,d=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,m=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,_=0;_<20;_+=2)o^=(i=(b^=(i=(d^=(i=(c^=(i=o+b|0)<<7|i>>>25)+o|0)<<9|i>>>23)+c|0)<<13|i>>>19)+d|0)<<18|i>>>14,f^=(i=(s^=(i=(y^=(i=(p^=(i=f+s|0)<<7|i>>>25)+f|0)<<9|i>>>23)+p|0)<<13|i>>>19)+y|0)<<18|i>>>14,m^=(i=(l^=(i=(a^=(i=(v^=(i=m+l|0)<<7|i>>>25)+m|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(g^=(i=(h^=(i=(u^=(i=w+g|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+h|0)<<18|i>>>14,o^=(i=(u^=(i=(a^=(i=(s^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,f^=(i=(c^=(i=(h^=(i=(l^=(i=f+c|0)<<7|i>>>25)+f|0)<<9|i>>>23)+l|0)<<13|i>>>19)+h|0)<<18|i>>>14,m^=(i=(p^=(i=(d^=(i=(g^=(i=m+p|0)<<7|i>>>25)+m|0)<<9|i>>>23)+g|0)<<13|i>>>19)+d|0)<<18|i>>>14,w^=(i=(v^=(i=(y^=(i=(b^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+b|0)<<13|i>>>19)+y|0)<<18|i>>>14;t[0]=o>>>0&255,t[1]=o>>>8&255,t[2]=o>>>16&255,t[3]=o>>>24&255,t[4]=f>>>0&255,t[5]=f>>>8&255,t[6]=f>>>16&255,t[7]=f>>>24&255,t[8]=m>>>0&255,t[9]=m>>>8&255,t[10]=m>>>16&255,t[11]=m>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=l>>>0&255,t[17]=l>>>8&255,t[18]=l>>>16&255,t[19]=l>>>24&255,t[20]=h>>>0&255,t[21]=h>>>8&255,t[22]=h>>>16&255,t[23]=h>>>24&255,t[24]=d>>>0&255,t[25]=d>>>8&255,t[26]=d>>>16&255,t[27]=d>>>24&255,t[28]=p>>>0&255,t[29]=p>>>8&255,t[30]=p>>>16&255,t[31]=p>>>24&255}(t,e,r,n)}var v=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function w(t,e,r,n,i,o,s){var a,u,c=new Uint8Array(16),f=new Uint8Array(64);for(u=0;u<16;u++)c[u]=0;for(u=0;u<8;u++)c[u]=o[u];for(;i>=64;){for(b(f,c,s,v),u=0;u<64;u++)t[e+u]=r[n+u]^f[u];for(a=1,u=8;u<16;u++)a=a+(255&c[u])|0,c[u]=255&a,a>>>=8;i-=64,e+=64,n+=64}if(i>0)for(b(f,c,s,v),u=0;u<i;u++)t[e+u]=r[n+u]^f[u];return 0}function _(t,e,r,n,i){var o,s,a=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(b(u,a,i,v),s=0;s<64;s++)t[e+s]=u[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,e+=64}if(r>0)for(b(u,a,i,v),s=0;s<r;s++)t[e+s]=u[s];return 0}function A(t,e,r,n,i){var o=new Uint8Array(32);y(o,n,i,v);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return _(t,e,r,s,o)}function E(t,e,r,n,i,o,s){var a=new Uint8Array(32);y(a,o,s,v);for(var u=new Uint8Array(8),c=0;c<8;c++)u[c]=o[c+16];return w(t,e,r,n,i,u,a)}var S=function(t){var e,r,n,i,o,s,a,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,e=255&t[0]|(255&t[1])<<8,this.r[0]=8191&e,r=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(e>>>13|r<<3),n=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&t[8]|(255&t[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function M(t,e,r,n,i,o){var s=new S(o);return s.update(r,n,i),s.finish(t,e),0}function x(t,e,r,n,i,o){var s=new Uint8Array(16);return M(s,0,r,n,i,o),m(t,e,s,0)}function k(t,e,r,n,i){var o;if(r<32)return-1;for(E(t,0,e,0,r,n,i),M(t,16,t,32,r-32,t),o=0;o<16;o++)t[o]=0;return 0}function T(t,e,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(A(s,0,32,n,i),0!==x(e,16,e,32,r-32,s))return-1;for(E(t,0,e,0,r,n,i),o=0;o<32;o++)t[o]=0;return 0}function I(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function C(t){var e,r,n=1;for(e=0;e<16;e++)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function R(t,e,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function B(t,r){var n,i,o,s=e(),a=e();for(n=0;n<16;n++)a[n]=r[n];for(C(a),C(a),C(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,R(a,s,1-o)}for(n=0;n<16;n++)t[2*n]=255&a[n],t[2*n+1]=a[n]>>8}function N(t,e){var r=new Uint8Array(32),n=new Uint8Array(32);return B(r,t),B(n,e),g(r,0,n,0)}function O(t){var e=new Uint8Array(32);return B(e,t),1&e[0]}function P(t,e){var r;for(r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function D(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]+r[n]}function L(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]-r[n]}function U(t,e,r){var n,i,o=0,s=0,a=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,m=0,g=0,b=0,y=0,v=0,w=0,_=0,A=0,E=0,S=0,M=0,x=0,k=0,T=0,I=0,C=0,R=0,B=0,N=0,O=0,P=0,D=r[0],L=r[1],U=r[2],j=r[3],F=r[4],q=r[5],z=r[6],H=r[7],K=r[8],G=r[9],W=r[10],V=r[11],$=r[12],X=r[13],Y=r[14],J=r[15];o+=(n=e[0])*D,s+=n*L,a+=n*U,u+=n*j,c+=n*F,f+=n*q,l+=n*z,h+=n*H,d+=n*K,p+=n*G,m+=n*W,g+=n*V,b+=n*$,y+=n*X,v+=n*Y,w+=n*J,s+=(n=e[1])*D,a+=n*L,u+=n*U,c+=n*j,f+=n*F,l+=n*q,h+=n*z,d+=n*H,p+=n*K,m+=n*G,g+=n*W,b+=n*V,y+=n*$,v+=n*X,w+=n*Y,_+=n*J,a+=(n=e[2])*D,u+=n*L,c+=n*U,f+=n*j,l+=n*F,h+=n*q,d+=n*z,p+=n*H,m+=n*K,g+=n*G,b+=n*W,y+=n*V,v+=n*$,w+=n*X,_+=n*Y,A+=n*J,u+=(n=e[3])*D,c+=n*L,f+=n*U,l+=n*j,h+=n*F,d+=n*q,p+=n*z,m+=n*H,g+=n*K,b+=n*G,y+=n*W,v+=n*V,w+=n*$,_+=n*X,A+=n*Y,E+=n*J,c+=(n=e[4])*D,f+=n*L,l+=n*U,h+=n*j,d+=n*F,p+=n*q,m+=n*z,g+=n*H,b+=n*K,y+=n*G,v+=n*W,w+=n*V,_+=n*$,A+=n*X,E+=n*Y,S+=n*J,f+=(n=e[5])*D,l+=n*L,h+=n*U,d+=n*j,p+=n*F,m+=n*q,g+=n*z,b+=n*H,y+=n*K,v+=n*G,w+=n*W,_+=n*V,A+=n*$,E+=n*X,S+=n*Y,M+=n*J,l+=(n=e[6])*D,h+=n*L,d+=n*U,p+=n*j,m+=n*F,g+=n*q,b+=n*z,y+=n*H,v+=n*K,w+=n*G,_+=n*W,A+=n*V,E+=n*$,S+=n*X,M+=n*Y,x+=n*J,h+=(n=e[7])*D,d+=n*L,p+=n*U,m+=n*j,g+=n*F,b+=n*q,y+=n*z,v+=n*H,w+=n*K,_+=n*G,A+=n*W,E+=n*V,S+=n*$,M+=n*X,x+=n*Y,k+=n*J,d+=(n=e[8])*D,p+=n*L,m+=n*U,g+=n*j,b+=n*F,y+=n*q,v+=n*z,w+=n*H,_+=n*K,A+=n*G,E+=n*W,S+=n*V,M+=n*$,x+=n*X,k+=n*Y,T+=n*J,p+=(n=e[9])*D,m+=n*L,g+=n*U,b+=n*j,y+=n*F,v+=n*q,w+=n*z,_+=n*H,A+=n*K,E+=n*G,S+=n*W,M+=n*V,x+=n*$,k+=n*X,T+=n*Y,I+=n*J,m+=(n=e[10])*D,g+=n*L,b+=n*U,y+=n*j,v+=n*F,w+=n*q,_+=n*z,A+=n*H,E+=n*K,S+=n*G,M+=n*W,x+=n*V,k+=n*$,T+=n*X,I+=n*Y,C+=n*J,g+=(n=e[11])*D,b+=n*L,y+=n*U,v+=n*j,w+=n*F,_+=n*q,A+=n*z,E+=n*H,S+=n*K,M+=n*G,x+=n*W,k+=n*V,T+=n*$,I+=n*X,C+=n*Y,R+=n*J,b+=(n=e[12])*D,y+=n*L,v+=n*U,w+=n*j,_+=n*F,A+=n*q,E+=n*z,S+=n*H,M+=n*K,x+=n*G,k+=n*W,T+=n*V,I+=n*$,C+=n*X,R+=n*Y,B+=n*J,y+=(n=e[13])*D,v+=n*L,w+=n*U,_+=n*j,A+=n*F,E+=n*q,S+=n*z,M+=n*H,x+=n*K,k+=n*G,T+=n*W,I+=n*V,C+=n*$,R+=n*X,B+=n*Y,N+=n*J,v+=(n=e[14])*D,w+=n*L,_+=n*U,A+=n*j,E+=n*F,S+=n*q,M+=n*z,x+=n*H,k+=n*K,T+=n*G,I+=n*W,C+=n*V,R+=n*$,B+=n*X,N+=n*Y,O+=n*J,w+=(n=e[15])*D,s+=38*(A+=n*U),a+=38*(E+=n*j),u+=38*(S+=n*F),c+=38*(M+=n*q),f+=38*(x+=n*z),l+=38*(k+=n*H),h+=38*(T+=n*K),d+=38*(I+=n*G),p+=38*(C+=n*W),m+=38*(R+=n*V),g+=38*(B+=n*$),b+=38*(N+=n*X),y+=38*(O+=n*Y),v+=38*(P+=n*J),o=(n=(o+=38*(_+=n*L))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=u,t[4]=c,t[5]=f,t[6]=l,t[7]=h,t[8]=d,t[9]=p,t[10]=m,t[11]=g,t[12]=b,t[13]=y,t[14]=v,t[15]=w}function j(t,e){U(t,e,e)}function F(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)j(i,i),2!==n&&4!==n&&U(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function q(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)j(i,i),1!==n&&U(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function z(t,r,n){var i,o,s=new Uint8Array(32),u=new Float64Array(80),c=e(),f=e(),l=e(),h=e(),d=e(),p=e();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,P(u,n),o=0;o<16;o++)f[o]=u[o],h[o]=c[o]=l[o]=0;for(c[0]=h[0]=1,o=254;o>=0;--o)R(c,f,i=s[o>>>3]>>>(7&o)&1),R(l,h,i),D(d,c,l),L(c,c,l),D(l,f,h),L(f,f,h),j(h,d),j(p,c),U(c,l,c),U(l,f,d),D(d,c,l),L(c,c,l),j(f,c),L(l,h,p),U(c,l,a),D(c,c,h),U(l,l,c),U(c,h,p),U(h,f,u),j(f,d),R(c,f,i),R(l,h,i);for(o=0;o<16;o++)u[o+16]=c[o],u[o+32]=l[o],u[o+48]=f[o],u[o+64]=h[o];var m=u.subarray(32),g=u.subarray(16);return F(m,m),U(g,g,m),B(t,g),0}function H(t,e){return z(t,e,i)}function K(t,e){return r(e,32),H(t,e)}function G(t,e,r){var i=new Uint8Array(32);return z(i,r,e),y(t,n,i,v)}S.prototype.blocks=function(t,e,r){for(var n,i,o,s,a,u,c,f,l,h,d,p,m,g,b,y,v,w,_,A=this.fin?0:2048,E=this.h[0],S=this.h[1],M=this.h[2],x=this.h[3],k=this.h[4],T=this.h[5],I=this.h[6],C=this.h[7],R=this.h[8],B=this.h[9],N=this.r[0],O=this.r[1],P=this.r[2],D=this.r[3],L=this.r[4],U=this.r[5],j=this.r[6],F=this.r[7],q=this.r[8],z=this.r[9];r>=16;)h=l=0,h+=(E+=8191&(n=255&t[e+0]|(255&t[e+1])<<8))*N,h+=(S+=8191&(n>>>13|(i=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*z),h+=(M+=8191&(i>>>10|(o=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*q),h+=(x+=8191&(o>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*F),l=(h+=(k+=8191&(s>>>4|(a=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*j))>>>13,h&=8191,h+=(T+=a>>>1&8191)*(5*U),h+=(I+=8191&(a>>>14|(u=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*L),h+=(C+=8191&(u>>>11|(c=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*D),h+=(R+=8191&(c>>>8|(f=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*P),d=l+=(h+=(B+=f>>>5|A)*(5*O))>>>13,d+=E*O,d+=S*N,d+=M*(5*z),d+=x*(5*q),l=(d+=k*(5*F))>>>13,d&=8191,d+=T*(5*j),d+=I*(5*U),d+=C*(5*L),d+=R*(5*D),l+=(d+=B*(5*P))>>>13,d&=8191,p=l,p+=E*P,p+=S*O,p+=M*N,p+=x*(5*z),l=(p+=k*(5*q))>>>13,p&=8191,p+=T*(5*F),p+=I*(5*j),p+=C*(5*U),p+=R*(5*L),m=l+=(p+=B*(5*D))>>>13,m+=E*D,m+=S*P,m+=M*O,m+=x*N,l=(m+=k*(5*z))>>>13,m&=8191,m+=T*(5*q),m+=I*(5*F),m+=C*(5*j),m+=R*(5*U),g=l+=(m+=B*(5*L))>>>13,g+=E*L,g+=S*D,g+=M*P,g+=x*O,l=(g+=k*N)>>>13,g&=8191,g+=T*(5*z),g+=I*(5*q),g+=C*(5*F),g+=R*(5*j),b=l+=(g+=B*(5*U))>>>13,b+=E*U,b+=S*L,b+=M*D,b+=x*P,l=(b+=k*O)>>>13,b&=8191,b+=T*N,b+=I*(5*z),b+=C*(5*q),b+=R*(5*F),y=l+=(b+=B*(5*j))>>>13,y+=E*j,y+=S*U,y+=M*L,y+=x*D,l=(y+=k*P)>>>13,y&=8191,y+=T*O,y+=I*N,y+=C*(5*z),y+=R*(5*q),v=l+=(y+=B*(5*F))>>>13,v+=E*F,v+=S*j,v+=M*U,v+=x*L,l=(v+=k*D)>>>13,v&=8191,v+=T*P,v+=I*O,v+=C*N,v+=R*(5*z),w=l+=(v+=B*(5*q))>>>13,w+=E*q,w+=S*F,w+=M*j,w+=x*U,l=(w+=k*L)>>>13,w&=8191,w+=T*D,w+=I*P,w+=C*O,w+=R*N,_=l+=(w+=B*(5*z))>>>13,_+=E*z,_+=S*q,_+=M*F,_+=x*j,l=(_+=k*U)>>>13,_&=8191,_+=T*L,_+=I*D,_+=C*P,_+=R*O,E=h=8191&(l=(l=((l+=(_+=B*N)>>>13)<<2)+l|0)+(h&=8191)|0),S=d+=l>>>=13,M=p&=8191,x=m&=8191,k=g&=8191,T=b&=8191,I=y&=8191,C=v&=8191,R=w&=8191,B=_&=8191,e+=16,r-=16;this.h[0]=E,this.h[1]=S,this.h[2]=M,this.h[3]=x,this.h[4]=k,this.h[5]=T,this.h[6]=I,this.h[7]=C,this.h[8]=R,this.h[9]=B},S.prototype.finish=function(t,e){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},S.prototype.update=function(t,e,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=t[e+n];if(r-=i,e+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(t,e,i),e+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=t[e+n];this.leftover+=r}};var W=k,V=T,$=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function X(t,e,r,n){for(var i,o,s,a,u,c,f,l,h,d,p,m,g,b,y,v,w,_,A,E,S,M,x,k,T,I,C=new Int32Array(16),R=new Int32Array(16),B=t[0],N=t[1],O=t[2],P=t[3],D=t[4],L=t[5],U=t[6],j=t[7],F=e[0],q=e[1],z=e[2],H=e[3],K=e[4],G=e[5],W=e[6],V=e[7],X=0;n>=128;){for(A=0;A<16;A++)E=8*A+X,C[A]=r[E+0]<<24|r[E+1]<<16|r[E+2]<<8|r[E+3],R[A]=r[E+4]<<24|r[E+5]<<16|r[E+6]<<8|r[E+7];for(A=0;A<80;A++)if(i=B,o=N,s=O,a=P,u=D,c=L,f=U,h=F,d=q,p=z,m=H,g=K,b=G,y=W,x=65535&(M=V),k=M>>>16,T=65535&(S=j),I=S>>>16,x+=65535&(M=(K>>>14|D<<18)^(K>>>18|D<<14)^(D>>>9|K<<23)),k+=M>>>16,T+=65535&(S=(D>>>14|K<<18)^(D>>>18|K<<14)^(K>>>9|D<<23)),I+=S>>>16,x+=65535&(M=K&G^~K&W),k+=M>>>16,T+=65535&(S=D&L^~D&U),I+=S>>>16,x+=65535&(M=$[2*A+1]),k+=M>>>16,T+=65535&(S=$[2*A]),I+=S>>>16,S=C[A%16],k+=(M=R[A%16])>>>16,T+=65535&S,I+=S>>>16,T+=(k+=(x+=65535&M)>>>16)>>>16,x=65535&(M=_=65535&x|k<<16),k=M>>>16,T=65535&(S=w=65535&T|(I+=T>>>16)<<16),I=S>>>16,x+=65535&(M=(F>>>28|B<<4)^(B>>>2|F<<30)^(B>>>7|F<<25)),k+=M>>>16,T+=65535&(S=(B>>>28|F<<4)^(F>>>2|B<<30)^(F>>>7|B<<25)),I+=S>>>16,k+=(M=F&q^F&z^q&z)>>>16,T+=65535&(S=B&N^B&O^N&O),I+=S>>>16,l=65535&(T+=(k+=(x+=65535&M)>>>16)>>>16)|(I+=T>>>16)<<16,v=65535&x|k<<16,x=65535&(M=m),k=M>>>16,T=65535&(S=a),I=S>>>16,k+=(M=_)>>>16,T+=65535&(S=w),I+=S>>>16,N=i,O=o,P=s,D=a=65535&(T+=(k+=(x+=65535&M)>>>16)>>>16)|(I+=T>>>16)<<16,L=u,U=c,j=f,B=l,q=h,z=d,H=p,K=m=65535&x|k<<16,G=g,W=b,V=y,F=v,A%16==15)for(E=0;E<16;E++)S=C[E],x=65535&(M=R[E]),k=M>>>16,T=65535&S,I=S>>>16,S=C[(E+9)%16],x+=65535&(M=R[(E+9)%16]),k+=M>>>16,T+=65535&S,I+=S>>>16,w=C[(E+1)%16],x+=65535&(M=((_=R[(E+1)%16])>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25)),k+=M>>>16,T+=65535&(S=(w>>>1|_<<31)^(w>>>8|_<<24)^w>>>7),I+=S>>>16,w=C[(E+14)%16],k+=(M=((_=R[(E+14)%16])>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26))>>>16,T+=65535&(S=(w>>>19|_<<13)^(_>>>29|w<<3)^w>>>6),I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,C[E]=65535&T|I<<16,R[E]=65535&x|k<<16;x=65535&(M=F),k=M>>>16,T=65535&(S=B),I=S>>>16,S=t[0],k+=(M=e[0])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[0]=B=65535&T|I<<16,e[0]=F=65535&x|k<<16,x=65535&(M=q),k=M>>>16,T=65535&(S=N),I=S>>>16,S=t[1],k+=(M=e[1])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[1]=N=65535&T|I<<16,e[1]=q=65535&x|k<<16,x=65535&(M=z),k=M>>>16,T=65535&(S=O),I=S>>>16,S=t[2],k+=(M=e[2])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[2]=O=65535&T|I<<16,e[2]=z=65535&x|k<<16,x=65535&(M=H),k=M>>>16,T=65535&(S=P),I=S>>>16,S=t[3],k+=(M=e[3])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[3]=P=65535&T|I<<16,e[3]=H=65535&x|k<<16,x=65535&(M=K),k=M>>>16,T=65535&(S=D),I=S>>>16,S=t[4],k+=(M=e[4])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[4]=D=65535&T|I<<16,e[4]=K=65535&x|k<<16,x=65535&(M=G),k=M>>>16,T=65535&(S=L),I=S>>>16,S=t[5],k+=(M=e[5])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[5]=L=65535&T|I<<16,e[5]=G=65535&x|k<<16,x=65535&(M=W),k=M>>>16,T=65535&(S=U),I=S>>>16,S=t[6],k+=(M=e[6])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[6]=U=65535&T|I<<16,e[6]=W=65535&x|k<<16,x=65535&(M=V),k=M>>>16,T=65535&(S=j),I=S>>>16,S=t[7],k+=(M=e[7])>>>16,T+=65535&S,I+=S>>>16,I+=(T+=(k+=(x+=65535&M)>>>16)>>>16)>>>16,t[7]=j=65535&T|I<<16,e[7]=V=65535&x|k<<16,X+=128,n-=128}return n}function Y(t,e,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,X(i,o,e,r),r%=128,n=0;n<r;n++)s[n]=e[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,d(s,r-8,a/536870912|0,a<<3),X(i,o,s,r),n=0;n<8;n++)d(t,8*n,i[n],o[n]);return 0}function J(t,r){var n=e(),i=e(),o=e(),s=e(),a=e(),u=e(),f=e(),l=e(),h=e();L(n,t[1],t[0]),L(h,r[1],r[0]),U(n,n,h),D(i,t[0],t[1]),D(h,r[0],r[1]),U(i,i,h),U(o,t[3],r[3]),U(o,o,c),U(s,t[2],r[2]),D(s,s,s),L(a,i,n),L(u,s,o),D(f,s,o),D(l,i,n),U(t[0],a,u),U(t[1],l,f),U(t[2],f,u),U(t[3],a,l)}function Z(t,e,r){var n;for(n=0;n<4;n++)R(t[n],e[n],r)}function Q(t,r){var n=e(),i=e(),o=e();F(o,r[2]),U(n,r[0],o),U(i,r[1],o),B(t,i),t[31]^=O(n)<<7}function tt(t,e,r){var n,i;for(I(t[0],o),I(t[1],s),I(t[2],s),I(t[3],o),i=255;i>=0;--i)Z(t,e,n=r[i/8|0]>>(7&i)&1),J(e,t),J(t,t),Z(t,e,n)}function et(t,r){var n=[e(),e(),e(),e()];I(n[0],f),I(n[1],l),I(n[2],s),U(n[3],f,l),tt(t,n,r)}function rt(t,n,i){var o,s=new Uint8Array(64),a=[e(),e(),e(),e()];for(i||r(n,32),Y(s,n,32),s[0]&=248,s[31]&=127,s[31]|=64,et(a,s),Q(t,a),o=0;o<32;o++)n[o+32]=t[o];return 0}var nt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function it(t,e){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)e[i]+=r-16*e[n]*nt[i-(n-32)],r=Math.floor((e[i]+128)/256),e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*nt[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*nt[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function ot(t){var e,r=new Float64Array(64);for(e=0;e<64;e++)r[e]=t[e];for(e=0;e<64;e++)t[e]=0;it(t,r)}function st(t,r,n,i){var o,s,a=new Uint8Array(64),u=new Uint8Array(64),c=new Uint8Array(64),f=new Float64Array(64),l=[e(),e(),e(),e()];Y(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var h=n+64;for(o=0;o<n;o++)t[64+o]=r[o];for(o=0;o<32;o++)t[32+o]=a[32+o];for(Y(c,t.subarray(32),n+32),ot(c),et(l,c),Q(t,l),o=32;o<64;o++)t[o]=i[o];for(Y(u,t,n+64),ot(u),o=0;o<64;o++)f[o]=0;for(o=0;o<32;o++)f[o]=c[o];for(o=0;o<32;o++)for(s=0;s<32;s++)f[o+s]+=u[o]*a[s];return it(t.subarray(32),f),h}function at(t,r,n,i){var a,c=new Uint8Array(32),f=new Uint8Array(64),l=[e(),e(),e(),e()],d=[e(),e(),e(),e()];if(n<64)return-1;if(function(t,r){var n=e(),i=e(),a=e(),c=e(),f=e(),l=e(),d=e();return I(t[2],s),P(t[1],r),j(a,t[1]),U(c,a,u),L(a,a,t[2]),D(c,t[2],c),j(f,c),j(l,f),U(d,l,f),U(n,d,a),U(n,n,c),q(n,n),U(n,n,a),U(n,n,c),U(n,n,c),U(t[0],n,c),j(i,t[0]),U(i,i,c),N(i,a)&&U(t[0],t[0],h),j(i,t[0]),U(i,i,c),N(i,a)?-1:(O(t[0])===r[31]>>7&&L(t[0],o,t[0]),U(t[3],t[0],t[1]),0)}(d,i))return-1;for(a=0;a<n;a++)t[a]=r[a];for(a=0;a<32;a++)t[a+32]=i[a];if(Y(f,t,n),ot(f),tt(l,d,f),et(d,r.subarray(32)),J(l,d),Q(c,l),n-=64,g(r,0,c,0)){for(a=0;a<n;a++)t[a]=0;return-1}for(a=0;a<n;a++)t[a]=r[a+64];return n}var ut=64,ct=32,ft=64;function lt(t,e){if(32!==t.length)throw new Error("bad key size");if(24!==e.length)throw new Error("bad nonce size")}function ht(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function dt(t){for(var e=0;e<t.length;e++)t[e]=0}t.lowlevel={crypto_core_hsalsa20:y,crypto_stream_xor:E,crypto_stream:A,crypto_stream_salsa20_xor:w,crypto_stream_salsa20:_,crypto_onetimeauth:M,crypto_onetimeauth_verify:x,crypto_verify_16:m,crypto_verify_32:g,crypto_secretbox:k,crypto_secretbox_open:T,crypto_scalarmult:z,crypto_scalarmult_base:H,crypto_box_beforenm:G,crypto_box_afternm:W,crypto_box:function(t,e,r,n,i,o){var s=new Uint8Array(32);return G(s,i,o),W(t,e,r,n,s)},crypto_box_open:function(t,e,r,n,i,o){var s=new Uint8Array(32);return G(s,i,o),V(t,e,r,n,s)},crypto_box_keypair:K,crypto_hash:Y,crypto_sign:st,crypto_sign_keypair:rt,crypto_sign_open:at,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ut,crypto_sign_PUBLICKEYBYTES:ct,crypto_sign_SECRETKEYBYTES:ft,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:e,D:u,L:nt,pack25519:B,unpack25519:P,M:U,A:D,S:j,Z:L,pow2523:q,add:J,set25519:I,modL:it,scalarmult:tt,scalarbase:et},t.randomBytes=function(t){var e=new Uint8Array(t);return r(e,t),e},t.secretbox=function(t,e,r){ht(t,e,r),lt(r,e);for(var n=new Uint8Array(32+t.length),i=new Uint8Array(n.length),o=0;o<t.length;o++)n[o+32]=t[o];return k(i,n,n.length,e,r),i.subarray(16)},t.secretbox.open=function(t,e,r){ht(t,e,r),lt(r,e);for(var n=new Uint8Array(16+t.length),i=new Uint8Array(n.length),o=0;o<t.length;o++)n[o+16]=t[o];return n.length<32||0!==T(i,n,n.length,e,r)?null:i.subarray(32)},t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=16,t.scalarMult=function(t,e){if(ht(t,e),32!==t.length)throw new Error("bad n size");if(32!==e.length)throw new Error("bad p size");var r=new Uint8Array(32);return z(r,t,e),r},t.scalarMult.base=function(t){if(ht(t),32!==t.length)throw new Error("bad n size");var e=new Uint8Array(32);return H(e,t),e},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(e,r,n,i){var o=t.box.before(n,i);return t.secretbox(e,r,o)},t.box.before=function(t,e){ht(t,e),function(t,e){if(32!==t.length)throw new Error("bad public key size");if(32!==e.length)throw new Error("bad secret key size")}(t,e);var r=new Uint8Array(32);return G(r,t,e),r},t.box.after=t.secretbox,t.box.open=function(e,r,n,i){var o=t.box.before(n,i);return t.secretbox.open(e,r,o)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(32);return K(t,e),{publicKey:t,secretKey:e}},t.box.keyPair.fromSecretKey=function(t){if(ht(t),32!==t.length)throw new Error("bad secret key size");var e=new Uint8Array(32);return H(e,t),{publicKey:e,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,e){if(ht(t,e),e.length!==ft)throw new Error("bad secret key size");var r=new Uint8Array(ut+t.length);return st(r,t,t.length,e),r},t.sign.open=function(t,e){if(ht(t,e),e.length!==ct)throw new Error("bad public key size");var r=new Uint8Array(t.length),n=at(r,t,t.length,e);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},t.sign.detached=function(e,r){for(var n=t.sign(e,r),i=new Uint8Array(ut),o=0;o<i.length;o++)i[o]=n[o];return i},t.sign.detached.verify=function(t,e,r){if(ht(t,e,r),e.length!==ut)throw new Error("bad signature size");if(r.length!==ct)throw new Error("bad public key size");var n,i=new Uint8Array(ut+t.length),o=new Uint8Array(ut+t.length);for(n=0;n<ut;n++)i[n]=e[n];for(n=0;n<t.length;n++)i[n+ut]=t[n];return at(o,i,i.length,r)>=0},t.sign.keyPair=function(){var t=new Uint8Array(ct),e=new Uint8Array(ft);return rt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(ht(t),t.length!==ft)throw new Error("bad secret key size");for(var e=new Uint8Array(ct),r=0;r<e.length;r++)e[r]=t[32+r];return{publicKey:e,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(ht(t),32!==t.length)throw new Error("bad seed size");for(var e=new Uint8Array(ct),r=new Uint8Array(ft),n=0;n<32;n++)r[n]=t[n];return rt(e,r,!0),{publicKey:e,secretKey:r}},t.sign.publicKeyLength=ct,t.sign.secretKeyLength=ft,t.sign.seedLength=32,t.sign.signatureLength=ut,t.hash=function(t){ht(t);var e=new Uint8Array(64);return Y(e,t,t.length),e},t.hash.hashLength=64,t.verify=function(t,e){return ht(t,e),0!==t.length&&0!==e.length&&t.length===e.length&&0===p(t,0,e,0,t.length)},t.setPRNG=function(t){r=t},function(){var e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&e.getRandomValues?t.setPRNG((function(t,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)e.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)t[n]=i[n];dt(i)})):(e=__webpack_require__(9842))&&e.randomBytes&&t.setPRNG((function(t,r){var n,i=e.randomBytes(r);for(n=0;n<r;n++)t[n]=i[n];dt(i)}))}()}(void 0!==t&&t.exports?t.exports:self.nacl=self.nacl||{})},1042:(t,e,r)=>{"use strict";var n=r(1926),i=r(9370),o=/[\n\r\t]/g,s=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,a=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/,c=/^[ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function f(t){return(t||"").toString().replace(c,"")}var l=[["#","hash"],["?","query"],function(t,e){return p(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],h={hash:1,query:1};function d(t){var e,n=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},i={},o=typeof(t=t||n);if("blob:"===t.protocol)i=new g(unescape(t.pathname),{});else if("string"===o)for(e in i=new g(t,{}),h)delete i[e];else if("object"===o){for(e in t)e in h||(i[e]=t[e]);void 0===i.slashes&&(i.slashes=s.test(t.href))}return i}function p(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function m(t,e){t=(t=f(t)).replace(o,""),e=e||{};var r,n=a.exec(t),i=n[1]?n[1].toLowerCase():"",s=!!n[2],u=!!n[3],c=0;return s?u?(r=n[2]+n[3]+n[4],c=n[2].length+n[3].length):(r=n[2]+n[4],c=n[2].length):u?(r=n[3]+n[4],c=n[3].length):r=n[4],"file:"===i?c>=2&&(r=r.slice(2)):p(i)?r=n[4]:i?s&&(r=r.slice(2)):c>=2&&p(e.protocol)&&(r=n[4]),{protocol:i,slashes:s||p(i),slashesCount:c,rest:r}}function g(t,e,r){if(t=(t=f(t)).replace(o,""),!(this instanceof g))return new g(t,e,r);var s,a,c,h,b,y,v=l.slice(),w=typeof e,_=this,A=0;for("object"!==w&&"string"!==w&&(r=e,e=null),r&&"function"!=typeof r&&(r=i.parse),s=!(a=m(t||"",e=d(e))).protocol&&!a.slashes,_.slashes=a.slashes||s&&e.slashes,_.protocol=a.protocol||e.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||u.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!p(_.protocol)))&&(v[3]=[/(.*)/,"pathname"]);A<v.length;A++)"function"!=typeof(h=v[A])?(c=h[0],y=h[1],c!=c?_[y]=t:"string"==typeof c?~(b="@"===c?t.lastIndexOf(c):t.indexOf(c))&&("number"==typeof h[2]?(_[y]=t.slice(0,b),t=t.slice(b+h[2])):(_[y]=t.slice(b),t=t.slice(0,b))):(b=c.exec(t))&&(_[y]=b[1],t=t.slice(0,b.index)),_[y]=_[y]||s&&h[3]&&e[y]||"",h[4]&&(_[y]=_[y].toLowerCase())):t=h(t,_);r&&(_.query=r(_.query)),s&&e.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==e.pathname)&&(_.pathname=function(t,e){if(""===t)return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),"."!==i&&".."!==i||r.push(""),r.join("/")}(_.pathname,e.pathname)),"/"!==_.pathname.charAt(0)&&p(_.protocol)&&(_.pathname="/"+_.pathname),n(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(~(b=_.auth.indexOf(":"))?(_.username=_.auth.slice(0,b),_.username=encodeURIComponent(decodeURIComponent(_.username)),_.password=_.auth.slice(b+1),_.password=encodeURIComponent(decodeURIComponent(_.password))):_.username=encodeURIComponent(decodeURIComponent(_.auth)),_.auth=_.password?_.username+":"+_.password:_.username),_.origin="file:"!==_.protocol&&p(_.protocol)&&_.host?_.protocol+"//"+_.host:"null",_.href=_.toString()}g.prototype={set:function(t,e,r){var o=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(r||i.parse)(e)),o[t]=e;break;case"port":o[t]=e,n(e,o.protocol)?e&&(o.host=o.hostname+":"+e):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=e,o.port&&(e+=":"+o.port),o.host=e;break;case"host":o[t]=e,/:\d+$/.test(e)?(e=e.split(":"),o.port=e.pop(),o.hostname=e.join(":")):(o.hostname=e,o.port="");break;case"protocol":o.protocol=e.toLowerCase(),o.slashes=!r;break;case"pathname":case"hash":if(e){var s="pathname"===t?"/":"#";o[t]=e.charAt(0)!==s?s+e:e}else o[t]=e;break;case"username":case"password":o[t]=encodeURIComponent(e);break;case"auth":var a=e.indexOf(":");~a?(o.username=e.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=e.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(e))}for(var u=0;u<l.length;u++){var c=l[u];c[4]&&(o[c[1]]=o[c[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&p(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(t){t&&"function"==typeof t||(t=i.stringify);var e,r=this,n=r.host,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var s=o+(r.protocol&&r.slashes||p(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):"file:"!==r.protocol&&p(r.protocol)&&!n&&"/"!==r.pathname&&(s+="@"),":"===n[n.length-1]&&(n+=":"),s+=n+r.pathname,(e="object"==typeof r.query?t(r.query):r.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),r.hash&&(s+=r.hash),s}},g.extractProtocol=m,g.location=d,g.trimLeft=f,g.qs=i,t.exports=g},5922:(t,e,r)=>{var n=r(2486).Buffer;const{default:i}=r(1113),{setSendTransactionHeaders:o}=r(5180);t.exports={Algod:function(t="",e="http://r2.algorand.network",r=4180,s={}){let a=t;"string"==typeof a&&(a={"X-Algo-API-Token":a});const u=new i(a,e,r,s);function c(t){return void 0!==t.noteb64&&null!==t.noteb64&&(t.note=n.from(t.noteb64,"base64")),t}this.status=async(t={})=>(await u.get("/v1/status",{},t)).body,this.healthCheck=async(t={})=>{const e=await u.get("/health",{},t);if(!e.ok)throw new Error(`Health response: ${e.status}`);return{}},this.statusAfterBlock=async(t,e={})=>{if(!Number.isInteger(t))throw Error("roundNumber should be an integer");return(await u.get(`/v1/status/wait-for-block-after/${t}`,{},e)).body},this.pendingTransactions=async(t,e={})=>{if(!Number.isInteger(t))throw Error("maxTxns should be an integer");const r=await u.get("/v1/transactions/pending",{max:t},e);if(200===r.statusCode&&void 0!==r.body.truncatedTxns.transactions)for(let t=0;t<r.body.truncatedTxns.transactions.length;t++)r.body.truncatedTxns.transactions[t]=c(r.body.truncatedTxns.transactions[t]);return r.body},this.versions=async(t={})=>(await u.get("/versions",{},t)).body,this.ledgerSupply=async(t={})=>(await u.get("/v1/ledger/supply",{},t)).body,this.transactionByAddress=async(t,e=null,r=null,n=null,i={})=>{if(null!==e&&!Number.isInteger(e))throw Error("first round should be an integer");if(null!==r&&!Number.isInteger(r))throw Error("last round should be an integer");const o=await u.get(`/v1/account/${t}/transactions`,{firstRound:e,lastRound:r,max:n},i);if(200===o.statusCode&&void 0!==o.body.transactions)for(let t=0;t<o.body.transactions.length;t++)o.body.transactions[t]=c(o.body.transactions[t]);return o.body},this.transactionByAddressAndDate=async(t,e,r,n=null,i={})=>{const o=await u.get(`/v1/account/${t}/transactions`,{fromDate:e,toDate:r,max:n},i);if(200===o.statusCode&&void 0!==o.body.transactions)for(let t=0;t<o.body.transactions.length;t++)o.body.transactions[t]=c(o.body.transactions[t]);return o.body},this.transactionById=async(t,e={})=>{const r=await u.get(`/v1/transaction/${t}`,{},e);return 200===r.statusCode&&(r.body=c(r.body)),r.body},this.transactionInformation=async(t,e,r={})=>{const n=await u.get(`/v1/account/${t}/transaction/${e}`,{},r);return 200===n.statusCode&&(n.body=c(n.body)),n.body},this.pendingTransactionInformation=async(t,e={})=>{const r=await u.get(`/v1/transactions/pending/${t}`,{},e);return 200===r.statusCode&&(r.body=c(r.body)),r.body},this.accountInformation=async(t,e={})=>(await u.get(`/v1/account/${t}`,{},e)).body,this.assetInformation=async(t,e={})=>(await u.get(`/v1/asset/${t}`,{},e)).body,this.suggestedFee=async(t={})=>(await u.get("/v1/transactions/fee",{},t)).body,this.sendRawTransaction=async(t,e={})=>{const r=o(e);return(await u.post("/v1/transactions",n.from(t),r)).body},this.sendRawTransactions=async(t,e={})=>{const r=o(e),i=Array.prototype.concat(...t.map((t=>Array.from(t))));return(await u.post("/v1/transactions",n.from(i),r)).body},this.getTransactionParams=async(t={})=>(await u.get("/v1/transactions/params",{},t)).body,this.suggestParams=async(t={})=>{const e=await this.getTransactionParams(t);return{flatFee:!1,fee:e.fee,firstRound:e.lastRound,lastRound:e.lastRound+1e3,genesisID:e.genesisID,genesisHash:e.genesishashb64}},this.block=async(t,e={})=>{if(!Number.isInteger(t))throw Error("roundNumber should be an integer");const r=await u.get(`/v1/block/${t}`,{},e);if(200===r.statusCode&&void 0!==r.body.txns.transactions)for(let t=0;t<r.body.txns.transactions.length;t++)r.body.txns.transactions[t]=c(r.body.txns.transactions[t]);return r.body}}}},1834:(t,e,r)=>{var n=r(2486).Buffer;const i=r(7116),o=r(3033),s=r(1063),a=r(5583),u=r(8800),c=r(9404),f=r(2514),l=r(9417);t.exports={DynamicFee:class{constructor(t,e,r,o,s,a){if(!Number.isSafeInteger(e)||e<0)throw Error("amount must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(r)||r<0)throw Error("firstValid must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(o)||o<0)throw Error("lastValid must be a positive number and smaller than 2^53-1");if(void 0===s&&(s=i.ALGORAND_ZERO_ADDRESS_STRING),void 0===a){const t=c.randomBytes(32);a=n.from(t).toString("base64")}const l=n.from("ASAFAgEHBgUmAyD+vKC7FEpaTqe0OKRoGsgObKEFvLYH/FZTJclWlfaiEyDmmpYeby1feshmB5JlUr6YI17TM2PKiJGLuck4qRW2+SB/g7Flf/H8U7ktwYFIodZd/C1LH6PWdyhK3dIAEm2QaTIEIhIzABAjEhAzAAcxABIQMwAIMQESEDEWIxIQMRAjEhAxBygSEDEJKRIQMQgkEhAxAiUSEDEEIQQSEDEGKhIQ","base64"),h=[e,r,o,t,s,a],d=[f.valTypes.INT,f.valTypes.INT,f.valTypes.INT,f.valTypes.ADDRESS,f.valTypes.ADDRESS,f.valTypes.BASE64],p=f.inject(l,[5,6,7,11,44,76],h,d);this.programBytes=p;const m=new u.LogicSig(p,void 0);this.address=m.address()}getProgram(){return this.programBytes}getAddress(){return this.address}},getDynamicFeeTransactions:function(t,e,r,n){if(!e.verify(i.decodeAddress(t.from).publicKey))throw new Error("invalid signature");t.fee=n,t.fee<l.ALGORAND_MIN_TX_FEE&&(t.fee=l.ALGORAND_MIN_TX_FEE);const a=c.keyPairFromSecretKey(r),u=i.encodeAddress(a.publicKey),{lease:f}=t;delete t.lease;const h=new l.Transaction(t);h.addLease(f,n);const d={from:u,to:t.from,fee:n,amount:h.fee,firstRound:t.firstRound,lastRound:t.lastRound,genesisHash:t.genesisHash,type:"pay"},p=new l.Transaction(d);p.addLease(f,n);const m=s.assignGroupID([p,h],void 0),g=m[0],b=m[1],y={lsig:e.get_obj_for_encoding(),txn:b.get_obj_for_encoding()},v=g.signTxn(r),w=o.encode(y),_=new Uint8Array(v.length+w.length);return _.set(v),_.set(w,v.length),_},signDynamicFee:function(t,e,r){const n=a.readProgram(t,void 0),o=n[0],s=n[1],f=c.keyPairFromSecretKey(e),l={from:i.encodeAddress(f.publicKey),to:i.encodeAddress(s[0]),fee:0,amount:o[2],closeRemainderTo:i.encodeAddress(s[1]),firstRound:o[3],lastRound:o[4],genesisHash:r,type:"pay",lease:new Uint8Array(s[2])},h=new u.LogicSig(t,void 0);return h.sign(e),{txn:l,lsig:h}}}},1786:(t,e,r)=>{var n=r(2486).Buffer;const i=r(3477),{keccak256:o}=r(583),s=r(5583),a=r(8800),u=r(2514),c=r(9417);t.exports={HTLC:class{constructor(t,e,r,i,o,s){if(!Number.isSafeInteger(o)||o<0)throw Error("expiryRound must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(s)||s<0)throw Error("maxFee must be a positive number and smaller than 2^53-1");let c="";if("sha256"===r)c="ASAECAEACSYDIOaalh5vLV96yGYHkmVSvpgjXtMzY8qIkYu5yTipFbb5IH+DsWV/8fxTuS3BgUih1l38LUsfo9Z3KErd0gASbZBpIP68oLsUSlpOp7Q4pGgayA5soQW8tgf8VlMlyVaV9qITMQEiDjEQIxIQMQcyAxIQMQgkEhAxCSgSLQEpEhAxCSoSMQIlDRAREA==";else{if("keccak256"!==r)throw Error("hash function unrecognized");c="ASAECAEACSYDIOaalh5vLV96yGYHkmVSvpgjXtMzY8qIkYu5yTipFbb5IH+DsWV/8fxTuS3BgUih1l38LUsfo9Z3KErd0gASbZBpIP68oLsUSlpOp7Q4pGgayA5soQW8tgf8VlMlyVaV9qITMQEiDjEQIxIQMQcyAxIQMQgkEhAxCSgSLQIpEhAxCSoSMQIlDRAREA=="}if(32!==n.from(i,"base64").length)throw Error("hash image must be 32 bytes");const f=n.from(c,"base64"),l=[s,o,e,i,t],h=[u.valTypes.INT,u.valTypes.INT,u.valTypes.ADDRESS,u.valTypes.BASE64,u.valTypes.ADDRESS],d=u.inject(f,[3,6,10,42,76],l,h);this.programBytes=d;const p=new a.LogicSig(d,void 0);this.address=p.address()}getProgram(){return this.programBytes}getAddress(){return this.address}},signTransactionWithHTLCUnlock:function(t,e,r){const u=n.from(r,"base64"),f=s.readProgram(t,void 0),l=f[0],h=f[1][1],d=t[t.length-15];if(1===d){const t=i.create();if(t.update(u),!n.from(t.hex(),"hex").equals(h))throw new Error("sha256 hash of preimage did not match stored contract hash")}else{if(2!==d)throw new Error("hash function in contract unrecognized");{const t=o.create();if(t.update(u),!n.from(t.hex(),"hex").equals(h))throw new Error("keccak256 hash of preimage did not match stored contract hash")}}const p=[u],m=new a.LogicSig(t,p);delete e.to;const g=l[0],b=new c.Transaction(e);if(b.fee>g)throw new Error(`final fee of payment transaction${b.fee.toString()}greater than transaction max fee${g.toString()}`);return a.signLogicSigTransaction(e,m)}}},8886:(t,e,r)=>{const n=r(1834),i=r(1786),o=r(4748),s=r(3758),a=r(2200);t.exports={DynamicFee:n.DynamicFee,getDynamicFeeTransactions:n.getDynamicFeeTransactions,signDynamicFee:n.signDynamicFee,HTLC:i.HTLC,signTransactionWithHTLCUnlock:i.signTransactionWithHTLCUnlock,LimitOrder:o.LimitOrder,getSwapAssetsTransaction:o.getSwapAssetsTransaction,Split:s.Split,getSplitFundsTransaction:s.getSplitFundsTransaction,PeriodicPayment:a.PeriodicPayment,getPeriodicPaymentWithdrawalTransaction:a.getPeriodicPaymentWithdrawalTransaction}},4748:(t,e,r)=>{var n=r(2486).Buffer;const i=r(7116),o=r(1988),s=r(1063),a=r(5583),u=r(8800),c=r(9404),f=r(2514),l=r(413);t.exports={LimitOrder:class{constructor(t,e,r,i,o,s,a){if(!Number.isSafeInteger(e)||e<0)throw Error("assetid must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(r)||r<0)throw Error("ratn must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(i)||i<0)throw Error("ratd must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(o)||o<0)throw Error("expiryRound must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(s)||s<0)throw Error("minTrade must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(a)||a<0)throw Error("maxFee must be a positive number and smaller than 2^53-1");const c=n.from("ASAKAAEFAgYEBwgJCiYBIP68oLsUSlpOp7Q4pGgayA5soQW8tgf8VlMlyVaV9qITMRYiEjEQIxIQMQEkDhAyBCMSQABVMgQlEjEIIQQNEDEJMgMSEDMBECEFEhAzAREhBhIQMwEUKBIQMwETMgMSEDMBEiEHHTUCNQExCCEIHTUENQM0ATQDDUAAJDQBNAMSNAI0BA8QQAAWADEJKBIxAiEJDRAxBzIDEhAxCCISEBA=","base64"),l=[a,s,e,i,r,o,t],h=[f.valTypes.INT,f.valTypes.INT,f.valTypes.INT,f.valTypes.INT,f.valTypes.INT,f.valTypes.INT,f.valTypes.ADDRESS],d=f.inject(c,[5,7,9,10,11,12,16],l,h);this.programBytes=d;const p=new u.LogicSig(d,void 0);this.address=p.address(),this.owner=t,this.assetid=e}getProgram(){return this.programBytes}getAddress(){return this.address}},getSwapAssetsTransaction:function(t,e,r,n,f,h,d,p){const m=c.keyPairFromSecretKey(n),g=i.encodeAddress(m.publicKey),b=a.readProgram(t,void 0),y=b[0],v=b[1];let w;const _=y[6],A=i.encodeAddress(v[0]),E=u.makeLogicSig(t,void 0),S=E.address(),M=[o.makePaymentTxn(S,g,f,r,w,h,d,void 0,p,void 0),o.makeAssetTransferTxn(g,A,w,void 0,f,e,h,d,void 0,p,void 0,_)],x=s.assignGroupID(M),k=y[7],T=y[8];if(e*k<r*T)throw new Error(`bad payment ratio, ${e.toString()}*${k.toString()} !>= ${r.toString()}*${T.toString()}`);const I=y[4];if(r<I)throw new Error(`payment amount ${r.toString()} less than minimum trade ${I.toString()}`);const C=y[2];if(x[0].fee>C)throw new Error(`final fee of payment transaction ${x[0].fee.toString()} greater than transaction max fee ${C.toString()}`);if(x[1].fee>C)throw new Error(`final fee of asset transaction ${x[1].fee.toString()} greater than transaction max fee ${C.toString()}`);const R=u.signLogicSigTransactionObject(x[0],E),B=x[1].signTxn(n);return l.concatArrays(R.blob,B)}}},2200:(t,e,r)=>{var n=r(2486).Buffer;const i=r(7116),o=r(1988),s=r(5583),a=r(8800),u=r(9404),c=r(2514);t.exports={PeriodicPayment:class{constructor(t,e,r,i,o,s,c){if(this.receiver=t,!Number.isSafeInteger(e)||e<0)throw Error("amount must be a positive number and smaller than 2^53-1");if(this.amount=e,!Number.isSafeInteger(r)||r<0)throw Error("withdrawalWindow must be a positive number and smaller than 2^53-1");if(this.withdrawalWindow=r,!Number.isSafeInteger(i)||i<0)throw Error("period must be a positive number and smaller than 2^53-1");if(this.period=i,!Number.isSafeInteger(o)||o<0)throw Error("expiryRound must be a positive number and smaller than 2^53-1");if(this.expiryRound=o,!Number.isSafeInteger(s)||s<0)throw Error("maxFee must be a positive number and smaller than 2^53-1");if(this.maxFee=s,void 0===c){const t=u.randomBytes(32);this.lease=n.from(t).toString("base64")}else this.lease=c;this.programBytes=this.getProgram();const f=new a.LogicSig(this.programBytes,void 0);this.address=f.address()}getProgram(){const t=n.from("ASAHAQYFAAQDByYCIAECAwQFBgcIAQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIIJKvkYTkEzwJf2arzJOxERsSogG9nQzKPkpIoc4TzPTFMRAiEjEBIw4QMQIkGCUSEDEEIQQxAggSEDEGKBIQMQkyAxIxBykSEDEIIQUSEDEJKRIxBzIDEhAxAiEGDRAxCCUSEBEQ","base64"),e=[this.maxFee,this.period,this.withdrawalWindow,this.amount,this.expiryRound,this.lease,this.receiver],r=[c.valTypes.INT,c.valTypes.INT,c.valTypes.INT,c.valTypes.INT,c.valTypes.INT,c.valTypes.BASE64,c.valTypes.ADDRESS];return c.inject(t,[4,5,7,8,9,12,46],e,r)}getAddress(){return this.address}},getPeriodicPaymentWithdrawalTransaction:function(t,e,r,n){const u=s.readProgram(t,void 0),c=u[0],f=u[1],l=c[2],h=c[4],d=c[5];if(r%l!=0)throw new Error(`firstValid round ${r.toString()} was not a multiple of contract period ${l.toString()}`);const p=f[1],m=i.encodeAddress(p),g=f[0],b=new Uint8Array(g),y=r+h,v=m;let w,_;const A=a.makeLogicSig(t,void 0),E=A.address(),S={from:E,to:v,fee:e,amount:d,closeRemainderTo:w,firstRound:r,lastRound:y,note:_,genesisHash:n,genesisID:"",type:"pay",lease:b},M=o.makePaymentTxn(E,v,e,d,w,r,y,_,n,"");if(M.fee>c[1])throw new Error(`final fee of payment transaction${M.fee.toString()}greater than transaction max fee${c[1].toString()}`);return a.signLogicSigTransaction(S,A)}}},3758:(t,e,r)=>{var n=r(2486).Buffer;const i=r(7116),o=r(1988),s=r(1063),a=r(8800),u=r(5583),c=r(2514),f=r(413);t.exports={Split:class{constructor(t,e,r,i,o,s,u,f){if(!Number.isSafeInteger(o)||o<0)throw Error("rat2 must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(i)||i<0)throw Error("rat1 must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(s)||s<0)throw Error("expiryRound must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(u)||u<0)throw Error("minPay must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(f)||f<0)throw Error("maxFee must be a positive number and smaller than 2^53-1");const l=n.from("ASAIAQUCAAYHCAkmAyCztwQn0+DycN+vsk+vJWcsoz/b7NDS6i33HOkvTpf+YiC3qUpIgHGWE8/1LPh9SGCalSN7IaITeeWSXbfsS5wsXyC4kBQ38Z8zcwWVAym4S8vpFB/c0XC6R4mnPi9EBADsPDEQIhIxASMMEDIEJBJAABkxCSgSMQcyAxIQMQglEhAxAiEEDRAiQAAuMwAAMwEAEjEJMgMSEDMABykSEDMBByoSEDMACCEFCzMBCCEGCxIQMwAIIQcPEBA=","base64"),h=[f,s,o,i,u,t,e,r],d=[c.valTypes.INT,c.valTypes.INT,c.valTypes.INT,c.valTypes.INT,c.valTypes.INT,c.valTypes.ADDRESS,c.valTypes.ADDRESS,c.valTypes.ADDRESS],p=c.inject(l,[4,7,8,9,10,14,47,80],h,d);this.programBytes=p;const m=a.makeLogicSig(p,void 0);this.address=m.address()}getProgram(){return this.programBytes}getAddress(){return this.address}},getSplitFundsTransaction:function(t,e,r,n,c,l){const h=u.readProgram(t,void 0),d=h[0],p=h[1];let m=d[6],g=d[5],b=0;const y=(t,e)=>{if("number"!=typeof t||"number"!=typeof e)throw new Error("gcd operates only on positive integers");return e?y(e,t%e):t},v=y(m,g);m=Math.floor(m/v),g=Math.floor(g/v);const w=g/m;b=Math.round(e/(1+w));const _=e-b;if(g*b!=m*_)throw Error("could not split funds in a way that satisfied the contract ratio");const A=a.makeLogicSig(t,void 0).address(),E=i.encodeAddress(p[1]),S=i.encodeAddress(p[2]),M=[o.makePaymentTxn(A,E,c,b,void 0,r,n,void 0,l),o.makePaymentTxn(A,S,c,_,void 0,r,n,void 0,l)],x=s.assignGroupID(M).map((t=>a.signLogicSigTransactionObject(t,a).blob));return f.concatArrays(x[0],x[1])}}},2514:(t,e,r)=>{var n=r(2486).Buffer;const i=r(7116);function o(t,e){let r=0;for(;e>128;)t.push(255&e|128),e>>=7,r+=1;return t.push(255&e),r+1}const s={INT:1,ADDRESS:2,BASE64:3};t.exports={inject:function(t,e,r,a){if(e.length!==r.length||e.length!==a.length)throw new Error("Lengths do not match");let u=t;function c(t,e,r,i){const o=t.slice(0,r),s=t.slice(r+i,t.length),a=[o,n.from(e),s];return n.concat(a)}for(let t=0;t<e.length;t++){let f=0,l=r[t];switch(a[t]){case s.INT:const r=[];f=o(r,l),u=c(u,r,e[t],1);break;case s.ADDRESS:l=i.decodeAddress(l),u=c(u,l.publicKey,e[t],32);break;case s.BASE64:const a=[];l=n.from(l,"base64"),o(a,l.length),l=n.concat([n.from(a),l]),u=c(u,l,e[t],33);break;default:throw new Error("unrecognized value type")}if(0!==f)for(let t=0;t<e.length;t++)e[t]+=f-1}return u},valTypes:s}},7677:(t,e,r)=>{"use strict";r.d(e,{JQ:()=>b,_4:()=>A,X3:()=>_,R0:()=>y,jD:()=>v,Yh:()=>N,bL:()=>O,Ls:()=>B,UV:()=>k,Ax:()=>w,A9:()=>x,w1:()=>E,NK:()=>p,RY:()=>g,Pu:()=>m,Vk:()=>u,nh:()=>l,kG:()=>a,qH:()=>f,JH:()=>c,vJ:()=>C,o5:()=>R,AE:()=>I});var n=r(7116),i=r(8922),o=r(413),s=r(2486).Buffer;const a=65535,u=32,c=1,f=1,l=2,h=/^([a-z\d[\](),]+)\[([1-9][\d]*)]$/,d=/^ufixed([1-9][\d]*)x([1-9][\d]*)$/;class p{static from(t){if(t.endsWith("[]")){const e=p.from(t.slice(0,t.length-2));return new A(e)}if(t.endsWith("]")){const e=t.match(h);if(3!==e.length)throw new Error(`malformed static array string: ${t}`);const r=e[2],n=parseInt(r,10);if(n>a)throw new Error(`array length exceeds limit ${a}`);const i=p.from(e[1]);return new _(i,n)}if(t.startsWith("uint")){const e=t=>[...t].every((t=>"0123456789".includes(t))),r=t.slice(4,t.length);if(!e(r))throw new Error(`malformed uint string: ${r}`);const n=parseInt(r,10);if(n>a)throw new Error(`malformed uint string: ${n}`);return new m(n)}if("byte"===t)return new v;if(t.startsWith("ufixed")){const e=t.match(d);if(3!==e.length)throw new Error(`malformed ufixed type: ${t}`);const r=parseInt(e[1],10),n=parseInt(e[2],10);return new g(r,n)}if("bool"===t)return new y;if("address"===t)return new b;if("string"===t)return new w;if(t.length>=2&&"("===t[0]&&")"===t[t.length-1]){const e=E.parseTupleContent(t.slice(1,t.length-1)),r=[];for(let t=0;t<e.length;t++){const n=p.from(e[t]);r.push(n)}return new E(r)}throw new Error(`cannot convert a string ${t} to an ABI type`)}}class m extends p{constructor(t){if(super(),t%8!=0||t<8||t>512)throw new Error(`unsupported uint type bitSize: ${t}`);this.bitSize=t}toString(){return`uint${this.bitSize}`}equals(t){return t instanceof m&&this.bitSize===t.bitSize}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error(`Cannot encode value as uint${this.bitSize}: ${t}`);if(t>=BigInt(2**this.bitSize)||t<BigInt(0))throw new Error(`${t} is not a non-negative int or too big to fit in size uint${this.bitSize}`);if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error(`${t} should be converted into a BigInt before it is encoded`);return(0,i.j)(t,this.bitSize/8)}decode(t){if(t.length!==this.bitSize/8)throw new Error(`byte string must correspond to a uint${this.bitSize}`);return(0,i.v)(t)}}class g extends p{constructor(t,e){if(super(),t%8!=0||t<8||t>512)throw new Error(`unsupported ufixed type bitSize: ${t}`);if(e>160||e<1)throw new Error(`unsupported ufixed type precision: ${e}`);this.bitSize=t,this.precision=e}toString(){return`ufixed${this.bitSize}x${this.precision}`}equals(t){return t instanceof g&&this.bitSize===t.bitSize&&this.precision===t.precision}isDynamic(){return!1}byteLen(){return this.bitSize/8}encode(t){if("bigint"!=typeof t&&"number"!=typeof t)throw new Error(`Cannot encode value as ${this.toString()}: ${t}`);if(t>=BigInt(2**this.bitSize)||t<BigInt(0))throw new Error(`${t} is not a non-negative int or too big to fit in size ${this.toString()}`);if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error(`${t} should be converted into a BigInt before it is encoded`);return(0,i.j)(t,this.bitSize/8)}decode(t){if(t.length!==this.bitSize/8)throw new Error(`byte string must correspond to a ${this.toString()}`);return(0,i.v)(t)}}class b extends p{toString(){return"address"}equals(t){return t instanceof b}isDynamic(){return!1}byteLen(){return u}encode(t){if("string"!=typeof t&&!(t instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${t}`);if("string"==typeof t)return(0,n.decodeAddress)(t).publicKey;if(32!==t.byteLength)throw new Error("byte string must be 32 bytes long for an address");return t}decode(t){if(32!==t.byteLength)throw new Error("byte string must be 32 bytes long for an address");return(0,n.encodeAddress)(t)}}class y extends p{toString(){return"bool"}equals(t){return t instanceof y}isDynamic(){return!1}byteLen(){return f}encode(t){if("boolean"!=typeof t)throw new Error(`Cannot encode value as bool: ${t}`);return t?new Uint8Array([128]):new Uint8Array([0])}decode(t){if(1!==t.byteLength)throw new Error("bool string must be 1 byte long");const e=t[0];if(128===e)return!0;if(0===e)return!1;throw new Error("boolean could not be decoded from the byte string")}}class v extends p{toString(){return"byte"}equals(t){return t instanceof v}isDynamic(){return!1}byteLen(){return c}encode(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new Error(`Cannot encode value as byte: ${t}`);if("bigint"==typeof t&&(t=Number(t)),t<0||t>255)throw new Error(`${t} cannot be encoded into a byte`);return new Uint8Array([t])}decode(t){if(1!==t.byteLength)throw new Error("byte string must be 1 byte long");return t[0]}}class w extends p{toString(){return"string"}equals(t){return t instanceof w}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(t){if("string"!=typeof t&&!(t instanceof Uint8Array))throw new Error(`Cannot encode value as string: ${t}`);const e=s.from(t),r=(0,i.j)(t.length,l),n=new Uint8Array(t.length+l);return n.set(r),n.set(e,l),n}decode(t){if(t.length<l)throw new Error(`byte string is too short to be decoded. Actual length is ${t.length}, but expected at least ${l}`);const e=s.from(t).readUIntBE(0,l),r=t.slice(l,t.length);if(e!==r.length)throw new Error(`string length bytes do not match the actual length of string. Expected ${e}, got ${r.length}`);return s.from(r).toString("utf-8")}}class _ extends p{constructor(t,e){if(super(),e<1)throw new Error(`static array must have a length greater than 0: ${e}`);this.childType=t,this.staticLength=e}toString(){return`${this.childType.toString()}[${this.staticLength}]`}equals(t){return t instanceof _&&this.staticLength===t.staticLength&&this.childType.equals(t.childType)}isDynamic(){return this.childType.isDynamic()}byteLen(){return this.childType.constructor===y?Math.ceil(this.staticLength/8):this.staticLength*this.childType.byteLen()}encode(t){if(!(Array.isArray(t)||t instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${t}`);if(t.length!==this.staticLength)throw new Error(`Value array does not match static array length. Expected ${this.staticLength}, got ${t.length}`);return this.toABITupleType().encode(t)}decode(t){return this.toABITupleType().decode(t)}toABITupleType(){return new E(Array(this.staticLength).fill(this.childType))}}class A extends p{constructor(t){super(),this.childType=t}toString(){return`${this.childType.toString()}[]`}equals(t){return t instanceof A&&this.childType.equals(t.childType)}isDynamic(){return!0}byteLen(){throw new Error(`${this.toString()} is a dynamic type`)}encode(t){if(!(Array.isArray(t)||t instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${t}`);const e=this.toABITupleType(t.length),r=e.encode(t),n=(0,i.j)(e.childTypes.length,l);return(0,o.concatArrays)(n,r)}decode(t){const e=s.from(t).readUIntBE(0,l);return this.toABITupleType(e).decode(t.slice(l,t.length))}toABITupleType(t){return new E(Array(t).fill(this.childType))}}class E extends p{constructor(t){if(super(),t.length>=a)throw new Error("tuple type child type number larger than maximum uint16 error");this.childTypes=t}toString(){const t=[];for(let e=0;e<this.childTypes.length;e++)t[e]=this.childTypes[e].toString();return`(${t.join(",")})`}equals(t){return t instanceof E&&this.childTypes.length===t.childTypes.length&&this.childTypes.every(((e,r)=>e.equals(t.childTypes[r])))}isDynamic(){return this.childTypes.some((t=>t.isDynamic()))}byteLen(){let t=0;for(let e=0;e<this.childTypes.length;e++)if(this.childTypes[e].constructor===y){const r=M(this.childTypes,e,1),n=r+1;e+=r,t+=Math.trunc((n+7)/8)}else t+=this.childTypes[e].byteLen();return t}encode(t){if(!(Array.isArray(t)||t instanceof Uint8Array))throw new Error(`Cannot encode value as ${this.toString()}: ${t}`);const e=Array.from(t);if(t.length>a)throw new Error("length of tuple array should not exceed a uint16");const r=this.childTypes,n=[],s=[],u=new Map;let c=0;for(;c<r.length;){const t=r[c];if(t.isDynamic())u.set(n.length,!0),n.push(new Uint8Array([0,0])),s.push(t.encode(e[c]));else{if(t.constructor===y){const t=M(r,c,-1);let o=M(r,c,1);if(t%8!=0)throw new Error("expected before index should have number of bool mod 8 equal 0");o=Math.min(7,o);const s=S(e.slice(c,c+o+1));n.push((0,i.j)(s,1)),c+=o}else{const r=t.encode(e[c]);n.push(r)}u.set(c,!1),s.push(new Uint8Array)}c+=1}let f=0;for(const t of n)f+=t.length;let h=0;for(let t=0;t<n.length;t++){if(u.get(t)){const e=f+h;if(e>a)throw new Error(`byte length of ${e} should not exceed a uint16`);n[t]=(0,i.j)(e,l)}h+=s[t].length}return(0,o.concatArrays)(...n,...s)}decode(t){const e=this.childTypes,r=[],n=[];let i=0,o=0;const a=s.from(t);for(;i<e.length;){const s=e[i];if(s.isDynamic()){if(t.slice(o,t.length).length<l)throw new Error("dynamic type in tuple is too short to be decoded");const e=a.readUIntBE(o,l);if(r.length>0&&(r[r.length-1].right=e,e<r[r.length-1].left))throw new Error("dynamic index segment miscalculation: left is greater than right index");const i={left:e,right:-1};r.push(i),n.push(null),o+=l}else if(s.constructor===y){const e=M(this.childTypes,i,-1);let r=M(this.childTypes,i,1);if(e%8!=0)throw new Error("expected before bool number mod 8 === 0");r=Math.min(7,r);for(let e=0;e<=r;e++){const r=128>>e;(t[o]&r)>0?n.push(new Uint8Array([128])):n.push(new Uint8Array([0]))}i+=r,o+=1}else{const e=s.byteLen();n.push(t.slice(o,o+e)),o+=e}if(i!==e.length-1&&o>=t.length)throw new Error("input byte not enough to decode");i+=1}if(r.length>0&&(r[r.length-1].right=t.length,o=t.length),o<t.length)throw new Error("input byte not fully consumed");for(let t=0;t<r.length;t++){const e=r[t];if(e.left>e.right)throw new Error("dynamic segment should display a [l, r] space with l <= r");if(t!==r.length-1&&e.right!==r[t+1].left)throw new Error("dynamic segment should be consecutive")}let u=0;for(let i=0;i<e.length;i++)e[i].isDynamic()&&(n[i]=t.slice(r[u].left,r[u].right),u+=1);const c=[];for(let t=0;t<e.length;t++){const r=e[t].decode(n[t]);c.push(r)}return c}static parseTupleContent(t){if(0===t.length)return[];if(t.endsWith(",")||t.startsWith(","))throw new Error("tuple string should not start with comma");if(t.includes(",,"))throw new Error("tuple string should not have consecutive commas");const e=[];let r=0,n="";for(const i of t)n+=i,"("===i?r+=1:")"===i?r-=1:","===i&&0===r&&(e.push(n.slice(0,n.length-1)),n="");if(0!==n.length&&e.push(n),0!==r)throw new Error("tuple string has mismatched parentheses");return e}}function S(t){let e=0;if(t.length>8)throw new Error("value list passed in should be no greater than length 8");for(let r=0;r<t.length;r++){const n=t[r];if("boolean"!=typeof n)throw new Error("non-boolean values cannot be compressed into a byte");n&&(e|=1<<7-r)}return e}function M(t,e,r){let n=0;for(;;){const i=e+r*n;if(t[i].constructor!==y){n-=1;break}if(i!==t.length-1&&1===r)n+=1;else{if(!(i>0&&-1===r))break;n+=1}}return n}var x,k,T=r(9404);function I(t){return t===x.any||t===x.pay||t===x.keyreg||t===x.acfg||t===x.axfer||t===x.afrz||t===x.appl}function C(t,e){return t===x.any||e.type&&e.type.toString()===t.toString()}function R(t){return t===k.account||t===k.application||t===k.asset}!function(t){t.any="txn",t.pay="pay",t.keyreg="keyreg",t.acfg="acfg",t.axfer="axfer",t.afrz="afrz",t.appl="appl"}(x||(x={})),function(t){t.account="account",t.application="application",t.asset="asset"}(k||(k={}));class B{constructor(t){if("string"!=typeof t.name||"object"!=typeof t.returns||!Array.isArray(t.args))throw new Error("Invalid ABIMethod parameters");this.name=t.name,this.description=t.desc,this.args=t.args.map((({type:t,name:e,desc:r})=>I(t)||R(t)?{type:t,name:e,description:r}:{type:p.from(t),name:e,description:r})),this.returns={type:"void"===t.returns.type?t.returns.type:p.from(t.returns.type),description:t.returns.desc}}getSignature(){const t=this.args.map((t=>t.type.toString())).join(","),e=this.returns.type.toString();return`${this.name}(${t})${e}`}getSelector(){const t=(0,T.genericHash)(this.getSignature());return new Uint8Array(t.slice(0,4))}txnCount(){let t=1;for(const e of this.args)"string"==typeof e.type&&I(e.type)&&(t+=1);return t}toJSON(){return{name:this.name,desc:this.description,args:this.args.map((({type:t,name:e,description:r})=>({type:t.toString(),name:e,desc:r}))),returns:{type:this.returns.type.toString(),desc:this.returns.description}}}static fromSignature(t){const{name:e,args:r,returns:n}=function(t){const e=t.indexOf("(");if(-1===e)throw new Error(`Invalid method signature: ${t}`);let r=-1,n=0;for(let i=e;i<t.length;i++){const e=t[i];if("("===e)n+=1;else if(")"===e){if(0===n)break;if(n-=1,0===n){r=i;break}}}if(-1===r)throw new Error(`Invalid method signature: ${t}`);return{name:t.slice(0,e),args:E.parseTupleContent(t.slice(e+1,r)),returns:t.slice(r+1)}}(t);return new B({name:e,args:r.map((t=>({type:t}))),returns:{type:n}})}}class N{constructor(t){if("string"!=typeof t.name||!Array.isArray(t.methods)||t.networks&&"object"!=typeof t.networks)throw new Error("Invalid ABIContract parameters");this.name=t.name,this.description=t.desc,this.networks=t.networks?{...t.networks}:{},this.methods=t.methods.map((t=>new B(t)))}toJSON(){return{name:this.name,desc:this.description,networks:this.networks,methods:this.methods.map((t=>t.toJSON()))}}}class O{constructor(t){if("string"!=typeof t.name||!Array.isArray(t.methods))throw new Error("Invalid ABIInterface parameters");this.name=t.name,this.description=t.desc,this.methods=t.methods.map((t=>new B(t)))}toJSON(){return{name:this.name,desc:this.description,methods:this.methods.map((t=>t.toJSON()))}}}},7988:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(9404),i=r(7116);function o(){const t=n.keyPair();return{addr:i.encodeAddress(t.publicKey),sk:t.secretKey}}},2691:(t,e,r)=>{"use strict";r.d(e,{Z:()=>u});var n=r(7116),i=r(3033),o=r(9404),s=r(413),a=r(2486).Buffer;class u{constructor({bidderKey:t,bidAmount:e,bidID:r,auctionKey:i,auctionID:o,maxPrice:s}){this.name="Bid",this.tag=a.from([97,66]);const u=n.decodeAddress(t),c=n.decodeAddress(i);if(!Number.isSafeInteger(e)||e<0)throw Error("Bid amount must be positive and 2^53-1");if(!Number.isSafeInteger(r)||r<0)throw Error("BidID must be positive and 2^53-1");if(!Number.isSafeInteger(o)||o<0)throw Error("auctionID must be positive");Object.assign(this,{bidderKey:u,bidAmount:e,bidID:r,auctionKey:c,auctionID:o,maxPrice:s})}get_obj_for_encoding(){return{bidder:a.from(this.bidderKey.publicKey),cur:this.bidAmount,price:this.maxPrice,id:this.bidID,auc:a.from(this.auctionKey.publicKey),aid:this.auctionID}}signBid(t){const e=i.encode(this.get_obj_for_encoding()),r=a.from(s.concatArrays(this.tag,e)),n=o.sign(r,t),u={t:"b",b:{sig:a.from(n),bid:this.get_obj_for_encoding()}};return new Uint8Array(i.encode(u))}}},1113:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>d});var n=r(413),i=r(1042),o=r.n(i),s=r(9368),a=r.n(s),u=r(5391),c=r(2486).Buffer;class f{constructor(t,e,r,n={}){this.defaultHeaders=n;const i=new(o())(e,{});if(void 0!==r&&i.set("port",r.toString()),0===i.protocol.length)throw new Error("Invalid base server URL, protocol must be defined.");this.baseURL=i,this.tokenHeader=t}addressWithPath(t){return new(o())(a().posix.join(this.baseURL.pathname,t),this.baseURL).toString()}static superagentToHTTPClientResponse(t){return t.body instanceof ArrayBuffer&&(t.body=new Uint8Array(t.body)),t}static formatSuperagentError(t){if(t.response)try{const e=JSON.parse(c.from(t.response.body).toString());t.message=`Network request error. Received status ${t.response.status}: ${e.message}`}catch(t){}return t}async get(t,e,r={}){const n=u.get(this.addressWithPath(t)).set(this.tokenHeader).set(this.defaultHeaders).set(r).responseType("arraybuffer").query(e);try{const t=await n;return f.superagentToHTTPClientResponse(t)}catch(t){throw f.formatSuperagentError(t)}}async post(t,e,r,n={}){const i=u.post(this.addressWithPath(t)).set(this.tokenHeader).set(this.defaultHeaders).set(n).query(r).serialize((t=>t)).responseType("arraybuffer").send(c.from(e));try{const t=await i;return f.superagentToHTTPClientResponse(t)}catch(t){throw f.formatSuperagentError(t)}}async delete(t,e,r,n={}){const i=u.delete(this.addressWithPath(t)).set(this.tokenHeader).set(this.defaultHeaders).set(n).query(r).serialize((t=>t)).responseType("arraybuffer").send(c.from(e));try{const t=await i;return f.superagentToHTTPClientResponse(t)}catch(t){throw f.formatSuperagentError(t)}}}var l=r(2486).Buffer;function h(t){return Object.keys(t).reduce(((e,r)=>(e[r.toLowerCase()]=t[r],e)),{})}class d{constructor(t,e,r,n={}){this.bc=void 0!==e?new f(t,e,r,n):t}static parseJSON(t,e,r={}){try{return 0===Object.keys(r).length?t&&JSON.parse(t):t&&n.parseJSON(t,r)}catch(r){const n=r;throw n.rawResponse=t||null,n.statusCode=e,n}}static serializeData(t,e){if(!t)return new Uint8Array(0);if("application/json"===e["content-type"])return new Uint8Array(l.from(JSON.stringify(t)));if("string"==typeof t)return new Uint8Array(l.from(t));if(t instanceof Uint8Array)return t;throw new Error("provided data is neither a string nor a Uint8Array and content-type is not application/json")}static prepareResponse(t,e,r={}){let n,{body:i}=t;return"application/msgpack"!==e&&(n=i&&l.from(i).toString()||""),"application/json"===e&&(i=d.parseJSON(n,t.status,r)),{...t,body:i,text:n,ok:2===Math.trunc(t.status/100)}}static prepareResponseError(t){return t.response&&(t.response=d.prepareResponse(t.response,"application/json"),t.status=t.response.status),t}async get(t,e,r={},n={}){const i=function(t){return void 0!==t&&Object.prototype.hasOwnProperty.call(t,"format")&&"msgpack"===t.format?"application/msgpack":"application/json"}(e),o={...r,accept:i};try{const r=await this.bc.get(t,function(t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(t[e]&&0!==t[e].length||delete t[e]);return t}(e),o);return d.prepareResponse(r,i,n)}catch(t){throw d.prepareResponseError(t)}}async post(t,e,r={}){const n={"content-type":"application/json",...h(r)};try{const r=await this.bc.post(t,d.serializeData(e,n),void 0,n);return d.prepareResponse(r,"application/json")}catch(t){throw d.prepareResponseError(t)}}async delete(t,e,r={}){const n={"content-type":"application/json",...h(r)},i=await this.bc.delete(t,d.serializeData(e,n),void 0,n);return d.prepareResponse(i,"application/json")}}},6477:(t,e,r)=>{"use strict";r.d(e,{Z:()=>s});var n=r(3480),i=r(9417),o=r(2486).Buffer;class s extends n.Z{constructor(t,e="http://127.0.0.1",r=7833,n={}){super("X-KMD-API-Token",t,e,r,n)}async versions(){return(await this.c.get("/versions")).body}async listWallets(){return(await this.c.get("/v1/wallets")).body}async createWallet(t,e,r="",n="sqlite"){const i={wallet_name:t,wallet_driver_name:n,wallet_password:e,master_derivation_key:o.from(r).toString("base64")};return(await this.c.post("/v1/wallet",i)).body}async initWalletHandle(t,e){const r={wallet_id:t,wallet_password:e};return(await this.c.post("/v1/wallet/init",r)).body}async releaseWalletHandle(t){const e={wallet_handle_token:t};return(await this.c.post("/v1/wallet/release",e)).body}async renewWalletHandle(t){const e={wallet_handle_token:t};return(await this.c.post("/v1/wallet/renew",e)).body}async renameWallet(t,e,r){const n={wallet_id:t,wallet_password:e,wallet_name:r};return(await this.c.post("/v1/wallet/rename",n)).body}async getWallet(t){const e={wallet_handle_token:t};return(await this.c.post("/v1/wallet/info",e)).body}async exportMasterDerivationKey(t,e){const r={wallet_handle_token:t,wallet_password:e},n=await this.c.post("/v1/master-key/export",r);return{master_derivation_key:o.from(n.body.master_derivation_key,"base64")}}async importKey(t,e){const r={wallet_handle_token:t,private_key:o.from(e).toString("base64")};return(await this.c.post("/v1/key/import",r)).body}async exportKey(t,e,r){const n={wallet_handle_token:t,address:r,wallet_password:e},i=await this.c.post("/v1/key/export",n);return{private_key:o.from(i.body.private_key,"base64")}}async generateKey(t){const e={wallet_handle_token:t,display_mnemonic:!1};return(await this.c.post("/v1/key",e)).body}async deleteKey(t,e,r){const n={wallet_handle_token:t,address:r,wallet_password:e};return(await this.c.delete("/v1/key",n)).body}async listKeys(t){const e={wallet_handle_token:t};return(await this.c.post("/v1/key/list",e)).body}async signTransaction(t,e,r){const n=i.instantiateTxnIfNeeded(r),s={wallet_handle_token:t,wallet_password:e,transaction:o.from(n.toByte()).toString("base64")},a=await this.c.post("/v1/transaction/sign",s);return 200===a.status?o.from(a.body.signed_transaction,"base64"):a.body}async signTransactionWithSpecificPublicKey(t,e,r,n){const s=i.instantiateTxnIfNeeded(r),a={wallet_handle_token:t,wallet_password:e,transaction:o.from(s.toByte()).toString("base64"),public_key:o.from(n).toString("base64")},u=await this.c.post("/v1/transaction/sign",a);return 200===u.status?o.from(u.body.signed_transaction,"base64"):u.body}async listMultisig(t){const e={wallet_handle_token:t};return(await this.c.post("/v1/multisig/list",e)).body}async importMultisig(t,e,r,n){const i={wallet_handle_token:t,multisig_version:e,threshold:r,pks:n};return(await this.c.post("/v1/multisig/import",i)).body}async exportMultisig(t,e){const r={wallet_handle_token:t,address:e};return(await this.c.post("/v1/multisig/export",r)).body}async signMultisigTransaction(t,e,r,n,s){const a=i.instantiateTxnIfNeeded(r),u={wallet_handle_token:t,transaction:o.from(a.toByte()).toString("base64"),public_key:o.from(n).toString("base64"),partial_multisig:s,wallet_password:e};return(await this.c.post("/v1/multisig/sign",u)).body}async deleteMultisig(t,e,r){const n={wallet_handle_token:t,address:r,wallet_password:e};return(await this.c.delete("/v1/multisig",n)).body}}},1663:(t,e,r)=>{"use strict";r.d(e,{Z:()=>I});var n=r(3480),i=r(8680);class o extends i.Z{constructor(t,e,r){super(t,e),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}`}exclude(t){return this.query.exclude=t,this}}class s extends i.Z{constructor(t,e,r,n){super(t,e),this.account=r,this.assetID=n,this.account=r,this.assetID=n}path(){return`/v2/accounts/${this.account}/assets/${this.assetID}`}}class a extends i.Z{constructor(t,e,r,n){super(t,e),this.account=r,this.applicationID=n,this.account=r,this.applicationID=n}path(){return`/v2/accounts/${this.account}/applications/${this.applicationID}`}}var u=r(3033);class c extends i.Z{constructor(t,e){if(super(t),!Number.isInteger(e))throw Error("roundNumber should be an integer");this.round=e,this.query={format:"msgpack"}}path(){return`/v2/blocks/${this.round}`}prepare(t){if(t&&t.byteLength>0)return u.decode(t)}}var f=r(2486).Buffer;function l(t={}){let e=t;return Object.keys(e).every((t=>"content-type"!==t.toLowerCase()))&&(e={...t},e["Content-Type"]="text/plain"),e}class h extends i.Z{constructor(t,e){super(t),this.source=e,this.source=e}path(){return"/v2/teal/compile"}async do(t={}){const e=l(t);return(await this.c.post(this.path(),f.from(this.source),e)).body}}var d=r(2486).Buffer;class p extends i.Z{constructor(t,e){super(t),this.blob=u.encode(e.get_obj_for_encoding(!0))}path(){return"/v2/teal/dryrun"}async do(t={}){const e=l(t);return(await this.c.post(this.path(),d.from(this.blob),e)).body}}class m extends i.Z{constructor(t,e,r){super(t,e),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}`}}class g extends i.Z{constructor(t,e,r){super(t,e),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}`}}class b extends i.Z{path(){return"/health"}async do(t={}){const e=await this.c.get(this.path(),{},t);if(!e.ok)throw new Error(`Health response: ${e.status}`);return{}}}class y extends i.Z{constructor(t,e){super(t),this.txid=e,this.txid=e,this.query.format="msgpack"}prepare(t){if(t&&t.byteLength>0)return u.decode(t)}path(){return`/v2/transactions/pending/${this.txid}`}max(t){return this.query.max=t,this}}class v extends i.Z{constructor(t){super(t),this.query.format="msgpack"}path(){return"/v2/transactions/pending"}prepare(t){if(t&&t.byteLength>0)return u.decode(t)}max(t){return this.query.max=t,this}}class w extends i.Z{constructor(t,e){super(t),this.address=e,this.address=e,this.query.format="msgpack"}prepare(t){if(t&&t.byteLength>0)return u.decode(t)}path(){return`/v2/accounts/${this.address}/transactions/pending`}max(t){return this.query.max=t,this}}var _=r(5180);class A extends i.Z{path(){return"/v2/status"}}class E extends i.Z{constructor(t,e,r){if(super(t,e),this.round=r,!Number.isInteger(r))throw Error("round should be an integer");this.round=r}path(){return`/v2/status/wait-for-block-after/${this.round}`}}class S extends i.Z{path(){return"/v2/transactions/params"}prepare(t){return{flatFee:!1,fee:t.fee,firstRound:t["last-round"],lastRound:t["last-round"]+1e3,genesisID:t["genesis-id"],genesisHash:t["genesis-hash"]}}}class M extends i.Z{path(){return"/v2/ledger/supply"}}class x extends i.Z{path(){return"/versions"}}class k extends i.Z{path(){return"/genesis"}}class T extends i.Z{constructor(t,e,r,n){super(t,e),this.round=r,this.txID=n,this.round=r,this.txID=n}path(){return`/v2/blocks/${this.round}/transactions/${this.txID}/proof`}}class I extends n.Z{constructor(t,e="http://r2.algorand.network",r=4180,n={}){super("X-Algo-API-Token",t,e,r,n)}healthCheck(){return new b(this.c)}versionsCheck(){return new x(this.c)}sendRawTransaction(t){return new _.default(this.c,t)}accountInformation(t){return new o(this.c,this.intDecoding,t)}accountAssetInformation(t,e){return new s(this.c,this.intDecoding,t,e)}accountApplicationInformation(t,e){return new a(this.c,this.intDecoding,t,e)}block(t){return new c(this.c,t)}pendingTransactionInformation(t){return new y(this.c,t)}pendingTransactionsInformation(){return new v(this.c)}pendingTransactionByAddress(t){return new w(this.c,t)}status(){return new A(this.c,this.intDecoding)}statusAfterBlock(t){return new E(this.c,this.intDecoding,t)}getTransactionParams(){return new S(this.c)}supply(){return new M(this.c,this.intDecoding)}compile(t){return new h(this.c,t)}dryrun(t){return new p(this.c,t)}getAssetByID(t){return new m(this.c,this.intDecoding,t)}getApplicationByID(t){return new g(this.c,this.intDecoding,t)}genesis(){return new k(this.c,this.intDecoding)}getProof(t,e){return new T(this.c,this.intDecoding,t,e)}}},227:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Account:()=>a,AccountApplicationResponse:()=>u,AccountAssetResponse:()=>c,AccountParticipation:()=>f,AccountStateDelta:()=>l,Application:()=>h,ApplicationLocalState:()=>d,ApplicationParams:()=>p,ApplicationStateSchema:()=>m,Asset:()=>g,AssetHolding:()=>b,AssetParams:()=>y,BlockResponse:()=>v,BuildVersion:()=>w,CatchpointAbortResponse:()=>_,CatchpointStartResponse:()=>A,CompileResponse:()=>E,DryrunRequest:()=>S,DryrunResponse:()=>M,DryrunSource:()=>x,DryrunState:()=>k,DryrunTxnResult:()=>T,ErrorResponse:()=>I,EvalDelta:()=>C,EvalDeltaKeyValue:()=>R,NodeStatusResponse:()=>B,PendingTransactionResponse:()=>N,PendingTransactionsResponse:()=>O,PostTransactionsResponse:()=>P,ProofResponse:()=>D,SupplyResponse:()=>L,TealKeyValue:()=>U,TealValue:()=>j,TransactionParametersResponse:()=>F,Version:()=>q});var n=r(2486).Buffer;function i(t,e){let r;if(t instanceof Uint8Array)r=e?t:n.from(t).toString("base64");else if("function"==typeof t.get_obj_for_encoding)r=t.get_obj_for_encoding(e);else if(Array.isArray(t)){r=[];for(const n of t)r.push(i(n,e))}else if("object"==typeof t){const n={};for(const r of Object.keys(t))n[r]=i(t[r],e);r=n}else{if(!function(t){return void 0===t||null==t||"object"!=typeof t&&"function"!=typeof t}(t))throw new Error(`Unsupported value: ${String(t)}`);r=t}return r}class o{get_obj_for_encoding(t=!1){const e={};for(const r of Object.keys(this.attribute_map)){const n=this.attribute_map[r],o=this[r];void 0!==o&&(e[n]=null===o?null:i(o,t))}return e}}var s=r(2486).Buffer;class a extends o{constructor({address:t,amount:e,amountWithoutPendingRewards:r,minBalance:n,pendingRewards:i,rewards:o,round:s,status:a,totalAppsOptedIn:u,totalAssetsOptedIn:c,totalCreatedApps:f,totalCreatedAssets:l,appsLocalState:h,appsTotalExtraPages:d,appsTotalSchema:p,assets:m,authAddr:g,createdApps:b,createdAssets:y,participation:v,rewardBase:w,sigType:_}){super(),this.address=t,this.amount=e,this.amountWithoutPendingRewards=r,this.minBalance=n,this.pendingRewards=i,this.rewards=o,this.round=s,this.status=a,this.totalAppsOptedIn=u,this.totalAssetsOptedIn=c,this.totalCreatedApps=f,this.totalCreatedAssets=l,this.appsLocalState=h,this.appsTotalExtraPages=d,this.appsTotalSchema=p,this.assets=m,this.authAddr=g,this.createdApps=b,this.createdAssets=y,this.participation=v,this.rewardBase=w,this.sigType=_,this.attribute_map={address:"address",amount:"amount",amountWithoutPendingRewards:"amount-without-pending-rewards",minBalance:"min-balance",pendingRewards:"pending-rewards",rewards:"rewards",round:"round",status:"status",totalAppsOptedIn:"total-apps-opted-in",totalAssetsOptedIn:"total-assets-opted-in",totalCreatedApps:"total-created-apps",totalCreatedAssets:"total-created-assets",appsLocalState:"apps-local-state",appsTotalExtraPages:"apps-total-extra-pages",appsTotalSchema:"apps-total-schema",assets:"assets",authAddr:"auth-addr",createdApps:"created-apps",createdAssets:"created-assets",participation:"participation",rewardBase:"reward-base",sigType:"sig-type"}}}class u extends o{constructor(t,e,r){super(),this.round=t,this.appLocalState=e,this.createdApp=r,this.attribute_map={round:"round",appLocalState:"app-local-state",createdApp:"created-app"}}}class c extends o{constructor(t,e,r){super(),this.round=t,this.assetHolding=e,this.createdAsset=r,this.attribute_map={round:"round",assetHolding:"asset-holding",createdAsset:"created-asset"}}}class f extends o{constructor({selectionParticipationKey:t,voteFirstValid:e,voteKeyDilution:r,voteLastValid:n,voteParticipationKey:i,stateProofKey:o}){super(),this.selectionParticipationKey="string"==typeof t?new Uint8Array(s.from(t,"base64")):t,this.voteFirstValid=e,this.voteKeyDilution=r,this.voteLastValid=n,this.voteParticipationKey="string"==typeof i?new Uint8Array(s.from(i,"base64")):i,this.stateProofKey="string"==typeof o?new Uint8Array(s.from(o,"base64")):o,this.attribute_map={selectionParticipationKey:"selection-participation-key",voteFirstValid:"vote-first-valid",voteKeyDilution:"vote-key-dilution",voteLastValid:"vote-last-valid",voteParticipationKey:"vote-participation-key",stateProofKey:"state-proof-key"}}}class l extends o{constructor(t,e){super(),this.address=t,this.delta=e,this.attribute_map={address:"address",delta:"delta"}}}class h extends o{constructor(t,e){super(),this.id=t,this.params=e,this.attribute_map={id:"id",params:"params"}}}class d extends o{constructor(t,e,r){super(),this.id=t,this.schema=e,this.keyValue=r,this.attribute_map={id:"id",schema:"schema",keyValue:"key-value"}}}class p extends o{constructor({approvalProgram:t,clearStateProgram:e,creator:r,extraProgramPages:n,globalState:i,globalStateSchema:o,localStateSchema:a}){super(),this.approvalProgram="string"==typeof t?new Uint8Array(s.from(t,"base64")):t,this.clearStateProgram="string"==typeof e?new Uint8Array(s.from(e,"base64")):e,this.creator=r,this.extraProgramPages=n,this.globalState=i,this.globalStateSchema=o,this.localStateSchema=a,this.attribute_map={approvalProgram:"approval-program",clearStateProgram:"clear-state-program",creator:"creator",extraProgramPages:"extra-program-pages",globalState:"global-state",globalStateSchema:"global-state-schema",localStateSchema:"local-state-schema"}}}class m extends o{constructor(t,e){super(),this.numUint=t,this.numByteSlice=e,this.attribute_map={numUint:"num-uint",numByteSlice:"num-byte-slice"}}}class g extends o{constructor(t,e){super(),this.index=t,this.params=e,this.attribute_map={index:"index",params:"params"}}}class b extends o{constructor(t,e,r){super(),this.amount=t,this.assetId=e,this.isFrozen=r,this.attribute_map={amount:"amount",assetId:"asset-id",isFrozen:"is-frozen"}}}class y extends o{constructor({creator:t,decimals:e,total:r,clawback:n,defaultFrozen:i,freeze:o,manager:a,metadataHash:u,name:c,nameB64:f,reserve:l,unitName:h,unitNameB64:d,url:p,urlB64:m}){super(),this.creator=t,this.decimals=e,this.total=r,this.clawback=n,this.defaultFrozen=i,this.freeze=o,this.manager=a,this.metadataHash="string"==typeof u?new Uint8Array(s.from(u,"base64")):u,this.name=c,this.nameB64="string"==typeof f?new Uint8Array(s.from(f,"base64")):f,this.reserve=l,this.unitName=h,this.unitNameB64="string"==typeof d?new Uint8Array(s.from(d,"base64")):d,this.url=p,this.urlB64="string"==typeof m?new Uint8Array(s.from(m,"base64")):m,this.attribute_map={creator:"creator",decimals:"decimals",total:"total",clawback:"clawback",defaultFrozen:"default-frozen",freeze:"freeze",manager:"manager",metadataHash:"metadata-hash",name:"name",nameB64:"name-b64",reserve:"reserve",unitName:"unit-name",unitNameB64:"unit-name-b64",url:"url",urlB64:"url-b64"}}}class v extends o{constructor(t,e){super(),this.block=t,this.cert=e,this.attribute_map={block:"block",cert:"cert"}}}class w extends o{constructor({branch:t,buildNumber:e,channel:r,commitHash:n,major:i,minor:o}){super(),this.branch=t,this.buildNumber=e,this.channel=r,this.commitHash=n,this.major=i,this.minor=o,this.attribute_map={branch:"branch",buildNumber:"build_number",channel:"channel",commitHash:"commit_hash",major:"major",minor:"minor"}}}class _ extends o{constructor(t){super(),this.catchupMessage=t,this.attribute_map={catchupMessage:"catchup-message"}}}class A extends o{constructor(t){super(),this.catchupMessage=t,this.attribute_map={catchupMessage:"catchup-message"}}}class E extends o{constructor(t,e){super(),this.hash=t,this.result=e,this.attribute_map={hash:"hash",result:"result"}}}class S extends o{constructor({accounts:t,apps:e,latestTimestamp:r,protocolVersion:n,round:i,sources:o,txns:s}){super(),this.accounts=t,this.apps=e,this.latestTimestamp=r,this.protocolVersion=n,this.round=i,this.sources=o,this.txns=s,this.attribute_map={accounts:"accounts",apps:"apps",latestTimestamp:"latest-timestamp",protocolVersion:"protocol-version",round:"round",sources:"sources",txns:"txns"}}}class M extends o{constructor(t,e,r){super(),this.error=t,this.protocolVersion=e,this.txns=r,this.attribute_map={error:"error",protocolVersion:"protocol-version",txns:"txns"}}}class x extends o{constructor(t,e,r,n){super(),this.fieldName=t,this.source=e,this.txnIndex=r,this.appIndex=n,this.attribute_map={fieldName:"field-name",source:"source",txnIndex:"txn-index",appIndex:"app-index"}}}class k extends o{constructor({line:t,pc:e,stack:r,error:n,scratch:i}){super(),this.line=t,this.pc=e,this.stack=r,this.error=n,this.scratch=i,this.attribute_map={line:"line",pc:"pc",stack:"stack",error:"error",scratch:"scratch"}}}class T extends o{constructor({disassembly:t,appCallMessages:e,appCallTrace:r,cost:n,globalDelta:i,localDeltas:o,logicSigDisassembly:s,logicSigMessages:a,logicSigTrace:u,logs:c}){super(),this.disassembly=t,this.appCallMessages=e,this.appCallTrace=r,this.cost=n,this.globalDelta=i,this.localDeltas=o,this.logicSigDisassembly=s,this.logicSigMessages=a,this.logicSigTrace=u,this.logs=c,this.attribute_map={disassembly:"disassembly",appCallMessages:"app-call-messages",appCallTrace:"app-call-trace",cost:"cost",globalDelta:"global-delta",localDeltas:"local-deltas",logicSigDisassembly:"logic-sig-disassembly",logicSigMessages:"logic-sig-messages",logicSigTrace:"logic-sig-trace",logs:"logs"}}}class I extends o{constructor(t,e){super(),this.message=t,this.data=e,this.attribute_map={message:"message",data:"data"}}}class C extends o{constructor(t,e,r){super(),this.action=t,this.bytes=e,this.uint=r,this.attribute_map={action:"action",bytes:"bytes",uint:"uint"}}}class R extends o{constructor(t,e){super(),this.key=t,this.value=e,this.attribute_map={key:"key",value:"value"}}}class B extends o{constructor({catchupTime:t,lastRound:e,lastVersion:r,nextVersion:n,nextVersionRound:i,nextVersionSupported:o,stoppedAtUnsupportedRound:s,timeSinceLastRound:a,catchpoint:u,catchpointAcquiredBlocks:c,catchpointProcessedAccounts:f,catchpointTotalAccounts:l,catchpointTotalBlocks:h,catchpointVerifiedAccounts:d,lastCatchpoint:p}){super(),this.catchupTime=t,this.lastRound=e,this.lastVersion=r,this.nextVersion=n,this.nextVersionRound=i,this.nextVersionSupported=o,this.stoppedAtUnsupportedRound=s,this.timeSinceLastRound=a,this.catchpoint=u,this.catchpointAcquiredBlocks=c,this.catchpointProcessedAccounts=f,this.catchpointTotalAccounts=l,this.catchpointTotalBlocks=h,this.catchpointVerifiedAccounts=d,this.lastCatchpoint=p,this.attribute_map={catchupTime:"catchup-time",lastRound:"last-round",lastVersion:"last-version",nextVersion:"next-version",nextVersionRound:"next-version-round",nextVersionSupported:"next-version-supported",stoppedAtUnsupportedRound:"stopped-at-unsupported-round",timeSinceLastRound:"time-since-last-round",catchpoint:"catchpoint",catchpointAcquiredBlocks:"catchpoint-acquired-blocks",catchpointProcessedAccounts:"catchpoint-processed-accounts",catchpointTotalAccounts:"catchpoint-total-accounts",catchpointTotalBlocks:"catchpoint-total-blocks",catchpointVerifiedAccounts:"catchpoint-verified-accounts",lastCatchpoint:"last-catchpoint"}}}class N extends o{constructor({poolError:t,txn:e,applicationIndex:r,assetClosingAmount:n,assetIndex:i,closeRewards:o,closingAmount:s,confirmedRound:a,globalStateDelta:u,innerTxns:c,localStateDelta:f,logs:l,receiverRewards:h,senderRewards:d}){super(),this.poolError=t,this.txn=e,this.applicationIndex=r,this.assetClosingAmount=n,this.assetIndex=i,this.closeRewards=o,this.closingAmount=s,this.confirmedRound=a,this.globalStateDelta=u,this.innerTxns=c,this.localStateDelta=f,this.logs=l,this.receiverRewards=h,this.senderRewards=d,this.attribute_map={poolError:"pool-error",txn:"txn",applicationIndex:"application-index",assetClosingAmount:"asset-closing-amount",assetIndex:"asset-index",closeRewards:"close-rewards",closingAmount:"closing-amount",confirmedRound:"confirmed-round",globalStateDelta:"global-state-delta",innerTxns:"inner-txns",localStateDelta:"local-state-delta",logs:"logs",receiverRewards:"receiver-rewards",senderRewards:"sender-rewards"}}}class O extends o{constructor(t,e){super(),this.topTransactions=t,this.totalTransactions=e,this.attribute_map={topTransactions:"top-transactions",totalTransactions:"total-transactions"}}}class P extends o{constructor(t){super(),this.txid=t,this.attribute_map={txid:"txId"}}}class D extends o{constructor({idx:t,proof:e,stibhash:r,treedepth:n,hashtype:i}){super(),this.idx=t,this.proof="string"==typeof e?new Uint8Array(s.from(e,"base64")):e,this.stibhash="string"==typeof r?new Uint8Array(s.from(r,"base64")):r,this.treedepth=n,this.hashtype=i,this.attribute_map={idx:"idx",proof:"proof",stibhash:"stibhash",treedepth:"treedepth",hashtype:"hashtype"}}}class L extends o{constructor(t,e,r){super(),this.currentRound=t,this.onlineMoney=e,this.totalMoney=r,this.attribute_map={currentRound:"current_round",onlineMoney:"online-money",totalMoney:"total-money"}}}class U extends o{constructor(t,e){super(),this.key=t,this.value=e,this.attribute_map={key:"key",value:"value"}}}class j extends o{constructor(t,e,r){super(),this.type=t,this.bytes=e,this.uint=r,this.attribute_map={type:"type",bytes:"bytes",uint:"uint"}}}class F extends o{constructor({consensusVersion:t,fee:e,genesisHash:r,genesisId:n,lastRound:i,minFee:o}){super(),this.consensusVersion=t,this.fee=e,this.genesisHash="string"==typeof r?new Uint8Array(s.from(r,"base64")):r,this.genesisId=n,this.lastRound=i,this.minFee=o,this.attribute_map={consensusVersion:"consensus-version",fee:"fee",genesisHash:"genesis-hash",genesisId:"genesis-id",lastRound:"last-round",minFee:"min-fee"}}}class q extends o{constructor(t,e,r,n){super(),this.build=t,this.genesisHashB64="string"==typeof e?new Uint8Array(s.from(e,"base64")):e,this.genesisId=r,this.versions=n,this.attribute_map={build:"build",genesisHashB64:"genesis_hash_b64",genesisId:"genesis_id",versions:"versions"}}}},5180:(t,e,r)=>{"use strict";r.r(e),r.d(e,{setSendTransactionHeaders:()=>s,default:()=>u});var n=r(8680),i=r(413),o=r(2486).Buffer;function s(t={}){let e=t;return Object.keys(e).every((t=>"content-type"!==t.toLowerCase()))&&(e={...t},e["Content-Type"]="application/x-binary"),e}function a(t){return t&&void 0!==t.byteLength}class u extends n.Z{constructor(t,e){super(t);let r=e;if(Array.isArray(e)){if(!e.every(a))throw new TypeError("Array elements must be byte arrays");r=(0,i.concatArrays)(...e)}else if(!a(r))throw new TypeError("Argument must be byte array");this.txnBytesToPost=r}path(){return"/v2/transactions"}async do(t={}){const e=s(t);return(await this.c.post(this.path(),o.from(this.txnBytesToPost),e)).body}}},9582:(t,e,r)=>{"use strict";r.d(e,{Z:()=>M});var n=r(3480),i=r(8680);class o extends i.Z{path(){return"/health"}}class s extends i.Z{constructor(t,e,r){super(t,e),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}/balances`}limit(t){return this.query.limit=t,this}currencyGreaterThan(t){return this.query["currency-greater-than"]=t,this}currencyLessThan(t){return this.query["currency-less-than"]=t,this}nextToken(t){return this.query.next=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}}var a=r(2486).Buffer;function u(t){return"string"==typeof t?t:a.from(t).toString("base64")}class c extends i.Z{constructor(t,e,r){super(t,e),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/transactions`}notePrefix(t){return this.query["note-prefix"]=u(t),this}txType(t){return this.query["tx-type"]=t,this}sigType(t){return this.query["sig-type"]=t,this}txid(t){return this.query.txid=t,this}round(t){return this.query.round=t,this}minRound(t){return this.query["min-round"]=t,this}maxRound(t){return this.query["max-round"]=t,this}assetID(t){return this.query["asset-id"]=t,this}limit(t){return this.query.limit=t,this}beforeTime(t){return this.query["before-time"]=t,this}afterTime(t){return this.query["after-time"]=t,this}currencyGreaterThan(t){return this.query["currency-greater-than"]=t,this}currencyLessThan(t){return this.query["currency-less-than"]=t,this}nextToken(t){return this.query.next=t,this}rekeyTo(t){return this.query["rekey-to"]=t,this}}class f extends i.Z{constructor(t,e,r){super(t,e),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}/transactions`}notePrefix(t){return this.query["note-prefix"]=u(t),this}txType(t){return this.query["tx-type"]=t,this}sigType(t){return this.query["sig-type"]=t,this}txid(t){return this.query.txid=t,this}round(t){return this.query.round=t,this}minRound(t){return this.query["min-round"]=t,this}maxRound(t){return this.query["max-round"]=t,this}assetID(t){return this.query["asset-id"]=t,this}limit(t){return this.query.limit=t,this}beforeTime(t){return this.query["before-time"]=t,this}afterTime(t){return this.query["after-time"]=t,this}currencyGreaterThan(t){return this.query["currency-greater-than"]=t,this}currencyLessThan(t){return this.query["currency-less-than"]=t,this}addressRole(t){return this.query["address-role"]=t,this}address(t){return this.query.address=t,this}excludeCloseTo(t){return this.query["exclude-close-to"]=t,this}nextToken(t){return this.query.next=t,this}rekeyTo(t){return this.query["rekey-to"]=t,this}}class l extends i.Z{constructor(t,e,r){super(t,e),this.round=r,this.round=r}path(){return`/v2/blocks/${this.round}`}}class h extends i.Z{constructor(t,e,r){super(t,e),this.txID=r,this.txID=r}path(){return`/v2/transactions/${this.txID}`}}class d extends i.Z{constructor(t,e,r){super(t,e),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}`}round(t){return this.query.round=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}exclude(t){return this.query.exclude=t,this}}class p extends i.Z{constructor(t,e,r){super(t,e),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/assets`}limit(t){return this.query.limit=t,this}round(t){return this.query.round=t,this}nextToken(t){return this.query.next=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}assetId(t){return this.query["asset-id"]=t,this}}class m extends i.Z{constructor(t,e,r){super(t,e),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/created-assets`}limit(t){return this.query.limit=t,this}round(t){return this.query.round=t,this}nextToken(t){return this.query.next=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}assetID(t){return this.query["asset-id"]=t,this}}class g extends i.Z{constructor(t,e,r){super(t,e),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/apps-local-state`}limit(t){return this.query.limit=t,this}round(t){return this.query.round=t,this}nextToken(t){return this.query.next=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}applicationID(t){return this.query["application-id"]=t,this}}class b extends i.Z{constructor(t,e,r){super(t,e),this.account=r,this.account=r}path(){return`/v2/accounts/${this.account}/created-applications`}limit(t){return this.query.limit=t,this}round(t){return this.query.round=t,this}nextToken(t){return this.query.next=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}applicationID(t){return this.query["application-id"]=t,this}}class y extends i.Z{constructor(t,e,r){super(t,e),this.index=r,this.index=r}path(){return`/v2/assets/${this.index}`}includeAll(t=!0){return this.query["include-all"]=t,this}}class v extends i.Z{constructor(t,e,r){super(t,e),this.index=r,this.index=r}path(){return`/v2/applications/${this.index}`}includeAll(t=!0){return this.query["include-all"]=t,this}}class w extends i.Z{constructor(t,e,r){super(t,e),this.appID=r,this.appID=r}path(){return`/v2/applications/${this.appID}/logs`}limit(t){return this.query.limit=t,this}minRound(t){return this.query["min-round"]=t,this}maxRound(t){return this.query["max-round"]=t,this}nextToken(t){return this.query.next=t,this}sender(t){return this.query["sender-address"]=t,this}txid(t){return this.query.txid=t,this}}class _ extends i.Z{path(){return"/v2/accounts"}currencyGreaterThan(t){return this.query["currency-greater-than"]=t,this}currencyLessThan(t){return this.query["currency-less-than"]=t,this}limit(t){return this.query.limit=t,this}assetID(t){return this.query["asset-id"]=t,this}nextToken(t){return this.query.next=t,this}round(t){return this.query.round=t,this}authAddr(t){return this.query["auth-addr"]=t,this}applicationID(t){return this.query["application-id"]=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}exclude(t){return this.query.exclude=t,this}}class A extends i.Z{path(){return"/v2/transactions"}notePrefix(t){return this.query["note-prefix"]=u(t),this}txType(t){return this.query["tx-type"]=t,this}sigType(t){return this.query["sig-type"]=t,this}txid(t){return this.query.txid=t,this}round(t){return this.query.round=t,this}minRound(t){return this.query["min-round"]=t,this}maxRound(t){return this.query["max-round"]=t,this}assetID(t){return this.query["asset-id"]=t,this}limit(t){return this.query.limit=t,this}beforeTime(t){return this.query["before-time"]=t,this}afterTime(t){return this.query["after-time"]=t,this}currencyGreaterThan(t){return this.query["currency-greater-than"]=t,this}currencyLessThan(t){return this.query["currency-less-than"]=t,this}addressRole(t){return this.query["address-role"]=t,this}address(t){return this.query.address=t,this}excludeCloseTo(t){return this.query["exclude-close-to"]=t,this}nextToken(t){return this.query.next=t,this}rekeyTo(t){return this.query["rekey-to"]=t,this}applicationID(t){return this.query["application-id"]=t,this}}class E extends i.Z{path(){return"/v2/assets"}limit(t){return this.query.limit=t,this}creator(t){return this.query.creator=t,this}name(t){return this.query.name=t,this}unit(t){return this.query.unit=t,this}index(t){return this.query["asset-id"]=t,this}nextToken(t){return this.query.next=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}}class S extends i.Z{path(){return"/v2/applications"}index(t){return this.query["application-id"]=t,this}creator(t){return this.query.creator=t,this}nextToken(t){return this.query.next=t,this}limit(t){return this.query.limit=t,this}includeAll(t=!0){return this.query["include-all"]=t,this}}class M extends n.Z{constructor(t,e="http://127.0.0.1",r=8080,n={}){super("X-Indexer-API-Token",t,e,r,n)}makeHealthCheck(){return new o(this.c,this.intDecoding)}lookupAssetBalances(t){return new s(this.c,this.intDecoding,t)}lookupAssetTransactions(t){return new f(this.c,this.intDecoding,t)}lookupAccountTransactions(t){return new c(this.c,this.intDecoding,t)}lookupBlock(t){return new l(this.c,this.intDecoding,t)}lookupTransactionByID(t){return new h(this.c,this.intDecoding,t)}lookupAccountByID(t){return new d(this.c,this.intDecoding,t)}lookupAccountAssets(t){return new p(this.c,this.intDecoding,t)}lookupAccountCreatedAssets(t){return new m(this.c,this.intDecoding,t)}lookupAccountAppLocalStates(t){return new g(this.c,this.intDecoding,t)}lookupAccountCreatedApplications(t){return new b(this.c,this.intDecoding,t)}lookupAssetByID(t){return new y(this.c,this.intDecoding,t)}lookupApplications(t){return new v(this.c,this.intDecoding,t)}lookupApplicationLogs(t){return new w(this.c,this.intDecoding,t)}searchAccounts(){return new _(this.c,this.intDecoding)}searchForTransactions(){return new A(this.c,this.intDecoding)}searchForAssets(){return new E(this.c,this.intDecoding)}searchForApplications(){return new S(this.c,this.intDecoding)}}},8680:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(7197);class i{constructor(t,e){this.c=t,this.query={},this.intDecoding=e||n.Z.DEFAULT}prepare(t){return t}async do(t={}){const e={};"default"!==this.intDecoding&&(e.intDecoding=this.intDecoding);const r=await this.c.get(this.path(),this.query,t,e);return this.prepare(r.body)}setIntDecoding(t){if("default"!==t&&"safe"!==t&&"mixed"!==t&&"bigint"!==t)throw new Error(`Invalid method for int decoding: ${t}`);return this.intDecoding=t,this}}},3480:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(1113),i=r(7197);class o{constructor(t,e,r,o,s={}){if("function"==typeof e.get)this.c=new n.default(e);else{let i;i="string"==typeof e?function(t="",e){const r={};return r[e]=t,r}(e,t):e,this.c=new n.default(i,r,o,s)}this.intDecoding=i.Z.DEFAULT}setIntEncoding(t){this.intDecoding=t}getIntEncoding(){return this.intDecoding}}},3458:(t,e,r)=>{"use strict";r.d(e,{b:()=>h,A:()=>p});var n=r(7677),i=r(9417),o=r(1988),s=r(1063),a=r(5062),u=r(834),c=r(1624),f=r(2486).Buffer;const l=f.from([21,31,124,117]);var h;function d(t,e,r){if(null!=r&&t===r)return 0;const n=null==r?0:1;for(let r=0;r<e.length;r++)if(t===e[r])return r+n;return e.push(t),e.length-1+n}!function(t){t[t.BUILDING=0]="BUILDING",t[t.BUILT=1]="BUILT",t[t.SIGNED=2]="SIGNED",t[t.SUBMITTED=3]="SUBMITTED",t[t.COMMITTED=4]="COMMITTED"}(h||(h={}));class p{constructor(){this.status=h.BUILDING,this.transactions=[],this.methodCalls=new Map,this.signedTxns=[],this.txIDs=[]}getStatus(){return this.status}count(){return this.transactions.length}clone(){const t=new p;return t.transactions=this.transactions.map((({txn:t,signer:e})=>({txn:i.Transaction.from_obj_for_encoding({...t.get_obj_for_encoding(),grp:void 0}),signer:e}))),t.methodCalls=new Map(this.methodCalls),t}addTransaction(t){if(this.status!==h.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length===p.MAX_GROUP_SIZE)throw new Error(`Adding an additional transaction exceeds the maximum atomic group size of ${p.MAX_GROUP_SIZE}`);if(t.txn.group&&t.txn.group.some((t=>0!==t)))throw new Error("Cannot add a transaction with nonzero group ID");this.transactions.push(t)}addMethodCall({appID:t,method:e,methodArgs:r,sender:i,suggestedParams:s,onComplete:a,approvalProgram:f,clearProgram:l,numGlobalInts:m,numGlobalByteSlices:g,numLocalInts:b,numLocalByteSlices:y,extraPages:v,note:w,lease:_,rekeyTo:A,signer:E}){if(this.status!==h.BUILDING)throw new Error("Cannot add transactions when composer status is not BUILDING");if(this.transactions.length+e.txnCount()>p.MAX_GROUP_SIZE)throw new Error(`Adding additional transactions exceeds the maximum atomic group size of ${p.MAX_GROUP_SIZE}`);if(0===t){if(null==f||null==l||null==m||null==g||null==b||null==y)throw new Error("One of the following required parameters for application creation is missing: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices")}else if(a===c.hq.UpdateApplicationOC){if(null==f||null==l)throw new Error("One of the following required parameters for OnApplicationComplete.UpdateApplicationOC is missing: approvalProgram, clearProgram");if(null!=m||null!=g||null!=b||null!=y||null!=v)throw new Error("One of the following application creation parameters were set on a non-creation call: numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages")}else if(null!=f||null!=l||null!=m||null!=g||null!=b||null!=y||null!=v)throw new Error("One of the following application creation parameters were set on a non-creation call: approvalProgram, clearProgram, numGlobalInts, numGlobalByteSlices, numLocalInts, numLocalByteSlices, extraPages");if(null==r&&(r=[]),r.length!==e.args.length)throw new Error(`Incorrect number of method arguments. Expected ${e.args.length}, got ${r.length}`);let S=[],M=[];const x=[],k=[],T=[],I=new Map;for(let t=0;t<r.length;t++){let i=e.args[t].type;const o=r[t];if((0,n.AE)(i)){if(!(0,u.Xw)(o)||!(0,n.vJ)(i,o.txn))throw new Error(`Expected ${i} transaction for argument at index ${t}`);if(o.txn.group&&o.txn.group.some((t=>0!==t)))throw new Error("Cannot add a transaction with nonzero group ID");x.push(o)}else{if((0,u.Xw)(o))throw new Error(`Expected non-transaction value for argument at index ${t}`);if((0,n.o5)(i)&&(I.set(k.length,S.length),k.push(i),T.push(o),i=new n.Pu(8)),"string"==typeof i)throw new Error(`Unknown ABI type: ${i}`);S.push(i),M.push(o)}}const C=[],R=[],B=[],N=[];for(let e=0;e<k.length;e++){const r=k[e],o=T[e];let s=0;switch(r){case n.UV.account:{const t=new n.JQ;s=d(t.decode(t.encode(o)),R,i);break}case n.UV.application:{const e=new n.Pu(64),r=e.decode(e.encode(o));if(r>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for application value, got ${r}`);s=d(Number(r),B,t);break}case n.UV.asset:{const t=new n.Pu(64),e=t.decode(t.encode(o));if(e>Number.MAX_SAFE_INTEGER)throw new Error(`Expected safe integer for asset value, got ${e}`);s=d(Number(e),N);break}default:throw new Error(`Unknown reference type: ${r}`)}C.push(s)}for(let t=0;t<C.length;t++)M[I.get(t)]=C[t];if(S.length>15){const t=S.slice(14),e=M.slice(14);S=S.slice(0,14),M=M.slice(0,14),S.push(new n.w1(t)),M.push(e)}const O=[e.getSelector()];for(let t=0;t<S.length;t++)O.push(S[t].encode(M[t]));const P={txn:(0,o.makeApplicationCallTxnFromObject)({from:i,appIndex:t,appArgs:O,accounts:R,foreignApps:B,foreignAssets:N,onComplete:null==a?c.hq.NoOpOC:a,approvalProgram:f,clearProgram:l,numGlobalInts:m,numGlobalByteSlices:g,numLocalInts:b,numLocalByteSlices:y,extraPages:v,lease:_,note:w,rekeyTo:A,suggestedParams:s}),signer:E};this.transactions.push(...x,P),this.methodCalls.set(this.transactions.length-1,e)}buildGroup(){if(this.status===h.BUILDING){if(0===this.transactions.length)throw new Error("Cannot build a group with 0 transactions");this.transactions.length>1&&(0,s.assignGroupID)(this.transactions.map((t=>t.txn))),this.status=h.BUILT}return this.transactions}async gatherSignatures(){if(this.status>=h.SIGNED)return this.signedTxns;const t=this.buildGroup(),e=t.map((t=>t.txn)),r=new Map;for(let e=0;e<t.length;e++){const{signer:n}=t[e];r.has(n)||r.set(n,[]),r.get(n).push(e)}const n=Array.from(r),o=await Promise.all(n.map((([t,r])=>t(e,r)))),s=t.map((()=>null));for(let t=0;t<n.length;t++){const e=n[t][1],r=o[t];for(let t=0;t<e.length;t++)s[e[t]]=r[t]}if(!s.every((t=>null!=t)))throw new Error(`Missing signatures. Got ${s}`);const a=s.map(((t,e)=>{try{return(0,i.decodeSignedTransaction)(t).txn.txID()}catch(t){throw new Error(`Cannot decode signed transaction at index ${e}. ${t}`)}}));return this.signedTxns=s,this.txIDs=a,this.status=h.SIGNED,s}async submit(t){if(this.status>h.SUBMITTED)throw new Error("Transaction group cannot be resubmitted");const e=await this.gatherSignatures();return await t.sendRawTransaction(e).do(),this.status=h.SUBMITTED,this.txIDs}async execute(t,e){if(this.status===h.COMMITTED)throw new Error("Transaction group has already been executed successfully");const r=await this.submit(t);this.status=h.SUBMITTED;const n=this.transactions.findIndex(((t,e)=>this.methodCalls.has(e))),i=-1===n?0:n,o=await(0,a.K)(t,r[i],e);this.status=h.COMMITTED;const s=o["confirmed-round"],u=[];for(const[e,i]of this.methodCalls){const s=r[e],a={txID:s,rawReturnValue:new Uint8Array};try{const r=e===n?o:await t.pendingTransactionInformation(s).do();if(a.txInfo=r,"void"!==i.returns.type){const t=r.logs||[];if(0===t.length)throw new Error("App call transaction did not log a return value");const e=f.from(t[t.length-1],"base64");if(e.byteLength<4||!e.slice(0,4).equals(l))throw new Error("App call transaction did not log a return value");a.rawReturnValue=new Uint8Array(e.slice(4)),a.returnValue=i.returns.type.decode(a.rawReturnValue)}}catch(t){a.decodeError=t}u.push(a)}return{confirmedRound:s,txIDs:r,methodResults:u}}}p.MAX_GROUP_SIZE=16},9070:(t,e,r)=>{"use strict";r.d(e,{rD:()=>i,_:()=>o,HN:()=>s});const n=1e6,i="Microalgos should be positive and less than 2^53 - 1.";function o(t){if(t<0||!Number.isSafeInteger(t))throw new Error(i);return t/n}function s(t){const e=t*n;return Math.round(e)}},4383:(t,e,r)=>{"use strict";r.d(e,{P:()=>u});var n=r(227),i=r(1824),o=r(7116),s=r(2486).Buffer;function a(t){return t.params["approval-program"]=s.from(t.params["approval-program"].toString(),"base64"),t.params["clear-state-program"]=s.from(t.params["clear-state-program"].toString(),"base64"),t}async function u({client:t,txns:e,protocolVersion:r,latestTimestamp:s,round:u,sources:c}){const f=[],l=[],h=[],d=[],p=[];for(const t of e)t.txn.type===i.i.appl&&(p.push((0,o.encodeAddress)(t.txn.from.publicKey)),t.txn.appAccounts&&p.push(...t.txn.appAccounts.map((t=>(0,o.encodeAddress)(t.publicKey)))),t.txn.appForeignApps&&h.push(...t.txn.appForeignApps),t.txn.appForeignAssets&&d.push(...t.txn.appForeignAssets),void 0===t.txn.appIndex||0===t.txn.appIndex?f.push(new n.Application(1380011588,new n.ApplicationParams({creator:(0,o.encodeAddress)(t.txn.from.publicKey),approvalProgram:t.txn.appApprovalProgram,clearStateProgram:t.txn.appClearProgram,localStateSchema:new n.ApplicationStateSchema(t.txn.appLocalInts,t.txn.appLocalByteSlices),globalStateSchema:new n.ApplicationStateSchema(t.txn.appGlobalInts,t.txn.appGlobalByteSlices)}))):(h.push(t.txn.appIndex),p.push((0,o.getApplicationAddress)(t.txn.appIndex))));const m=[];for(const e of[...new Set(d)])m.push(t.getAssetByID(e).do().then((t=>{p.push(t.params.creator)})));await Promise.all(m);const g=[];for(const e of[...new Set(h)])g.push(t.getApplicationByID(e).do().then((t=>{const e=a(t);f.push(e),p.push(e.params.creator)})));await Promise.all(g);const b=[];for(const e of[...new Set(p)])b.push(t.accountInformation(e).do().then((t=>{"created-apps"in t&&(t["created-apps"]=t["created-apps"].map((t=>a(t)))),l.push(t)})));return await Promise.all(b),new n.DryrunRequest({txns:e.map((t=>({...t,txn:t.txn.get_obj_for_encoding()}))),accounts:l,apps:f,latestTimestamp:s,round:u,protocolVersion:r,sources:c})}},7116:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ALGORAND_ZERO_ADDRESS_STRING:()=>c,MALFORMED_ADDRESS_ERROR_MSG:()=>h,CHECKSUM_ADDRESS_ERROR_MSG:()=>d,INVALID_MSIG_VERSION_ERROR_MSG:()=>p,INVALID_MSIG_THRESHOLD_ERROR_MSG:()=>m,INVALID_MSIG_PK_ERROR_MSG:()=>g,UNEXPECTED_PK_LEN_ERROR_MSG:()=>b,decodeAddress:()=>y,isValidAddress:()=>v,encodeAddress:()=>w,fromMultisigPreImg:()=>_,fromMultisigPreImgAddrs:()=>A,getApplicationAddress:()=>E});var n=r(7267),i=r.n(n),o=r(9404),s=r(413),a=r(6963),u=r(2486).Buffer;const c="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",f=new Uint8Array([77,117,108,116,105,115,105,103,65,100,100,114]),l=u.from("appID"),h="address seems to be malformed",d="wrong checksum for address",p="invalid multisig version",m="bad multisig threshold",g="bad multisig public key - wrong length",b="nacl public key length is not 32 bytes";function y(t){if("string"!=typeof t||58!==t.length)throw new Error(h);const e=i().decode.asBytes(t.toString());if(36!==e.length)throw new Error(h);const r=new Uint8Array(e.slice(0,32)),n=new Uint8Array(e.slice(o.PUBLIC_KEY_LENGTH,36)),a=o.genericHash(r).slice(o.HASH_BYTES_LENGTH-4,o.HASH_BYTES_LENGTH);if(!s.arrayEqual(a,n))throw new Error(d);return{publicKey:r,checksum:n}}function v(t){try{y(t)}catch(t){return!1}return!0}function w(t){const e=o.genericHash(t).slice(o.PUBLIC_KEY_LENGTH-4,o.PUBLIC_KEY_LENGTH);return i().encode(s.concatArrays(t,e)).toString().slice(0,58)}function _({version:t,threshold:e,pks:r}){if(1!==t||t>255||t<0)throw new Error(p);if(0===e||0===r.length||e>r.length||e>255)throw new Error(m);if(32!==o.PUBLIC_KEY_LENGTH)throw new Error(b);const n=new Uint8Array(f.length+2+32*r.length);n.set(f,0),n.set([t],f.length),n.set([e],f.length+1);for(let t=0;t<r.length;t++){if(32!==r[t].length)throw new Error(g);n.set(r[t],f.length+2+32*t)}return new Uint8Array(o.genericHash(n))}function A({version:t,threshold:e,addrs:r}){return w(_({version:t,threshold:e,pks:r.map((t=>y(t).publicKey))}))}function E(t){const e=s.concatArrays(l,(0,a.T)(t)),r=o.genericHash(e);return w(new Uint8Array(r))}},8922:(t,e,r)=>{"use strict";r.d(e,{j:()=>i,v:()=>o});var n=r(2486).Buffer;function i(t,e){let r=t.toString(16);r.length!==2*e&&(r=r.padStart(2*e,"0"));const n=new Uint8Array(r.length/2);for(let t=0,e=0;t<r.length/2;t++,e+=2)n[t]=parseInt(r.slice(e,e+2),16);return n}function o(t){let e=BigInt(0);const r=n.from(t);for(let n=0;n<t.length;n++)e=BigInt(Number(r.readUIntBE(n,1)))+e*BigInt(256);return e}},3033:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ERROR_CONTAINS_EMPTY_STRING:()=>i,encode:()=>o,decode:()=>s});var n=r(5406);const i="The object contains empty or 0 values. First empty or 0 value encountered during encoding: ";function o(t){const e=function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&(!t[e]||0===t[e].length))return{containsEmpty:!0,firstEmptyKey:e};return{containsEmpty:!1,firstEmptyKey:void 0}}(t);if(e.containsEmpty)throw new Error(i+e.firstEmptyKey);return n.encode(t,{sortKeys:!0})}function s(t){return n.decode(t)}},6963:(t,e,r)=>{"use strict";r.d(e,{T:()=>i,u:()=>o});var n=r(2486).Buffer;function i(t){if("bigint"!=typeof t&&!Number.isInteger(t)||t<0||t>BigInt("0xffffffffffffffff"))throw new Error("Input is not a 64-bit unsigned integer");const e=n.allocUnsafe(8);return e.writeBigUInt64BE(BigInt(t)),new Uint8Array(e)}function o(t,e="safe"){if("safe"!==e&&"mixed"!==e&&"bigint"!==e)throw new Error(`Unknown decodingMode option: ${e}`);if(0===t.byteLength||t.byteLength>8)throw new Error(`Data has unacceptable length. Expected length is between 1 and 8, got ${t.byteLength}`);const r=n.allocUnsafe(8-t.byteLength);r.fill(0);const i=n.concat([r,n.from(t)]).readBigUInt64BE(),o=i>Number.MAX_SAFE_INTEGER;if("safe"===e){if(o)throw new Error(`Integer exceeds maximum safe integer: ${i.toString()}. Try decoding with "mixed" or "safe" decodingMode.`);return Number(i)}return"mixed"!==e||o?i:Number(i)}},1063:(t,e,r)=>{"use strict";r.r(e),r.d(e,{TxGroup:()=>c,computeGroupID:()=>f,assignGroupID:()=>l,default:()=>h});var n=r(9417),i=r(9404),o=r(3033),s=r(7116),a=r(413),u=r(2486).Buffer;class c{constructor(t){if(this.name="Transaction group",this.tag=u.from("TG"),t.length>16){const e=`${t.length.toString()} transactions grouped together but max group size is ${16..toString()}`;throw Error(e)}this.txGroupHashes=t}get_obj_for_encoding(){return{txlist:this.txGroupHashes}}static from_obj_for_encoding(t){const e=Object.create(this.prototype);e.name="Transaction group",e.tag=u.from("TG"),e.txGroupHashes=[];for(const r of t.txlist)e.txGroupHashes.push(u.from(r));return e}toByte(){return o.encode(this.get_obj_for_encoding())}}function f(t){const e=[];for(const r of t){const t=n.instantiateTxnIfNeeded(r);e.push(t.rawTxID())}const r=new c(e),o=r.toByte(),s=u.from(a.concatArrays(r.tag,o)),f=i.genericHash(s);return u.from(f)}function l(t,e){const r=f(t),i=[];for(const o of t){const t=n.instantiateTxnIfNeeded(o);e&&s.encodeAddress(t.from.publicKey)!==e||(t.group=r,i.push(t))}return i}const h=c},5583:(t,e,r)=>{"use strict";r.r(e),r.d(e,{checkByteConstBlock:()=>d,checkIntConstBlock:()=>h,checkProgram:()=>l,checkPushByteOp:()=>m,checkPushIntOp:()=>p,langspecEvalMaxVersion:()=>g,langspecLogicSigVersion:()=>b,parseUvarint:()=>o,readProgram:()=>f});const n=JSON.parse('{"z_":6,"BV":5,"AP":[{"Opcode":0,"Name":"err","Cost":1,"Size":1,"Doc":"Fail immediately.","Groups":["Flow Control"]},{"Opcode":1,"Name":"sha256","Args":"B","Returns":"B","Cost":35,"Size":1,"Doc":"SHA256 hash of value A, yields [32]byte","Groups":["Arithmetic"]},{"Opcode":2,"Name":"keccak256","Args":"B","Returns":"B","Cost":130,"Size":1,"Doc":"Keccak256 hash of value A, yields [32]byte","Groups":["Arithmetic"]},{"Opcode":3,"Name":"sha512_256","Args":"B","Returns":"B","Cost":45,"Size":1,"Doc":"SHA512_256 hash of value A, yields [32]byte","Groups":["Arithmetic"]},{"Opcode":4,"Name":"ed25519verify","Args":"BBB","Returns":"U","Cost":1900,"Size":1,"Doc":"for (data A, signature B, pubkey C) verify the signature of (\\"ProgData\\" || program_hash || data) against the pubkey => {0 or 1}","DocExtra":"The 32 byte public key is the last element on the stack, preceded by the 64 byte signature at the second-to-last element on the stack, preceded by the data which was signed at the third-to-last element on the stack.","Groups":["Arithmetic"]},{"Opcode":5,"Name":"ecdsa_verify","Args":"BBBBB","Returns":"U","Cost":1700,"Size":2,"Doc":"for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1}","DocExtra":"The 32 byte Y-component of a public key is the last element on the stack, preceded by X-component of a pubkey, preceded by S and R components of a signature, preceded by the data that is fifth element on the stack. All values are big-endian encoded. The signed data must be 32 bytes long, and signatures in lower-S form are only accepted.","ImmediateNote":"{uint8 curve index}","Groups":["Arithmetic"]},{"Opcode":6,"Name":"ecdsa_pk_decompress","Args":"B","Returns":"BB","Cost":650,"Size":2,"Doc":"decompress pubkey A into components X, Y","DocExtra":"The 33 byte public key in a compressed form to be decompressed into X and Y (top) components. All values are big-endian encoded.","ImmediateNote":"{uint8 curve index}","Groups":["Arithmetic"]},{"Opcode":7,"Name":"ecdsa_pk_recover","Args":"BUBB","Returns":"BB","Cost":2000,"Size":2,"Doc":"for (data A, recovery id B, signature C, D) recover a public key","DocExtra":"S (top) and R elements of a signature, recovery id and data (bottom) are expected on the stack and used to deriver a public key. All values are big-endian encoded. The signed data must be 32 bytes long.","ImmediateNote":"{uint8 curve index}","Groups":["Arithmetic"]},{"Opcode":8,"Name":"+","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A plus B. Fail on overflow.","DocExtra":"Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `addw`.","Groups":["Arithmetic"]},{"Opcode":9,"Name":"-","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A minus B. Fail if B > A.","Groups":["Arithmetic"]},{"Opcode":10,"Name":"/","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A divided by B (truncated division). Fail if B == 0.","DocExtra":"`divmodw` is available to divide the two-element values produced by `mulw` and `addw`.","Groups":["Arithmetic"]},{"Opcode":11,"Name":"*","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A times B. Fail on overflow.","DocExtra":"Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `mulw`.","Groups":["Arithmetic"]},{"Opcode":12,"Name":"<","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A less than B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":13,"Name":">","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A greater than B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":14,"Name":"<=","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A less than or equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":15,"Name":">=","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A greater than or equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":16,"Name":"&&","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A is not zero and B is not zero => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":17,"Name":"||","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A is not zero or B is not zero => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":18,"Name":"==","Args":"..","Returns":"U","Cost":1,"Size":1,"Doc":"A is equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":19,"Name":"!=","Args":"..","Returns":"U","Cost":1,"Size":1,"Doc":"A is not equal to B => {0 or 1}","Groups":["Arithmetic"]},{"Opcode":20,"Name":"!","Args":"U","Returns":"U","Cost":1,"Size":1,"Doc":"A == 0 yields 1; else 0","Groups":["Arithmetic"]},{"Opcode":21,"Name":"len","Args":"B","Returns":"U","Cost":1,"Size":1,"Doc":"yields length of byte value A","Groups":["Arithmetic"]},{"Opcode":22,"Name":"itob","Args":"U","Returns":"B","Cost":1,"Size":1,"Doc":"converts uint64 A to big endian bytes","Groups":["Arithmetic"]},{"Opcode":23,"Name":"btoi","Args":"B","Returns":"U","Cost":1,"Size":1,"Doc":"converts bytes A as big endian to uint64","DocExtra":"`btoi` fails if the input is longer than 8 bytes.","Groups":["Arithmetic"]},{"Opcode":24,"Name":"%","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A modulo B. Fail if B == 0.","Groups":["Arithmetic"]},{"Opcode":25,"Name":"|","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A bitwise-or B","Groups":["Arithmetic"]},{"Opcode":26,"Name":"&","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A bitwise-and B","Groups":["Arithmetic"]},{"Opcode":27,"Name":"^","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A bitwise-xor B","Groups":["Arithmetic"]},{"Opcode":28,"Name":"~","Args":"U","Returns":"U","Cost":1,"Size":1,"Doc":"bitwise invert value A","Groups":["Arithmetic"]},{"Opcode":29,"Name":"mulw","Args":"UU","Returns":"UU","Cost":1,"Size":1,"Doc":"A times B as a 128-bit result in two uint64s. X is the high 64 bits, Y is the low","Groups":["Arithmetic"]},{"Opcode":30,"Name":"addw","Args":"UU","Returns":"UU","Cost":1,"Size":1,"Doc":"A plus B as a 128-bit result. X is the carry-bit, Y is the low-order 64 bits.","Groups":["Arithmetic"]},{"Opcode":31,"Name":"divmodw","Args":"UUUU","Returns":"UUUU","Cost":20,"Size":1,"Doc":"W,X = (A,B / C,D); Y,Z = (A,B modulo C,D)","DocExtra":"The notation J,K indicates that two uint64 values J and K are interpreted as a uint128 value, with J as the high uint64 and K the low.","Groups":["Arithmetic"]},{"Opcode":32,"Name":"intcblock","Cost":1,"Size":0,"Doc":"prepare block of uint64 constants for use by intc","DocExtra":"`intcblock` loads following program bytes into an array of integer constants in the evaluator. These integer constants can be referred to by `intc` and `intc_*` which will push the value onto the stack. Subsequent calls to `intcblock` reset and replace the integer constants available to the script.","ImmediateNote":"{varuint length} [{varuint value}, ...]","Groups":["Loading Values"]},{"Opcode":33,"Name":"intc","Returns":"U","Cost":1,"Size":2,"Doc":"Ith constant from intcblock","ImmediateNote":"{uint8 int constant index}","Groups":["Loading Values"]},{"Opcode":34,"Name":"intc_0","Returns":"U","Cost":1,"Size":1,"Doc":"constant 0 from intcblock","Groups":["Loading Values"]},{"Opcode":35,"Name":"intc_1","Returns":"U","Cost":1,"Size":1,"Doc":"constant 1 from intcblock","Groups":["Loading Values"]},{"Opcode":36,"Name":"intc_2","Returns":"U","Cost":1,"Size":1,"Doc":"constant 2 from intcblock","Groups":["Loading Values"]},{"Opcode":37,"Name":"intc_3","Returns":"U","Cost":1,"Size":1,"Doc":"constant 3 from intcblock","Groups":["Loading Values"]},{"Opcode":38,"Name":"bytecblock","Cost":1,"Size":0,"Doc":"prepare block of byte-array constants for use by bytec","DocExtra":"`bytecblock` loads the following program bytes into an array of byte-array constants in the evaluator. These constants can be referred to by `bytec` and `bytec_*` which will push the value onto the stack. Subsequent calls to `bytecblock` reset and replace the bytes constants available to the script.","ImmediateNote":"{varuint length} [({varuint value length} bytes), ...]","Groups":["Loading Values"]},{"Opcode":39,"Name":"bytec","Returns":"B","Cost":1,"Size":2,"Doc":"Ith constant from bytecblock","ImmediateNote":"{uint8 byte constant index}","Groups":["Loading Values"]},{"Opcode":40,"Name":"bytec_0","Returns":"B","Cost":1,"Size":1,"Doc":"constant 0 from bytecblock","Groups":["Loading Values"]},{"Opcode":41,"Name":"bytec_1","Returns":"B","Cost":1,"Size":1,"Doc":"constant 1 from bytecblock","Groups":["Loading Values"]},{"Opcode":42,"Name":"bytec_2","Returns":"B","Cost":1,"Size":1,"Doc":"constant 2 from bytecblock","Groups":["Loading Values"]},{"Opcode":43,"Name":"bytec_3","Returns":"B","Cost":1,"Size":1,"Doc":"constant 3 from bytecblock","Groups":["Loading Values"]},{"Opcode":44,"Name":"arg","Returns":"B","Cost":1,"Size":2,"Doc":"Nth LogicSig argument","ImmediateNote":"{uint8 arg index N}","Groups":["Loading Values"]},{"Opcode":45,"Name":"arg_0","Returns":"B","Cost":1,"Size":1,"Doc":"LogicSig argument 0","Groups":["Loading Values"]},{"Opcode":46,"Name":"arg_1","Returns":"B","Cost":1,"Size":1,"Doc":"LogicSig argument 1","Groups":["Loading Values"]},{"Opcode":47,"Name":"arg_2","Returns":"B","Cost":1,"Size":1,"Doc":"LogicSig argument 2","Groups":["Loading Values"]},{"Opcode":48,"Name":"arg_3","Returns":"B","Cost":1,"Size":1,"Doc":"LogicSig argument 3","Groups":["Loading Values"]},{"Opcode":49,"Name":"txn","Returns":".","Cost":1,"Size":2,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID","LastLog","StateProofPK"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUUBB","Doc":"field F of current transaction","DocExtra":"FirstValidTime causes the program to fail. The field is reserved for future use.","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":50,"Name":"global","Returns":".","Cost":1,"Size":2,"Doc":"global field F","ImmediateNote":"{uint8 global field index}","Groups":["Loading Values"]},{"Opcode":51,"Name":"gtxn","Returns":".","Cost":1,"Size":3,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID","LastLog","StateProofPK"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUUBB","Doc":"field F of the Tth transaction in the current group","DocExtra":"for notes on transaction fields available, see `txn`. If this transaction is _i_ in the group, `gtxn i field` is equivalent to `txn field`.","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":52,"Name":"load","Returns":".","Cost":1,"Size":2,"Doc":"Ith scratch space value. All scratch spaces are 0 at program start.","ImmediateNote":"{uint8 position in scratch space to load from}","Groups":["Loading Values"]},{"Opcode":53,"Name":"store","Args":".","Cost":1,"Size":2,"Doc":"store A to the Ith scratch space","ImmediateNote":"{uint8 position in scratch space to store to}","Groups":["Loading Values"]},{"Opcode":54,"Name":"txna","Returns":".","Cost":1,"Size":3,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Ith value of the array field F of the current transaction","ImmediateNote":"{uint8 transaction field index} {uint8 transaction field array index}","Groups":["Loading Values"]},{"Opcode":55,"Name":"gtxna","Returns":".","Cost":1,"Size":4,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Ith value of the array field F from the Tth transaction in the current group","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index} {uint8 transaction field array index}","Groups":["Loading Values"]},{"Opcode":56,"Name":"gtxns","Args":"U","Returns":".","Cost":1,"Size":2,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID","LastLog","StateProofPK"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUUBB","Doc":"field F of the Ath transaction in the current group","DocExtra":"for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction.","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":57,"Name":"gtxnsa","Args":"U","Returns":".","Cost":1,"Size":3,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Ith value of the array field F from the Ath transaction in the current group","ImmediateNote":"{uint8 transaction field index} {uint8 transaction field array index}","Groups":["Loading Values"]},{"Opcode":58,"Name":"gload","Returns":".","Cost":1,"Size":3,"Doc":"Ith scratch space value of the Tth transaction in the current group","DocExtra":"`gload` fails unless the requested transaction is an ApplicationCall and T < GroupIndex.","ImmediateNote":"{uint8 transaction group index} {uint8 position in scratch space to load from}","Groups":["Loading Values"]},{"Opcode":59,"Name":"gloads","Args":"U","Returns":".","Cost":1,"Size":2,"Doc":"Ith scratch space value of the Ath transaction in the current group","DocExtra":"`gloads` fails unless the requested transaction is an ApplicationCall and A < GroupIndex.","ImmediateNote":"{uint8 position in scratch space to load from}","Groups":["Loading Values"]},{"Opcode":60,"Name":"gaid","Returns":"U","Cost":1,"Size":2,"Doc":"ID of the asset or application created in the Tth transaction of the current group","DocExtra":"`gaid` fails unless the requested transaction created an asset or application and T < GroupIndex.","ImmediateNote":"{uint8 transaction group index}","Groups":["Loading Values"]},{"Opcode":61,"Name":"gaids","Args":"U","Returns":"U","Cost":1,"Size":1,"Doc":"ID of the asset or application created in the Ath transaction of the current group","DocExtra":"`gaids` fails unless the requested transaction created an asset or application and A < GroupIndex.","Groups":["Loading Values"]},{"Opcode":62,"Name":"loads","Args":"U","Returns":".","Cost":1,"Size":1,"Doc":"Ath scratch space value.  All scratch spaces are 0 at program start.","Groups":["Loading Values"]},{"Opcode":63,"Name":"stores","Args":"U.","Cost":1,"Size":1,"Doc":"store B to the Ath scratch space","Groups":["Loading Values"]},{"Opcode":64,"Name":"bnz","Args":"U","Cost":1,"Size":3,"Doc":"branch to TARGET if value A is not zero","DocExtra":"The `bnz` instruction opcode 0x40 is followed by two immediate data bytes which are a high byte first and low byte second which together form a 16 bit offset which the instruction may branch to. For a bnz instruction at `pc`, if the last element of the stack is not zero then branch to instruction at `pc + 3 + N`, else proceed to next instruction at `pc + 3`. Branch targets must be aligned instructions. (e.g. Branching to the second byte of a 2 byte op will be rejected.) Starting at v4, the offset is treated as a signed 16 bit integer allowing for backward branches and looping. In prior version (v1 to v3), branch offsets are limited to forward branches only, 0-0x7fff.\\n\\nAt v2 it became allowed to branch to the end of the program exactly after the last instruction: bnz to byte N (with 0-indexing) was illegal for a TEAL program with N bytes before v2, and is legal after it. This change eliminates the need for a last instruction of no-op as a branch target at the end. (Branching beyond the end--in other words, to a byte larger than N--is still illegal and will cause the program to fail.)","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":65,"Name":"bz","Args":"U","Cost":1,"Size":3,"Doc":"branch to TARGET if value A is zero","DocExtra":"See `bnz` for details on how branches work. `bz` inverts the behavior of `bnz`.","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":66,"Name":"b","Cost":1,"Size":3,"Doc":"branch unconditionally to TARGET","DocExtra":"See `bnz` for details on how branches work. `b` always jumps to the offset.","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":67,"Name":"return","Args":"U","Cost":1,"Size":1,"Doc":"use A as success value; end","Groups":["Flow Control"]},{"Opcode":68,"Name":"assert","Args":"U","Cost":1,"Size":1,"Doc":"immediately fail unless A is a non-zero number","Groups":["Flow Control"]},{"Opcode":72,"Name":"pop","Args":".","Cost":1,"Size":1,"Doc":"discard A","Groups":["Flow Control"]},{"Opcode":73,"Name":"dup","Args":".","Returns":"..","Cost":1,"Size":1,"Doc":"duplicate A","Groups":["Flow Control"]},{"Opcode":74,"Name":"dup2","Args":"..","Returns":"....","Cost":1,"Size":1,"Doc":"duplicate A and B","Groups":["Flow Control"]},{"Opcode":75,"Name":"dig","Args":".","Returns":"..","Cost":1,"Size":2,"Doc":"Nth value from the top of the stack. dig 0 is equivalent to dup","ImmediateNote":"{uint8 depth}","Groups":["Flow Control"]},{"Opcode":76,"Name":"swap","Args":"..","Returns":"..","Cost":1,"Size":1,"Doc":"swaps A and B on stack","Groups":["Flow Control"]},{"Opcode":77,"Name":"select","Args":"..U","Returns":".","Cost":1,"Size":1,"Doc":"selects one of two values based on top-of-stack: B if C != 0, else A","Groups":["Flow Control"]},{"Opcode":78,"Name":"cover","Args":".","Returns":".","Cost":1,"Size":2,"Doc":"remove top of stack, and place it deeper in the stack such that N elements are above it. Fails if stack depth <= N.","ImmediateNote":"{uint8 depth}","Groups":["Flow Control"]},{"Opcode":79,"Name":"uncover","Args":".","Returns":".","Cost":1,"Size":2,"Doc":"remove the value at depth N in the stack and shift above items down so the Nth deep value is on top of the stack. Fails if stack depth <= N.","ImmediateNote":"{uint8 depth}","Groups":["Flow Control"]},{"Opcode":80,"Name":"concat","Args":"BB","Returns":"B","Cost":1,"Size":1,"Doc":"join A and B","DocExtra":"`concat` fails if the result would be greater than 4096 bytes.","Groups":["Arithmetic"]},{"Opcode":81,"Name":"substring","Args":"B","Returns":"B","Cost":1,"Size":3,"Doc":"A range of bytes from A starting at S up to but not including E. If E < S, or either is larger than the array length, the program fails","ImmediateNote":"{uint8 start position} {uint8 end position}","Groups":["Byte Array Manipulation"]},{"Opcode":82,"Name":"substring3","Args":"BUU","Returns":"B","Cost":1,"Size":1,"Doc":"A range of bytes from A starting at B up to but not including C. If C < B, or either is larger than the array length, the program fails","Groups":["Byte Array Manipulation"]},{"Opcode":83,"Name":"getbit","Args":".U","Returns":"U","Cost":1,"Size":1,"Doc":"Bth bit of (byte-array or integer) A.","DocExtra":"see explanation of bit ordering in setbit","Groups":["Arithmetic"]},{"Opcode":84,"Name":"setbit","Args":".UU","Returns":".","Cost":1,"Size":1,"Doc":"Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C","DocExtra":"When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10.","Groups":["Arithmetic"]},{"Opcode":85,"Name":"getbyte","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"Bth byte of A, as an integer","Groups":["Arithmetic"]},{"Opcode":86,"Name":"setbyte","Args":"BUU","Returns":"B","Cost":1,"Size":1,"Doc":"Copy of A with the Bth byte set to small integer (between 0..255) C","Groups":["Arithmetic"]},{"Opcode":87,"Name":"extract","Args":"B","Returns":"B","Cost":1,"Size":3,"Doc":"A range of bytes from A starting at S up to but not including S+L. If L is 0, then extract to the end of the string. If S or S+L is larger than the array length, the program fails","ImmediateNote":"{uint8 start position} {uint8 length}","Groups":["Byte Array Manipulation"]},{"Opcode":88,"Name":"extract3","Args":"BUU","Returns":"B","Cost":1,"Size":1,"Doc":"A range of bytes from A starting at B up to but not including B+C. If B+C is larger than the array length, the program fails","Groups":["Byte Array Manipulation"]},{"Opcode":89,"Name":"extract_uint16","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"A uint16 formed from a range of big-endian bytes from A starting at B up to but not including B+2. If B+2 is larger than the array length, the program fails","Groups":["Byte Array Manipulation"]},{"Opcode":90,"Name":"extract_uint32","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"A uint32 formed from a range of big-endian bytes from A starting at B up to but not including B+4. If B+4 is larger than the array length, the program fails","Groups":["Byte Array Manipulation"]},{"Opcode":91,"Name":"extract_uint64","Args":"BU","Returns":"U","Cost":1,"Size":1,"Doc":"A uint64 formed from a range of big-endian bytes from A starting at B up to but not including B+8. If B+8 is larger than the array length, the program fails","Groups":["Byte Array Manipulation"]},{"Opcode":96,"Name":"balance","Args":".","Returns":"U","Cost":1,"Size":1,"Doc":"get balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted.","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ account address), _available_ application id (or, since v4, a Txn.ForeignApps offset). Return: value.","Groups":["State Access"]},{"Opcode":97,"Name":"app_opted_in","Args":".U","Returns":"U","Cost":1,"Size":1,"Doc":"1 if account A is opted in to application B, else 0","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ account address), _available_ application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise.","Groups":["State Access"]},{"Opcode":98,"Name":"app_local_get","Args":".B","Returns":".","Cost":1,"Size":1,"Doc":"local state of the key B in the current application in account A","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ account address), state key. Return: value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":99,"Name":"app_local_get_ex","Args":".UB","Returns":".U","Cost":1,"Size":1,"Doc":"X is the local state of application B, key C in account A. Y is 1 if key existed, else 0","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ account address), _available_ application id (or, since v4, a Txn.ForeignApps offset), state key. Return: did_exist flag (top of the stack, 1 if the application and key existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":100,"Name":"app_global_get","Args":"B","Returns":".","Cost":1,"Size":1,"Doc":"global state of the key A in the current application","DocExtra":"params: state key. Return: value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":101,"Name":"app_global_get_ex","Args":"UB","Returns":".U","Cost":1,"Size":1,"Doc":"X is the global state of application A, key B. Y is 1 if key existed, else 0","DocExtra":"params: Txn.ForeignApps offset (or, since v4, an _available_ application id), state key. Return: did_exist flag (top of the stack, 1 if the application and key existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.","Groups":["State Access"]},{"Opcode":102,"Name":"app_local_put","Args":".B.","Cost":1,"Size":1,"Doc":"write C to key B in account A\'s local state of the current application","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ account address), state key, value.","Groups":["State Access"]},{"Opcode":103,"Name":"app_global_put","Args":"B.","Cost":1,"Size":1,"Doc":"write B to key A in the global state of the current application","Groups":["State Access"]},{"Opcode":104,"Name":"app_local_del","Args":".B","Cost":1,"Size":1,"Doc":"delete key B from account A\'s local state of the current application","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ account address), state key.\\n\\nDeleting a key which is already absent has no effect on the application local state. (In particular, it does _not_ cause the program to fail.)","Groups":["State Access"]},{"Opcode":105,"Name":"app_global_del","Args":"B","Cost":1,"Size":1,"Doc":"delete key A from the global state of the current application","DocExtra":"params: state key.\\n\\nDeleting a key which is already absent has no effect on the application global state. (In particular, it does _not_ cause the program to fail.)","Groups":["State Access"]},{"Opcode":112,"Name":"asset_holding_get","Args":".U","Returns":".U","Cost":1,"Size":2,"ArgEnum":["AssetBalance","AssetFrozen"],"ArgEnumTypes":"UU","Doc":"X is field F from account A\'s holding of asset B. Y is 1 if A is opted into B, else 0","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ address), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if the asset existed and 0 otherwise), value.","ImmediateNote":"{uint8 asset holding field index}","Groups":["State Access"]},{"Opcode":113,"Name":"asset_params_get","Args":"U","Returns":".U","Cost":1,"Size":2,"ArgEnum":["AssetTotal","AssetDecimals","AssetDefaultFrozen","AssetUnitName","AssetName","AssetURL","AssetMetadataHash","AssetManager","AssetReserve","AssetFreeze","AssetClawback","AssetCreator"],"ArgEnumTypes":"UUUBBBBBBBBB","Doc":"X is field F from asset A. Y is 1 if A exists, else 0","DocExtra":"params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value.","ImmediateNote":"{uint8 asset params field index}","Groups":["State Access"]},{"Opcode":114,"Name":"app_params_get","Args":"U","Returns":".U","Cost":1,"Size":2,"ArgEnum":["AppApprovalProgram","AppClearStateProgram","AppGlobalNumUint","AppGlobalNumByteSlice","AppLocalNumUint","AppLocalNumByteSlice","AppExtraProgramPages","AppCreator","AppAddress"],"ArgEnumTypes":"BBUUUUUBB","Doc":"X is field F from app A. Y is 1 if A exists, else 0","DocExtra":"params: Txn.ForeignApps offset or an _available_ app id. Return: did_exist flag (1 if the application existed and 0 otherwise), value.","ImmediateNote":"{uint8 app params field index}","Groups":["State Access"]},{"Opcode":115,"Name":"acct_params_get","Args":".","Returns":".U","Cost":1,"Size":2,"Doc":"X is field F from account A. Y is 1 if A owns positive algos, else 0","ImmediateNote":"{uint8 account params field index}","Groups":["State Access"]},{"Opcode":120,"Name":"min_balance","Args":".","Returns":"U","Cost":1,"Size":1,"Doc":"get minimum required balance for account A, in microalgos. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes.","DocExtra":"params: Txn.Accounts offset (or, since v4, an _available_ account address), _available_ application id (or, since v4, a Txn.ForeignApps offset). Return: value.","Groups":["State Access"]},{"Opcode":128,"Name":"pushbytes","Returns":"B","Cost":1,"Size":0,"Doc":"immediate BYTES","DocExtra":"pushbytes args are not added to the bytecblock during assembly processes","ImmediateNote":"{varuint length} {bytes}","Groups":["Loading Values"]},{"Opcode":129,"Name":"pushint","Returns":"U","Cost":1,"Size":0,"Doc":"immediate UINT","DocExtra":"pushint args are not added to the intcblock during assembly processes","ImmediateNote":"{varuint int}","Groups":["Loading Values"]},{"Opcode":136,"Name":"callsub","Cost":1,"Size":3,"Doc":"branch unconditionally to TARGET, saving the next instruction on the call stack","DocExtra":"The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.","ImmediateNote":"{int16 branch offset, big endian}","Groups":["Flow Control"]},{"Opcode":137,"Name":"retsub","Cost":1,"Size":1,"Doc":"pop the top instruction from the call stack and branch to it","DocExtra":"The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.","Groups":["Flow Control"]},{"Opcode":144,"Name":"shl","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A times 2^B, modulo 2^64","Groups":["Arithmetic"]},{"Opcode":145,"Name":"shr","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A divided by 2^B","Groups":["Arithmetic"]},{"Opcode":146,"Name":"sqrt","Args":"U","Returns":"U","Cost":4,"Size":1,"Doc":"The largest integer I such that I^2 <= A","Groups":["Arithmetic"]},{"Opcode":147,"Name":"bitlen","Args":".","Returns":"U","Cost":1,"Size":1,"Doc":"The highest set bit in A. If A is a byte-array, it is interpreted as a big-endian unsigned integer. bitlen of 0 is 0, bitlen of 8 is 4","DocExtra":"bitlen interprets arrays as big-endian integers, unlike setbit/getbit","Groups":["Arithmetic"]},{"Opcode":148,"Name":"exp","Args":"UU","Returns":"U","Cost":1,"Size":1,"Doc":"A raised to the Bth power. Fail if A == B == 0 and on overflow","Groups":["Arithmetic"]},{"Opcode":149,"Name":"expw","Args":"UU","Returns":"UU","Cost":10,"Size":1,"Doc":"A raised to the Bth power as a 128-bit result in two uint64s. X is the high 64 bits, Y is the low. Fail if A == B == 0 or if the results exceeds 2^128-1","Groups":["Arithmetic"]},{"Opcode":150,"Name":"bsqrt","Args":"B","Returns":"B","Cost":40,"Size":1,"Doc":"The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":151,"Name":"divw","Args":"UUU","Returns":"U","Cost":1,"Size":1,"Doc":"A,B / C. Fail if C == 0 or if result overflows.","DocExtra":"The notation A,B indicates that A and B are interpreted as a uint128 value, with A as the high uint64 and B the low.","Groups":["Arithmetic"]},{"Opcode":160,"Name":"b+","Args":"BB","Returns":"B","Cost":10,"Size":1,"Doc":"A plus B. A and B are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":161,"Name":"b-","Args":"BB","Returns":"B","Cost":10,"Size":1,"Doc":"A minus B. A and B are interpreted as big-endian unsigned integers. Fail on underflow.","Groups":["Byte Array Arithmetic"]},{"Opcode":162,"Name":"b/","Args":"BB","Returns":"B","Cost":20,"Size":1,"Doc":"A divided by B (truncated division). A and B are interpreted as big-endian unsigned integers. Fail if B is zero.","Groups":["Byte Array Arithmetic"]},{"Opcode":163,"Name":"b*","Args":"BB","Returns":"B","Cost":20,"Size":1,"Doc":"A times B. A and B are interpreted as big-endian unsigned integers.","Groups":["Byte Array Arithmetic"]},{"Opcode":164,"Name":"b<","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"1 if A is less than B, else 0. A and B are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":165,"Name":"b>","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"1 if A is greater than B, else 0. A and B are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":166,"Name":"b<=","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"1 if A is less than or equal to B, else 0. A and B are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":167,"Name":"b>=","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"1 if A is greater than or equal to B, else 0. A and B are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":168,"Name":"b==","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"1 if A is equal to B, else 0. A and B are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":169,"Name":"b!=","Args":"BB","Returns":"U","Cost":1,"Size":1,"Doc":"0 if A is equal to B, else 1. A and B are interpreted as big-endian unsigned integers","Groups":["Byte Array Arithmetic"]},{"Opcode":170,"Name":"b%","Args":"BB","Returns":"B","Cost":20,"Size":1,"Doc":"A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero.","Groups":["Byte Array Arithmetic"]},{"Opcode":171,"Name":"b|","Args":"BB","Returns":"B","Cost":6,"Size":1,"Doc":"A bitwise-or B. A and B are zero-left extended to the greater of their lengths","Groups":["Byte Array Logic"]},{"Opcode":172,"Name":"b&","Args":"BB","Returns":"B","Cost":6,"Size":1,"Doc":"A bitwise-and B. A and B are zero-left extended to the greater of their lengths","Groups":["Byte Array Logic"]},{"Opcode":173,"Name":"b^","Args":"BB","Returns":"B","Cost":6,"Size":1,"Doc":"A bitwise-xor B. A and B are zero-left extended to the greater of their lengths","Groups":["Byte Array Logic"]},{"Opcode":174,"Name":"b~","Args":"B","Returns":"B","Cost":4,"Size":1,"Doc":"A with all bits inverted","Groups":["Byte Array Logic"]},{"Opcode":175,"Name":"bzero","Args":"U","Returns":"B","Cost":1,"Size":1,"Doc":"zero filled byte-array of length A","Groups":["Loading Values"]},{"Opcode":176,"Name":"log","Args":"B","Cost":1,"Size":1,"Doc":"write A to log state of the current application","DocExtra":"`log` fails if called more than MaxLogCalls times in a program, or if the sum of logged bytes exceeds 1024 bytes.","Groups":["State Access"]},{"Opcode":177,"Name":"itxn_begin","Cost":1,"Size":1,"Doc":"begin preparation of a new inner transaction in a new transaction group","DocExtra":"`itxn_begin` initializes Sender to the application address; Fee to the minimum allowable, taking into account MinTxnFee and credit from overpaying in earlier transactions; FirstValid/LastValid to the values in the invoking transaction, and all other fields to zero or empty values.","Groups":["Inner Transactions"]},{"Opcode":178,"Name":"itxn_field","Args":".","Cost":1,"Size":2,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID","LastLog","StateProofPK"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUUBB","Doc":"set field F of the current inner transaction to A","DocExtra":"`itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.)","ImmediateNote":"{uint8 transaction field index}","Groups":["Inner Transactions"]},{"Opcode":179,"Name":"itxn_submit","Cost":1,"Size":1,"Doc":"execute the current inner transaction group. Fail if executing this group would exceed the inner transaction limit, or if any transaction in the group fails.","DocExtra":"`itxn_submit` resets the current transaction so that it can not be resubmitted. A new `itxn_begin` is required to prepare another inner transaction.","Groups":["Inner Transactions"]},{"Opcode":180,"Name":"itxn","Returns":".","Cost":1,"Size":2,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID","LastLog","StateProofPK"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUUBB","Doc":"field F of the last inner transaction","ImmediateNote":"{uint8 transaction field index}","Groups":["Inner Transactions"]},{"Opcode":181,"Name":"itxna","Returns":".","Cost":1,"Size":3,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Ith value of the array field F of the last inner transaction","ImmediateNote":"{uint8 transaction field index} {uint8 transaction field array index}","Groups":["Inner Transactions"]},{"Opcode":182,"Name":"itxn_next","Cost":1,"Size":1,"Doc":"begin preparation of a new inner transaction in the same transaction group","DocExtra":"`itxn_next` initializes the transaction exactly as `itxn_begin` does","Groups":["Inner Transactions"]},{"Opcode":183,"Name":"gitxn","Returns":".","Cost":1,"Size":3,"ArgEnum":["Sender","Fee","FirstValid","FirstValidTime","LastValid","Note","Lease","Receiver","Amount","CloseRemainderTo","VotePK","SelectionPK","VoteFirst","VoteLast","VoteKeyDilution","Type","TypeEnum","XferAsset","AssetAmount","AssetSender","AssetReceiver","AssetCloseTo","GroupIndex","TxID","ApplicationID","OnCompletion","ApplicationArgs","NumAppArgs","Accounts","NumAccounts","ApprovalProgram","ClearStateProgram","RekeyTo","ConfigAsset","ConfigAssetTotal","ConfigAssetDecimals","ConfigAssetDefaultFrozen","ConfigAssetUnitName","ConfigAssetName","ConfigAssetURL","ConfigAssetMetadataHash","ConfigAssetManager","ConfigAssetReserve","ConfigAssetFreeze","ConfigAssetClawback","FreezeAsset","FreezeAssetAccount","FreezeAssetFrozen","Assets","NumAssets","Applications","NumApplications","GlobalNumUint","GlobalNumByteSlice","LocalNumUint","LocalNumByteSlice","ExtraProgramPages","Nonparticipation","Logs","NumLogs","CreatedAssetID","CreatedApplicationID","LastLog","StateProofPK"],"ArgEnumTypes":"BUUUUBBBUBBBUUUBUUUBBBUBUUBUBUBBBUUUUBBBBBBBBUBUUUUUUUUUUUBUUUBB","Doc":"field F of the Tth transaction in the last inner group submitted","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index}","Groups":["Inner Transactions"]},{"Opcode":184,"Name":"gitxna","Returns":".","Cost":1,"Size":4,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Ith value of the array field F from the Tth transaction in the last inner group submitted","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index} {uint8 transaction field array index}","Groups":["Inner Transactions"]},{"Opcode":192,"Name":"txnas","Args":"U","Returns":".","Cost":1,"Size":2,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Ath value of the array field F of the current transaction","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":193,"Name":"gtxnas","Args":"U","Returns":".","Cost":1,"Size":3,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Ath value of the array field F from the Tth transaction in the current group","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":194,"Name":"gtxnsas","Args":"UU","Returns":".","Cost":1,"Size":2,"ArgEnum":["ApplicationArgs","Accounts","Assets","Applications","Logs"],"ArgEnumTypes":"BBUUB","Doc":"Bth value of the array field F from the Ath transaction in the current group","ImmediateNote":"{uint8 transaction field index}","Groups":["Loading Values"]},{"Opcode":195,"Name":"args","Args":"U","Returns":"B","Cost":1,"Size":1,"Doc":"Ath LogicSig argument","Groups":["Loading Values"]},{"Opcode":196,"Name":"gloadss","Args":"UU","Returns":".","Cost":1,"Size":1,"Doc":"Bth scratch space value of the Ath transaction in the current group","Groups":["Loading Values"]},{"Opcode":197,"Name":"itxnas","Args":"U","Returns":".","Cost":1,"Size":2,"Doc":"Ath value of the array field F of the last inner transaction","ImmediateNote":"{uint8 transaction field index}","Groups":["Inner Transactions"]},{"Opcode":198,"Name":"gitxnas","Args":"U","Returns":".","Cost":1,"Size":3,"Doc":"Ath value of the array field F from the Tth transaction in the last inner group submitted","ImmediateNote":"{uint8 transaction group index} {uint8 transaction field index}","Groups":["Inner Transactions"]}]}');let i;function o(t){let e=0,r=0;for(let n=0;n<t.length;n++){const i=t[n];if(i<128)return n>9||9===n&&i>1?[0,-(n+1)]:[e|i<<r,n+1];e+=(127&i)<<r,r+=7}return[0,0]}function s(t,e){let r=1;const n=o(t.slice(e+r)),i=n[0];let s=n[1];if(s<=0)throw new Error(`could not decode int const block size at pc=${e+r}`);const a=[];r+=s;for(let n=0;n<i;n++){if(e+r>=t.length)throw new Error("intcblock ran past end of program");let i;if([i,s]=o(t.slice(e+r)),s<=0)throw new Error(`could not decode int const[${n}] block size at pc=${e+r}`);a.push(i),r+=s}return[r,a]}function a(t,e){let r=1;const n=o(t.slice(e+r)),i=n[0];let s=n[1];if(s<=0)throw new Error(`could not decode []byte const block size at pc=${e+r}`);const a=[];r+=s;for(let n=0;n<i;n++){if(e+r>=t.length)throw new Error("bytecblock ran past end of program");let i;if([i,s]=o(t.slice(e+r)),s<=0)throw new Error(`could not decode []byte] const[${n}] block size at pc=${e+r}`);if(r+=s,e+r+i>t.length)throw new Error("bytecblock ran past end of program");const u=t.slice(e+r,e+r+i);a.push(u),r+=i}return[r,a]}function u(t,e){let r=1;const[n,i]=o(t.slice(e+r));if(i<=0)throw new Error(`could not decode push int const at pc=${e+r}`);return r+=i,[r,n]}function c(t,e){let r=1;const[n,i]=o(t.slice(e+r));if(i<=0)throw new Error(`could not decode push []byte const size at pc=${e+r}`);if(r+=i,e+r+n>t.length)throw new Error("pushbytes ran past end of program");const s=t.slice(e+r,e+r+n);return r+=n,[r,s]}function f(t,e){if(!t)throw new Error("empty program");if(void 0===e&&(e=[]),!Array.isArray(e))throw new Error("invalid arguments");const[r,f]=o(t);if(f<=0)throw new Error("version parsing error");if(r>n.z_)throw new Error("unsupported version");let l=0,{length:h}=t;for(const t of e)h+=t.length;if(h>1e3)throw new Error("program too long");if(!i){i={};for(const t of n.AP)i[t.Opcode]=t}let d=f,p=[],m=[];for(;d<t.length;){const e=i[t[d]];if(void 0===e)throw new Error("invalid instruction");l+=e.Cost;let r=e.Size;if(0===r)switch(e.Opcode){case 32:{let e;[r,e]=s(t,d),p=p.concat(e);break}case 38:{let e;[r,e]=a(t,d),m=m.concat(e);break}case 129:{let e;[r,e]=u(t,d),p.push(e);break}case 128:{let e;[r,e]=c(t,d),m.push(e);break}default:throw new Error("invalid instruction")}d+=r}if(r<4&&l>2e4)throw new Error("program too costly for Teal version < 4. consider using v4.");return[p,m,!0]}function l(t,e){const[,,r]=f(t,e);return r}function h(t,e){const[r]=s(t,e);return r}function d(t,e){const[r]=a(t,e);return r}function p(t,e){const[r]=u(t,e);return r}function m(t,e){const[r]=c(t,e);return r}const g=n.z_,b=n.BV},8800:(t,e,r)=>{"use strict";r.r(e),r.d(e,{LogicSig:()=>l,LogicSigAccount:()=>h,makeLogicSig:()=>d,signLogicSigTransactionObject:()=>p,signLogicSigTransaction:()=>m,logicSigFromByte:()=>g,tealSign:()=>y,tealSignFromProgram:()=>v});var n=r(9404),i=r(7116),o=r(3033),s=r(5583),a=r(4158),u=r(413),c=r(9417),f=r(2486).Buffer;class l{constructor(t,e){if(this.tag=f.from("Program"),e&&(!Array.isArray(e)||!e.every((t=>t.constructor===Uint8Array||f.isBuffer(t)))))throw new TypeError("Invalid arguments");let r;if(null!=e&&(r=e.map((t=>new Uint8Array(t)))),!s.checkProgram(t,r))throw new Error("Invalid program");this.logic=t,this.args=r,this.sig=void 0,this.msig=void 0}get_obj_for_encoding(){const t={l:this.logic};return this.args&&(t.arg=this.args),this.sig?t.sig=this.sig:this.msig&&(t.msig=this.msig),t}static from_obj_for_encoding(t){const e=new l(t.l,t.arg);return e.sig=t.sig,e.msig=t.msig,e}verify(t){if(this.sig&&this.msig)return!1;try{s.checkProgram(this.logic,this.args)}catch(t){return!1}const e=u.concatArrays(this.tag,this.logic);if(!this.sig&&!this.msig){const r=n.genericHash(e);return u.arrayEqual(r,t)}return this.sig?n.verify(e,this.sig,t):(0,a.F2)(e,this.msig,t)}address(){const t=u.concatArrays(this.tag,this.logic),e=n.genericHash(t);return i.encodeAddress(new Uint8Array(e))}sign(t,e){if(null==e)this.sig=this.signProgram(t);else{const r=e.addrs.map((t=>({pk:i.decodeAddress(t).publicKey})));this.msig={v:e.version,thr:e.threshold,subsig:r};const[n,o]=this.singleSignMultisig(t,this.msig);this.msig.subsig[o].s=n}}appendToMultisig(t){if(void 0===this.msig)throw new Error("no multisig present");const[e,r]=this.singleSignMultisig(t,this.msig);this.msig.subsig[r].s=e}signProgram(t){const e=u.concatArrays(this.tag,this.logic);return n.sign(e,t)}singleSignMultisig(t,e){let r=-1;const i=n.keyPairFromSecretKey(t).publicKey;for(let t=0;t<e.subsig.length;t++){const{pk:n}=e.subsig[t];if(u.arrayEqual(n,i)){r=t;break}}if(-1===r)throw new Error("invalid secret key");return[this.signProgram(t),r]}toByte(){return o.encode(this.get_obj_for_encoding())}static fromByte(t){const e=o.decode(t);return l.from_obj_for_encoding(e)}}class h{constructor(t,e){this.lsig=new l(t,e),this.sigkey=void 0}get_obj_for_encoding(){const t={lsig:this.lsig.get_obj_for_encoding()};return this.sigkey&&(t.sigkey=this.sigkey),t}static from_obj_for_encoding(t){const e=new h(t.lsig.l,t.lsig.arg);return e.lsig=l.from_obj_for_encoding(t.lsig),e.sigkey=t.sigkey,e}toByte(){return o.encode(this.get_obj_for_encoding())}static fromByte(t){const e=o.decode(t);return h.from_obj_for_encoding(e)}isDelegated(){return!(!this.lsig.sig&&!this.lsig.msig)}verify(){const t=this.address();return this.lsig.verify(i.decodeAddress(t).publicKey)}address(){if(this.lsig.sig&&this.lsig.msig)throw new Error("LogicSig has too many signatures. At most one of sig or msig may be present");if(this.lsig.sig){if(!this.sigkey)throw new Error("Signing key for delegated account is missing");return i.encodeAddress(this.sigkey)}if(this.lsig.msig){const t={version:this.lsig.msig.v,threshold:this.lsig.msig.thr,pks:this.lsig.msig.subsig.map((t=>t.pk))};return i.encodeAddress(i.fromMultisigPreImg(t))}return this.lsig.address()}signMultisig(t,e){this.lsig.sign(e,t)}appendToMultisig(t){this.lsig.appendToMultisig(t)}sign(t){this.lsig.sign(t),this.sigkey=n.keyPairFromSecretKey(t).publicKey}}function d(t,e){return new l(t,e)}function p(t,e){let r,s;if(e instanceof h)r=e.lsig,s=i.decodeAddress(e.address()).publicKey;else if(r=e,r.sig)s=t.from.publicKey;else if(r.msig){const t={version:r.msig.v,threshold:r.msig.thr,pks:r.msig.subsig.map((t=>t.pk))};s=i.fromMultisigPreImg(t)}else s=i.decodeAddress(r.address()).publicKey;return function(t,e,r){if(!e.verify(r))throw new Error("Logic signature verification failed. Ensure the program and signature are valid.");const i={lsig:e.get_obj_for_encoding(),txn:t.get_obj_for_encoding()};return n.bytesEqual(r,t.from.publicKey)||(i.sgnr=f.from(r)),{txID:t.txID().toString(),blob:o.encode(i)}}(t,r,s)}function m(t,e){return p(c.instantiateTxnIfNeeded(t),e)}function g(t){return l.fromByte(t)}const b=f.from("ProgData");function y(t,e,r){const o=u.concatArrays(i.decodeAddress(r).publicKey,e),s=f.from(u.concatArrays(b,o));return n.sign(s,t)}function v(t,e,r){return y(t,e,new l(r).address())}},6608:(t,e,r)=>{"use strict";r.r(e),r.d(e,{MULTISIG_BAD_SENDER_ERROR_MSG:()=>P,signTransaction:()=>D,signBid:()=>L,signBytes:()=>U,verifyBytes:()=>j,encodeObj:()=>F,decodeObj:()=>q,ERROR_MULTISIG_BAD_SENDER:()=>z,ERROR_INVALID_MICROALGOS:()=>H,Algodv2:()=>p.Z,Kmd:()=>m.Z,IntDecoding:()=>g.Z,Indexer:()=>b.Z,waitForConfirmation:()=>y.K,isValidAddress:()=>i.isValidAddress,encodeAddress:()=>i.encodeAddress,decodeAddress:()=>i.decodeAddress,getApplicationAddress:()=>i.getApplicationAddress,bytesToBigInt:()=>v.v,bigIntToBytes:()=>v.j,encodeUint64:()=>w.T,decodeUint64:()=>w.u,generateAccount:()=>_.Z,modelsv2:()=>A,mnemonicToMasterDerivationKey:()=>E.OF,masterDerivationKeyToMnemonic:()=>E.vC,secretKeyToMnemonic:()=>E.QX,mnemonicToSecretKey:()=>E.Ch,seedFromMnemonic:()=>E.mE,mnemonicFromSeed:()=>E.w3,microalgosToAlgos:()=>f._,algosToMicroalgos:()=>f.HN,INVALID_MICROALGOS_ERROR_MSG:()=>f.rD,computeGroupID:()=>S.computeGroupID,assignGroupID:()=>S.assignGroupID,LogicSigAccount:()=>M.LogicSigAccount,makeLogicSig:()=>M.makeLogicSig,signLogicSigTransaction:()=>M.signLogicSigTransaction,signLogicSigTransactionObject:()=>M.signLogicSigTransactionObject,logicSigFromByte:()=>M.logicSigFromByte,tealSign:()=>M.tealSign,tealSignFromProgram:()=>M.tealSignFromProgram,signMultisigTransaction:()=>x.PU,mergeMultisigTransactions:()=>x.J6,appendSignMultisigTransaction:()=>x.PO,multisigAddress:()=>x.vH,LogicTemplates:()=>K,createDryrun:()=>k.P,OnApplicationComplete:()=>T.OnApplicationComplete,makeApplicationCallTxnFromObject:()=>T.makeApplicationCallTxnFromObject,makeApplicationClearStateTxn:()=>T.makeApplicationClearStateTxn,makeApplicationClearStateTxnFromObject:()=>T.makeApplicationClearStateTxnFromObject,makeApplicationCloseOutTxn:()=>T.makeApplicationCloseOutTxn,makeApplicationCloseOutTxnFromObject:()=>T.makeApplicationCloseOutTxnFromObject,makeApplicationCreateTxn:()=>T.makeApplicationCreateTxn,makeApplicationCreateTxnFromObject:()=>T.makeApplicationCreateTxnFromObject,makeApplicationDeleteTxn:()=>T.makeApplicationDeleteTxn,makeApplicationDeleteTxnFromObject:()=>T.makeApplicationDeleteTxnFromObject,makeApplicationNoOpTxn:()=>T.makeApplicationNoOpTxn,makeApplicationNoOpTxnFromObject:()=>T.makeApplicationNoOpTxnFromObject,makeApplicationOptInTxn:()=>T.makeApplicationOptInTxn,makeApplicationOptInTxnFromObject:()=>T.makeApplicationOptInTxnFromObject,makeApplicationUpdateTxn:()=>T.makeApplicationUpdateTxn,makeApplicationUpdateTxnFromObject:()=>T.makeApplicationUpdateTxnFromObject,makeAssetConfigTxn:()=>T.makeAssetConfigTxn,makeAssetConfigTxnWithSuggestedParams:()=>T.makeAssetConfigTxnWithSuggestedParams,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>T.makeAssetConfigTxnWithSuggestedParamsFromObject,makeAssetCreateTxn:()=>T.makeAssetCreateTxn,makeAssetCreateTxnWithSuggestedParams:()=>T.makeAssetCreateTxnWithSuggestedParams,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>T.makeAssetCreateTxnWithSuggestedParamsFromObject,makeAssetDestroyTxn:()=>T.makeAssetDestroyTxn,makeAssetDestroyTxnWithSuggestedParams:()=>T.makeAssetDestroyTxnWithSuggestedParams,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>T.makeAssetDestroyTxnWithSuggestedParamsFromObject,makeAssetFreezeTxn:()=>T.makeAssetFreezeTxn,makeAssetFreezeTxnWithSuggestedParams:()=>T.makeAssetFreezeTxnWithSuggestedParams,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>T.makeAssetFreezeTxnWithSuggestedParamsFromObject,makeAssetTransferTxn:()=>T.makeAssetTransferTxn,makeAssetTransferTxnWithSuggestedParams:()=>T.makeAssetTransferTxnWithSuggestedParams,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>T.makeAssetTransferTxnWithSuggestedParamsFromObject,makeKeyRegistrationTxn:()=>T.makeKeyRegistrationTxn,makeKeyRegistrationTxnWithSuggestedParams:()=>T.makeKeyRegistrationTxnWithSuggestedParams,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>T.makeKeyRegistrationTxnWithSuggestedParamsFromObject,makePaymentTxn:()=>T.makePaymentTxn,makePaymentTxnWithSuggestedParams:()=>T.makePaymentTxnWithSuggestedParams,makePaymentTxnWithSuggestedParamsFromObject:()=>T.makePaymentTxnWithSuggestedParamsFromObject,ALGORAND_MIN_TX_FEE:()=>s.ALGORAND_MIN_TX_FEE,Transaction:()=>s.Transaction,decodeSignedTransaction:()=>s.decodeSignedTransaction,decodeUnsignedTransaction:()=>s.decodeUnsignedTransaction,encodeUnsignedTransaction:()=>s.encodeUnsignedTransaction,instantiateTxnIfNeeded:()=>s.instantiateTxnIfNeeded,isTransactionWithSigner:()=>I.Xw,makeBasicAccountTransactionSigner:()=>I.x7,makeLogicSigAccountTransactionSigner:()=>I.i1,makeMultiSigAccountTransactionSigner:()=>I.Vj,AtomicTransactionComposer:()=>C.A,AtomicTransactionComposerStatus:()=>C.b,TransactionType:()=>R.i,ABIAddressType:()=>B.JQ,ABIArrayDynamicType:()=>B._4,ABIArrayStaticType:()=>B.X3,ABIBoolType:()=>B.R0,ABIByteType:()=>B.jD,ABIContract:()=>B.Yh,ABIInterface:()=>B.bL,ABIMethod:()=>B.Ls,ABIReferenceType:()=>B.UV,ABIStringType:()=>B.Ax,ABITransactionType:()=>B.A9,ABITupleType:()=>B.w1,ABIType:()=>B.NK,ABIUfixedType:()=>B.RY,ABIUintType:()=>B.Pu,ADDR_BYTE_SIZE:()=>B.Vk,LENGTH_ENCODE_BYTE_SIZE:()=>B.nh,MAX_LEN:()=>B.kG,SINGLE_BOOL_SIZE:()=>B.qH,SINGLE_BYTE_SIZE:()=>B.JH,abiCheckTransactionType:()=>B.vJ,abiTypeIsReference:()=>B.o5,abiTypeIsTransaction:()=>B.AE});var n=r(9404),i=r(7116),o=r(3033),s=r(9417),a=r(8886),u=r.n(a),c=r(2691),f=r(9070),l=r(413),h=r(5922),d={};for(const t in h)["default","MULTISIG_BAD_SENDER_ERROR_MSG","signTransaction","signBid","signBytes","verifyBytes","encodeObj","decodeObj","ERROR_MULTISIG_BAD_SENDER","ERROR_INVALID_MICROALGOS","Algodv2","Kmd","IntDecoding","Indexer","waitForConfirmation","isValidAddress","encodeAddress","decodeAddress","getApplicationAddress","bytesToBigInt","bigIntToBytes","encodeUint64","decodeUint64","generateAccount","modelsv2","mnemonicToMasterDerivationKey","masterDerivationKeyToMnemonic","secretKeyToMnemonic","mnemonicToSecretKey","seedFromMnemonic","mnemonicFromSeed","microalgosToAlgos","algosToMicroalgos","INVALID_MICROALGOS_ERROR_MSG","computeGroupID","assignGroupID","LogicSigAccount","makeLogicSig","signLogicSigTransaction","signLogicSigTransactionObject","logicSigFromByte","tealSign","tealSignFromProgram","signMultisigTransaction","mergeMultisigTransactions","appendSignMultisigTransaction","multisigAddress","LogicTemplates"].indexOf(t)<0&&(d[t]=()=>h[t]);r.d(e,d);var p=r(1663),m=r(6477),g=r(7197),b=r(9582),y=r(5062),v=r(8922),w=r(6963),_=r(7988),A=r(227),E=r(3510),S=r(1063),M=r(8800),x=r(4158),k=r(4383),T=r(1988),I=r(834),C=r(3458),R=r(2380),B=r(7677),N=r(2486).Buffer;const O=N.from([77,88]),P="The transaction sender address and multisig preimage do not match.";function D(t,e){if(void 0===t.from){const r=n.keyPairFromSecretKey(e);t.from=i.encodeAddress(r.publicKey)}const r=s.instantiateTxnIfNeeded(t);return{txID:r.txID().toString(),blob:r.signTxn(e)}}function L(t,e){return new c.Z(t).signBid(e)}function U(t,e){const r=N.from(l.concatArrays(O,t));return n.sign(r,e)}function j(t,e,r){const o=N.from(l.concatArrays(O,t)),s=i.decodeAddress(r).publicKey;return n.verify(o,e,s)}function F(t){return new Uint8Array(o.encode(t))}function q(t){return o.decode(t)}const z=new Error(P),H=new Error(f.rD),K=u()},1988:(t,e,r)=>{"use strict";r.r(e),r.d(e,{makePaymentTxnWithSuggestedParams:()=>s,makePaymentTxn:()=>a,makePaymentTxnWithSuggestedParamsFromObject:()=>u,makeKeyRegistrationTxnWithSuggestedParams:()=>c,makeKeyRegistrationTxn:()=>f,makeKeyRegistrationTxnWithSuggestedParamsFromObject:()=>l,makeAssetCreateTxnWithSuggestedParams:()=>h,makeAssetCreateTxn:()=>d,makeAssetCreateTxnWithSuggestedParamsFromObject:()=>p,makeAssetConfigTxnWithSuggestedParams:()=>m,makeAssetConfigTxn:()=>g,makeAssetConfigTxnWithSuggestedParamsFromObject:()=>b,makeAssetDestroyTxnWithSuggestedParams:()=>y,makeAssetDestroyTxn:()=>v,makeAssetDestroyTxnWithSuggestedParamsFromObject:()=>w,makeAssetFreezeTxnWithSuggestedParams:()=>_,makeAssetFreezeTxn:()=>A,makeAssetFreezeTxnWithSuggestedParamsFromObject:()=>E,makeAssetTransferTxnWithSuggestedParams:()=>S,makeAssetTransferTxn:()=>M,makeAssetTransferTxnWithSuggestedParamsFromObject:()=>x,makeApplicationCreateTxn:()=>k,makeApplicationCreateTxnFromObject:()=>T,makeApplicationUpdateTxn:()=>I,makeApplicationUpdateTxnFromObject:()=>C,makeApplicationDeleteTxn:()=>R,makeApplicationDeleteTxnFromObject:()=>B,makeApplicationOptInTxn:()=>N,makeApplicationOptInTxnFromObject:()=>O,makeApplicationCloseOutTxn:()=>P,makeApplicationCloseOutTxnFromObject:()=>D,makeApplicationClearStateTxn:()=>L,makeApplicationClearStateTxnFromObject:()=>U,makeApplicationNoOpTxn:()=>j,makeApplicationNoOpTxnFromObject:()=>F,OnApplicationComplete:()=>i.hq,makeApplicationCallTxnFromObject:()=>q});var n=r(9417),i=r(1624),o=r(1824);function s(t,e,r,i,s,a,u){const c={from:t,to:e,amount:r,closeRemainderTo:i,note:s,suggestedParams:a,type:o.i.pay,reKeyTo:u};return new n.Transaction(c)}function a(t,e,r,n,i,o,a,u,c,f,l){return s(t,e,n,i,u,{genesisHash:c,genesisID:f,firstRound:o,lastRound:a,fee:r},l)}function u(t){return s(t.from,t.to,t.amount,t.closeRemainderTo,t.note,t.suggestedParams,t.rekeyTo)}function c(t,e,r,i,s,a,u,c,f,l=!1,h){const d={from:t,note:e,voteKey:r,selectionKey:i,voteFirst:s,voteLast:a,voteKeyDilution:u,suggestedParams:c,type:o.i.keyreg,reKeyTo:f,nonParticipation:l,stateProofKey:h};return new n.Transaction(d)}function f(t,e,r,n,i,o,s,a,u,f,l,h,d,p=!1,m){return c(t,i,a,u,f,l,h,{genesisHash:o,genesisID:s,firstRound:r,lastRound:n,fee:e},d,p,m)}function l(t){return c(t.from,t.note,t.voteKey,t.selectionKey,t.voteFirst,t.voteLast,t.voteKeyDilution,t.suggestedParams,t.rekeyTo,t.nonParticipation,t.stateProofKey)}function h(t,e,r,i,s,a,u,c,f,l,h,d,p,m,g){const b={from:t,note:e,suggestedParams:m,assetTotal:r,assetDecimals:i,assetDefaultFrozen:s,assetUnitName:l,assetName:h,assetURL:d,assetMetadataHash:p,assetManager:a,assetReserve:u,assetFreeze:c,assetClawback:f,type:o.i.acfg,reKeyTo:g};return new n.Transaction(b)}function d(t,e,r,n,i,o,s,a,u,c,f,l,d,p,m,g,b,y,v){return h(t,i,a,u,c,f,l,d,p,m,g,b,y,{genesisHash:o,genesisID:s,firstRound:r,lastRound:n,fee:e},v)}function p(t){return h(t.from,t.note,t.total,t.decimals,t.defaultFrozen,t.manager,t.reserve,t.freeze,t.clawback,t.unitName,t.assetName,t.assetURL,t.assetMetadataHash,t.suggestedParams,t.rekeyTo)}function m(t,e,r,i,s,a,u,c,f=!0,l){if(f&&(void 0===i||void 0===s||void 0===a||void 0===u))throw Error("strict empty address checking was turned on, but at least one empty address was provided");const h={from:t,suggestedParams:c,assetIndex:r,assetManager:i,assetReserve:s,assetFreeze:a,assetClawback:u,type:o.i.acfg,note:e,reKeyTo:l};return new n.Transaction(h)}function g(t,e,r,n,i,o,s,a,u,c,f,l,h=!0,d){return m(t,i,a,u,c,f,l,{genesisHash:o,genesisID:s,firstRound:r,lastRound:n,fee:e},h,d)}function b(t){return m(t.from,t.note,t.assetIndex,t.manager,t.reserve,t.freeze,t.clawback,t.suggestedParams,t.strictEmptyAddressChecking,t.rekeyTo)}function y(t,e,r,i,s){const a={from:t,suggestedParams:i,assetIndex:r,type:o.i.acfg,note:e,reKeyTo:s};return new n.Transaction(a)}function v(t,e,r,n,i,o,s,a,u){return y(t,i,a,{genesisHash:o,genesisID:s,firstRound:r,lastRound:n,fee:e},u)}function w(t){return y(t.from,t.note,t.assetIndex,t.suggestedParams,t.rekeyTo)}function _(t,e,r,i,s,a,u){const c={from:t,type:o.i.afrz,freezeAccount:i,assetIndex:r,freezeState:s,note:e,suggestedParams:a,reKeyTo:u};return new n.Transaction(c)}function A(t,e,r,n,i,o,s,a,u,c,f){return _(t,i,a,u,c,{genesisHash:o,genesisID:s,firstRound:r,lastRound:n,fee:e},f)}function E(t){return _(t.from,t.note,t.assetIndex,t.freezeTarget,t.freezeState,t.suggestedParams,t.rekeyTo)}function S(t,e,r,i,s,a,u,c,f){const l={type:o.i.axfer,from:t,to:e,amount:s,suggestedParams:c,assetIndex:u,note:a,assetRevocationTarget:i,closeRemainderTo:r,reKeyTo:f};return new n.Transaction(l)}function M(t,e,r,n,i,o,s,a,u,c,f,l,h){return S(t,e,r,n,o,u,l,{genesisHash:c,genesisID:f,firstRound:s,lastRound:a,fee:i},h)}function x(t){return S(t.from,t.to,t.closeRemainderTo,t.revocationTarget,t.amount,t.note,t.assetIndex,t.suggestedParams,t.rekeyTo)}function k(t,e,r,i,s,a,u,c,f,l,h,d,p,m,g,b,y){const v={type:o.i.appl,from:t,suggestedParams:e,appIndex:0,appOnComplete:r,appLocalInts:a,appLocalByteSlices:u,appGlobalInts:c,appGlobalByteSlices:f,appApprovalProgram:i,appClearProgram:s,appArgs:l,appAccounts:h,appForeignApps:d,appForeignAssets:p,note:m,lease:g,reKeyTo:b,extraPages:y};return new n.Transaction(v)}function T(t){return k(t.from,t.suggestedParams,t.onComplete,t.approvalProgram,t.clearProgram,t.numLocalInts,t.numLocalByteSlices,t.numGlobalInts,t.numGlobalByteSlices,t.appArgs,t.accounts,t.foreignApps,t.foreignAssets,t.note,t.lease,t.rekeyTo,t.extraPages)}function I(t,e,r,s,a,u,c,f,l,h,d,p){const m={type:o.i.appl,from:t,suggestedParams:e,appIndex:r,appApprovalProgram:s,appOnComplete:i.hq.UpdateApplicationOC,appClearProgram:a,appArgs:u,appAccounts:c,appForeignApps:f,appForeignAssets:l,note:h,lease:d,reKeyTo:p};return new n.Transaction(m)}function C(t){return I(t.from,t.suggestedParams,t.appIndex,t.approvalProgram,t.clearProgram,t.appArgs,t.accounts,t.foreignApps,t.foreignAssets,t.note,t.lease,t.rekeyTo)}function R(t,e,r,s,a,u,c,f,l,h){const d={type:o.i.appl,from:t,suggestedParams:e,appIndex:r,appOnComplete:i.hq.DeleteApplicationOC,appArgs:s,appAccounts:a,appForeignApps:u,appForeignAssets:c,note:f,lease:l,reKeyTo:h};return new n.Transaction(d)}function B(t){return R(t.from,t.suggestedParams,t.appIndex,t.appArgs,t.accounts,t.foreignApps,t.foreignAssets,t.note,t.lease,t.rekeyTo)}function N(t,e,r,s,a,u,c,f,l,h){const d={type:o.i.appl,from:t,suggestedParams:e,appIndex:r,appOnComplete:i.hq.OptInOC,appArgs:s,appAccounts:a,appForeignApps:u,appForeignAssets:c,note:f,lease:l,reKeyTo:h};return new n.Transaction(d)}function O(t){return N(t.from,t.suggestedParams,t.appIndex,t.appArgs,t.accounts,t.foreignApps,t.foreignAssets,t.note,t.lease,t.rekeyTo)}function P(t,e,r,s,a,u,c,f,l,h){const d={type:o.i.appl,from:t,suggestedParams:e,appIndex:r,appOnComplete:i.hq.CloseOutOC,appArgs:s,appAccounts:a,appForeignApps:u,appForeignAssets:c,note:f,lease:l,reKeyTo:h};return new n.Transaction(d)}function D(t){return P(t.from,t.suggestedParams,t.appIndex,t.appArgs,t.accounts,t.foreignApps,t.foreignAssets,t.note,t.lease,t.rekeyTo)}function L(t,e,r,s,a,u,c,f,l,h){const d={type:o.i.appl,from:t,suggestedParams:e,appIndex:r,appOnComplete:i.hq.ClearStateOC,appArgs:s,appAccounts:a,appForeignApps:u,appForeignAssets:c,note:f,lease:l,reKeyTo:h};return new n.Transaction(d)}function U(t){return L(t.from,t.suggestedParams,t.appIndex,t.appArgs,t.accounts,t.foreignApps,t.foreignAssets,t.note,t.lease,t.rekeyTo)}function j(t,e,r,s,a,u,c,f,l,h){const d={type:o.i.appl,from:t,suggestedParams:e,appIndex:r,appOnComplete:i.hq.NoOpOC,appArgs:s,appAccounts:a,appForeignApps:u,appForeignAssets:c,note:f,lease:l,reKeyTo:h};return new n.Transaction(d)}function F(t){return j(t.from,t.suggestedParams,t.appIndex,t.appArgs,t.accounts,t.foreignApps,t.foreignAssets,t.note,t.lease,t.rekeyTo)}function q(t){const e={type:o.i.appl,from:t.from,suggestedParams:t.suggestedParams,appIndex:t.appIndex,appOnComplete:t.onComplete,appLocalInts:t.numLocalInts,appLocalByteSlices:t.numLocalByteSlices,appGlobalInts:t.numGlobalInts,appGlobalByteSlices:t.numGlobalByteSlices,appApprovalProgram:t.approvalProgram,appClearProgram:t.clearProgram,appArgs:t.appArgs,appAccounts:t.accounts,appForeignApps:t.foreignApps,appForeignAssets:t.foreignAssets,note:t.note,lease:t.lease,reKeyTo:t.rekeyTo,extraPages:t.extraPages};return new n.Transaction(e)}},3510:(t,e,r)=>{"use strict";r.d(e,{vC:()=>m,w3:()=>f,OF:()=>p,Ch:()=>h,QX:()=>d,mE:()=>l});const n=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];var i=r(9404),o=r(7116);const s="failed to decode mnemonic";function a(t){const e=[];let r=0,n=0;return t.forEach((function(t){r|=t<<n,n+=8,n>=11&&(e.push(2047&r),r>>=11,n-=11)})),n&&e.push(r),e}function u(t){return t.map((t=>n[t]))}function c(t){return u(a(i.genericHash(t)))[0]}function f(t){if(t.length!==i.SEED_BTYES_LENGTH)throw new RangeError(`Seed length must be ${i.SEED_BTYES_LENGTH}`);const e=u(a(t)),r=c(t);return`${e.join(" ")} ${r}`}function l(t){const e=t.split(" "),r=e.slice(0,24);for(const t of r)if(-1===n.indexOf(t))throw new Error("the mnemonic contains a word that is not in the wordlist");const i=e[e.length-1];let o=function(t){const e=[];let r=0,n=0;return t.forEach((function(t){for(r|=t<<n,n+=11;n>=8;)e.push(255&r),r>>=8,n-=8})),n&&e.push(r),new Uint8Array(e)}(r.map((t=>n.indexOf(t))));if(33!==o.length)throw new Error(s);if(0!==o[o.length-1])throw new Error(s);if(o=o.slice(0,o.length-1),c(o)===i)return o;throw new Error(s)}function h(t){const e=l(t),r=i.keyPairFromSeed(e);return{addr:o.encodeAddress(r.publicKey),sk:r.secretKey}}function d(t){return f(t.slice(0,i.SEED_BTYES_LENGTH))}function p(t){return l(t)}function m(t){return f(t)}},4158:(t,e,r)=>{"use strict";r.d(e,{J6:()=>h,F2:()=>d,PU:()=>p,PO:()=>m,vH:()=>g});var n=r(9404),i=r(7116),o=r(3033),s=r(9417),a=r(413),u=r(2486).Buffer;const c="Cannot merge txs. Multisig preimages differ",f="Cannot mutate a multisig field as it would invalidate all existing signatures.";class l extends s.Transaction{addLease(){throw new Error(f)}addRekey(){throw new Error(f)}signTxn(t){throw new Error("Cannot sign a multisig transaction using `signTxn`. Use `partialSignTxn` instead.")}partialSignTxn({version:t,threshold:e,pks:r},s){const a=n.keyPairFromSecretKey(s).publicKey;return function(t,{rawSig:e,myPk:r},{version:s,threshold:a,pks:c}){let f=!1;const l=c.map((t=>n.bytesEqual(t,r)?(f=!0,{pk:u.from(t),s:e}):{pk:u.from(t)}));if(!1===f)throw new Error("Key does not exist");const h={msig:{v:s,thr:a,subsig:l},txn:t},d=i.fromMultisigPreImg({version:s,threshold:a,pks:c});return i.encodeAddress(t.snd)!==i.encodeAddress(d)&&(h.sgnr=u.from(d)),new Uint8Array(o.encode(h))}(this.get_obj_for_encoding(),{rawSig:this.rawSignTxn(s),myPk:a},{version:t,threshold:e,pks:r})}static from_obj_for_encoding(t){return super.from_obj_for_encoding(t)}}function h(t){if(t.length<2)throw new Error("Not enough multisig transactions to merge. Need at least two");const e=o.decode(t[0]),r=l.from_obj_for_encoding(e.txn).txID(),n=e.sgnr?i.encodeAddress(e.sgnr):void 0,s={version:e.msig.v,threshold:e.msig.thr,pks:e.msig.subsig.map((t=>t.pk))},a=i.encodeAddress(i.fromMultisigPreImg(s));let f=e.msig.subsig;for(let s=0;s<t.length;s++){const h=o.decode(t[s]);if(l.from_obj_for_encoding(h.txn).txID()!==r)throw new Error("Cannot merge txs. txIDs differ");if(n!==(h.sgnr?i.encodeAddress(h.sgnr):void 0))throw new Error("Cannot merge txs. Auth addrs differ");if(h.msig.subsig.length!==e.msig.subsig.length)throw new Error(c);const d={version:h.msig.v,threshold:h.msig.thr,pks:h.msig.subsig.map((t=>t.pk))};if(a!==i.encodeAddress(i.fromMultisigPreImg(d)))throw new Error(c);f=h.msig.subsig.map(((t,r)=>{const n=e.msig.subsig[r];if(n.s){if(t.s&&0!==u.compare(u.from(t.s),u.from(n.s)))throw new Error("Cannot merge txs. subsigs are mismatched.");return{pk:n.pk,s:n.s}}return t.s?{pk:n.pk,s:t.s}:n}))}const h={msig:{v:e.msig.v,thr:e.msig.thr,subsig:f},txn:e.txn};return void 0!==n&&(h.sgnr=u.from(i.decodeAddress(n).publicKey)),new Uint8Array(o.encode(h))}function d(t,e,r){const o=e.v,s=e.thr,u=e.subsig,c=u.map((t=>t.pk));if(e.subsig.length<s)return!1;let f;try{f=i.fromMultisigPreImg({version:o,threshold:s,pks:c})}catch(t){return!1}if(!a.arrayEqual(f,r))return!1;let l=0;for(const t of u)void 0!==t.s&&(l+=1);if(l<s)return!1;let h=0;for(const e of u)void 0!==e.s&&n.verify(t,e.s,e.pk)&&(h+=1);return!(h<s)}function p(t,{version:e,threshold:r,addrs:n},o){const a=i.fromMultisigPreImgAddrs({version:e,threshold:r,addrs:n});Object.prototype.hasOwnProperty.call(t,"from")||(t.from=a);const u=n.map((t=>i.decodeAddress(t).publicKey));let c,f;return t instanceof s.Transaction?(c=t,f=l.prototype.partialSignTxn.call(c,{version:e,threshold:r,pks:u},o)):(c=new l(t),f=c.partialSignTxn({version:e,threshold:r,pks:u},o)),{txID:c.txID().toString(),blob:f}}function m(t,{version:e,threshold:r,addrs:n},s){const a=n.map((t=>i.decodeAddress(t).publicKey)),u=o.decode(t),c=l.from_obj_for_encoding(u.txn),f=c.partialSignTxn({version:e,threshold:r,pks:a},s);return{txID:c.txID().toString(),blob:h([t,f])}}function g({version:t,threshold:e,addrs:r}){return i.fromMultisigPreImgAddrs({version:t,threshold:e,addrs:r})}},9404:(t,e,r)=>{"use strict";r.r(e),r.d(e,{genericHash:()=>a,randomBytes:()=>u,keyPairFromSeed:()=>c,keyPair:()=>f,keyPairFromSecretKey:()=>l,sign:()=>h,bytesEqual:()=>d,verify:()=>p,PUBLIC_KEY_LENGTH:()=>m,SECRET_KEY_LENGTH:()=>g,HASH_BYTES_LENGTH:()=>b,SEED_BTYES_LENGTH:()=>y});var n=r(7765),i=r.n(n),o=r(9757),s=r.n(o);function a(t){return s().sha512_256.array(t)}function u(t){return i().randomBytes(t)}function c(t){return i().sign.keyPair.fromSeed(t)}function f(){return c(u(i().box.secretKeyLength))}function l(t){return i().sign.keyPair.fromSecretKey(t)}function h(t,e){return i().sign.detached(t,e)}function d(t,e){return i().verify(t,e)}function p(t,e,r){return i().sign.detached.verify(t,e,r)}const m=i().sign.publicKeyLength,g=i().sign.secretKeyLength,b=32,y=32},834:(t,e,r)=>{"use strict";r.d(e,{x7:()=>o,i1:()=>s,Vj:()=>a,Xw:()=>u});var n=r(8800),i=r(4158);function o(t){return(e,r)=>{const n=[];for(const i of r)n.push(e[i].signTxn(t.sk));return Promise.resolve(n)}}function s(t){return(e,r)=>{const i=[];for(const o of r){const{blob:r}=(0,n.signLogicSigTransactionObject)(e[o],t);i.push(r)}return Promise.resolve(i)}}function a(t,e){return(r,n)=>{const o=[];for(const s of n){const n=r[s],a=[];for(const r of e){const{blob:e}=(0,i.PU)(n,t,r);a.push(e)}o.push((0,i.J6)(a))}return Promise.resolve(o)}}function u(t){return"object"==typeof t&&2===Object.keys(t).length&&"object"==typeof t.txn&&"function"==typeof t.signer}},9417:(t,e,r)=>{"use strict";r.r(e),r.d(e,{ALGORAND_MIN_TX_FEE:()=>l,Transaction:()=>d,encodeUnsignedTransaction:()=>p,decodeUnsignedTransaction:()=>m,decodeSignedTransaction:()=>g,instantiateTxnIfNeeded:()=>b,default:()=>y});var n=r(7267),i=r.n(n),o=r(7116),s=r(3033),a=r(9404),u=r(413),c=r(1624),f=r(2486).Buffer;const l=1e3;function h(t,e,r){if(null==t)return;let n;if("string"==typeof t?n=f.from(t,"base64"):t.constructor===Uint8Array?n=f.from(t):f.isBuffer(t)&&(n=t),null==n||n.byteLength!==r)throw Error(`${e} must be a ${r} byte Uint8Array or Buffer or base64 string.`);return n}class d{constructor({...t}){this.name="Transaction",this.tag=f.from("TX");const e={type:c.iU.pay,flatFee:!1,nonParticipation:!1};if(void 0===t.type&&(t.type=e.type),void 0===t.flatFee&&(t.flatFee=e.flatFee),t.type===c.iU.keyreg&&void 0!==t.voteKey&&void 0===t.nonParticipation&&(t.nonParticipation=e.nonParticipation),void 0!==t.suggestedParams){const e=t;e.genesisHash=e.suggestedParams.genesisHash,e.fee=e.suggestedParams.fee,void 0!==e.suggestedParams.flatFee&&(e.flatFee=e.suggestedParams.flatFee),e.firstRound=e.suggestedParams.firstRound,e.lastRound=e.suggestedParams.lastRound,e.genesisID=e.suggestedParams.genesisID}const r=t;if(r.from=o.decodeAddress(r.from),void 0!==r.to&&(r.to=o.decodeAddress(r.to)),void 0!==r.closeRemainderTo&&(r.closeRemainderTo=o.decodeAddress(r.closeRemainderTo)),void 0!==r.assetManager&&(r.assetManager=o.decodeAddress(r.assetManager)),void 0!==r.assetReserve&&(r.assetReserve=o.decodeAddress(r.assetReserve)),void 0!==r.assetFreeze&&(r.assetFreeze=o.decodeAddress(r.assetFreeze)),void 0!==r.assetClawback&&(r.assetClawback=o.decodeAddress(r.assetClawback)),void 0!==r.assetRevocationTarget&&(r.assetRevocationTarget=o.decodeAddress(r.assetRevocationTarget)),void 0!==r.freezeAccount&&(r.freezeAccount=o.decodeAddress(r.freezeAccount)),void 0!==r.reKeyTo&&(r.reKeyTo=o.decodeAddress(r.reKeyTo)),void 0===r.genesisHash)throw Error("genesis hash must be specified and in a base64 string.");if(r.genesisHash=f.from(r.genesisHash,"base64"),void 0!==r.amount&&(!(Number.isSafeInteger(r.amount)||"bigint"==typeof r.amount&&r.amount<=BigInt("0xffffffffffffffff"))||r.amount<0))throw Error("Amount must be a positive number and smaller than 2^64-1. If the number is larger than 2^53-1, use bigint.");if(!Number.isSafeInteger(r.fee)||r.fee<0)throw Error("fee must be a positive number and smaller than 2^53-1");if(!Number.isSafeInteger(r.firstRound)||r.firstRound<0)throw Error("firstRound must be a positive number");if(!Number.isSafeInteger(r.lastRound)||r.lastRound<0)throw Error("lastRound must be a positive number");if(void 0!==r.extraPages&&(!Number.isInteger(r.extraPages)||r.extraPages<0||r.extraPages>3))throw Error("extraPages must be an Integer between and including 0 to 3");if(void 0!==r.assetTotal&&(!(Number.isSafeInteger(r.assetTotal)||"bigint"==typeof r.assetTotal&&r.assetTotal<=BigInt("0xffffffffffffffff"))||r.assetTotal<0))throw Error("Total asset issuance must be a positive number and smaller than 2^64-1. If the number is larger than 2^53-1, use bigint.");if(void 0!==r.assetDecimals&&(!Number.isSafeInteger(r.assetDecimals)||r.assetDecimals<0||r.assetDecimals>19))throw Error(`assetDecimals must be a positive number and smaller than ${19..toString()}`);if(void 0!==r.assetIndex&&(!Number.isSafeInteger(r.assetIndex)||r.assetIndex<0))throw Error("Asset index must be a positive number and smaller than 2^53-1");if(void 0!==r.appIndex&&(!Number.isSafeInteger(r.appIndex)||r.appIndex<0))throw Error("Application index must be a positive number and smaller than 2^53-1");if(void 0!==r.appLocalInts&&(!Number.isSafeInteger(r.appLocalInts)||r.appLocalInts<0))throw Error("Application local ints count must be a positive number and smaller than 2^53-1");if(void 0!==r.appLocalByteSlices&&(!Number.isSafeInteger(r.appLocalByteSlices)||r.appLocalByteSlices<0))throw Error("Application local byte slices count must be a positive number and smaller than 2^53-1");if(void 0!==r.appGlobalInts&&(!Number.isSafeInteger(r.appGlobalInts)||r.appGlobalInts<0))throw Error("Application global ints count must be a positive number and smaller than 2^53-1");if(void 0!==r.appGlobalByteSlices&&(!Number.isSafeInteger(r.appGlobalByteSlices)||r.appGlobalByteSlices<0))throw Error("Application global byte slices count must be a positive number and smaller than 2^53-1");if(void 0!==r.appApprovalProgram&&r.appApprovalProgram.constructor!==Uint8Array)throw Error("appApprovalProgram must be a Uint8Array.");if(void 0!==r.appClearProgram&&r.appClearProgram.constructor!==Uint8Array)throw Error("appClearProgram must be a Uint8Array.");if(void 0!==r.appArgs){if(!Array.isArray(r.appArgs))throw Error("appArgs must be an Array of Uint8Array.");r.appArgs=r.appArgs.slice(),r.appArgs.forEach((t=>{if(t.constructor!==Uint8Array)throw Error("each element of AppArgs must be a Uint8Array.")}))}else r.appArgs=[];if(void 0!==r.appAccounts){if(!Array.isArray(r.appAccounts))throw Error("appAccounts must be an Array of addresses.");r.appAccounts=r.appAccounts.map((t=>o.decodeAddress(t)))}if(void 0!==r.appForeignApps){if(!Array.isArray(r.appForeignApps))throw Error("appForeignApps must be an Array of integers.");r.appForeignApps=r.appForeignApps.slice(),r.appForeignApps.forEach((t=>{if(!Number.isSafeInteger(t)||t<0)throw Error("each foreign application index must be a positive number and smaller than 2^53-1")}))}if(void 0!==r.appForeignAssets){if(!Array.isArray(r.appForeignAssets))throw Error("appForeignAssets must be an Array of integers.");r.appForeignAssets=r.appForeignAssets.slice(),r.appForeignAssets.forEach((t=>{if(!Number.isSafeInteger(t)||t<0)throw Error("each foreign asset index must be a positive number and smaller than 2^53-1")}))}if(void 0!==r.assetMetadataHash&&0!==r.assetMetadataHash.length){if("string"==typeof r.assetMetadataHash&&(r.assetMetadataHash=new Uint8Array(f.from(r.assetMetadataHash))),r.assetMetadataHash.constructor!==Uint8Array||32!==r.assetMetadataHash.byteLength)throw Error("assetMetadataHash must be a 32 byte Uint8Array or string.");r.assetMetadataHash.every((t=>0===t))&&(r.assetMetadataHash=void 0)}else r.assetMetadataHash=void 0;if(void 0!==r.note){if(r.note.constructor!==Uint8Array)throw Error("note must be a Uint8Array.")}else r.note=new Uint8Array(0);if(void 0!==r.lease){if(r.lease.constructor!==Uint8Array)throw Error("lease must be a Uint8Array.");if(32!==r.lease.length)throw Error(`lease must be of length ${32..toString()}.`);r.lease.every((t=>0===t))&&(r.lease=new Uint8Array(0))}else r.lease=new Uint8Array(0);if(r.voteKey=h(r.voteKey,"voteKey",32),r.selectionKey=h(r.selectionKey,"selectionKey",32),r.stateProofKey=h(r.stateProofKey,"stateProofKey",64),r.nonParticipation&&(r.voteKey||r.selectionKey||r.voteFirst||r.stateProofKey||r.voteLast||r.voteKeyDilution))throw new Error("nonParticipation is true but participation params are present.");if(!r.nonParticipation&&(r.voteKey||r.selectionKey||r.stateProofKey||r.voteFirst||r.voteLast||r.voteKeyDilution)&&!(r.voteKey&&r.selectionKey&&r.voteFirst&&r.voteLast&&r.voteKeyDilution))throw new Error("online key registration missing at least one of the following fields: voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution");delete r.suggestedParams,Object.assign(this,u.removeUndefinedProperties(r)),r.flatFee||(this.fee*=this.estimateSize(),this.fee<l&&(this.fee=l)),this.group=void 0}get_obj_for_encoding(){if("pay"===this.type){const t={amt:this.amount,fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:f.from(this.note),snd:f.from(this.from.publicKey),type:"pay",gen:this.genesisID,gh:this.genesisHash,lx:f.from(this.lease),grp:this.group};return void 0!==this.closeRemainderTo&&o.encodeAddress(this.closeRemainderTo.publicKey)!==o.ALGORAND_ZERO_ADDRESS_STRING&&(t.close=f.from(this.closeRemainderTo.publicKey)),void 0!==this.reKeyTo&&(t.rekey=f.from(this.reKeyTo.publicKey)),void 0!==this.to&&(t.rcv=f.from(this.to.publicKey)),t.note.length||delete t.note,t.amt||delete t.amt,t.fee||delete t.fee,t.fv||delete t.fv,t.gen||delete t.gen,void 0===t.grp&&delete t.grp,t.lx.length||delete t.lx,t.rekey||delete t.rekey,t}if("keyreg"===this.type){const t={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:f.from(this.note),snd:f.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:f.from(this.lease),grp:this.group,votekey:this.voteKey,selkey:this.selectionKey,sprfkey:this.stateProofKey,votefst:this.voteFirst,votelst:this.voteLast,votekd:this.voteKeyDilution};return t.note.length||delete t.note,t.lx.length||delete t.lx,t.fee||delete t.fee,t.fv||delete t.fv,t.gen||delete t.gen,void 0===t.grp&&delete t.grp,void 0!==this.reKeyTo&&(t.rekey=f.from(this.reKeyTo.publicKey)),this.nonParticipation&&(t.nonpart=!0),t.selkey||delete t.selkey,t.votekey||delete t.votekey,t.sprfkey||delete t.sprfkey,t.votefst||delete t.votefst,t.votelst||delete t.votelst,t.votekd||delete t.votekd,t}if("acfg"===this.type){const t={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:f.from(this.note),snd:f.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:f.from(this.lease),grp:this.group,caid:this.assetIndex,apar:{t:this.assetTotal,df:this.assetDefaultFrozen,dc:this.assetDecimals}};return void 0!==this.assetManager&&(t.apar.m=f.from(this.assetManager.publicKey)),void 0!==this.assetReserve&&(t.apar.r=f.from(this.assetReserve.publicKey)),void 0!==this.assetFreeze&&(t.apar.f=f.from(this.assetFreeze.publicKey)),void 0!==this.assetClawback&&(t.apar.c=f.from(this.assetClawback.publicKey)),void 0!==this.assetName&&(t.apar.an=this.assetName),void 0!==this.assetUnitName&&(t.apar.un=this.assetUnitName),void 0!==this.assetURL&&(t.apar.au=this.assetURL),void 0!==this.assetMetadataHash&&(t.apar.am=f.from(this.assetMetadataHash)),t.note.length||delete t.note,t.lx.length||delete t.lx,t.amt||delete t.amt,t.fee||delete t.fee,t.fv||delete t.fv,t.gen||delete t.gen,void 0!==this.reKeyTo&&(t.rekey=f.from(this.reKeyTo.publicKey)),t.caid||delete t.caid,t.apar.t||t.apar.un||t.apar.an||t.apar.df||t.apar.m||t.apar.r||t.apar.f||t.apar.c||t.apar.au||t.apar.am||t.apar.dc?(t.apar.t||delete t.apar.t,t.apar.dc||delete t.apar.dc,t.apar.un||delete t.apar.un,t.apar.an||delete t.apar.an,t.apar.df||delete t.apar.df,t.apar.m||delete t.apar.m,t.apar.r||delete t.apar.r,t.apar.f||delete t.apar.f,t.apar.c||delete t.apar.c,t.apar.au||delete t.apar.au,t.apar.am||delete t.apar.am):delete t.apar,void 0===t.grp&&delete t.grp,t}if("axfer"===this.type){const t={aamt:this.amount,fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:f.from(this.note),snd:f.from(this.from.publicKey),arcv:f.from(this.to.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:f.from(this.lease),grp:this.group,xaid:this.assetIndex};return void 0!==this.closeRemainderTo&&(t.aclose=f.from(this.closeRemainderTo.publicKey)),void 0!==this.assetRevocationTarget&&(t.asnd=f.from(this.assetRevocationTarget.publicKey)),t.note.length||delete t.note,t.lx.length||delete t.lx,t.aamt||delete t.aamt,t.amt||delete t.amt,t.fee||delete t.fee,t.fv||delete t.fv,t.gen||delete t.gen,void 0===t.grp&&delete t.grp,t.aclose||delete t.aclose,t.asnd||delete t.asnd,t.rekey||delete t.rekey,void 0!==this.reKeyTo&&(t.rekey=f.from(this.reKeyTo.publicKey)),t}if("afrz"===this.type){const t={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:f.from(this.note),snd:f.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:f.from(this.lease),grp:this.group,faid:this.assetIndex,afrz:this.freezeState};return void 0!==this.freezeAccount&&(t.fadd=f.from(this.freezeAccount.publicKey)),t.note.length||delete t.note,t.lx.length||delete t.lx,t.amt||delete t.amt,t.fee||delete t.fee,t.fv||delete t.fv,t.gen||delete t.gen,t.afrz||delete t.afrz,void 0===t.grp&&delete t.grp,void 0!==this.reKeyTo&&(t.rekey=f.from(this.reKeyTo.publicKey)),t}if("appl"===this.type){const t={fee:this.fee,fv:this.firstRound,lv:this.lastRound,note:f.from(this.note),snd:f.from(this.from.publicKey),type:this.type,gen:this.genesisID,gh:this.genesisHash,lx:f.from(this.lease),grp:this.group,apid:this.appIndex,apan:this.appOnComplete,apls:{nui:this.appLocalInts,nbs:this.appLocalByteSlices},apgs:{nui:this.appGlobalInts,nbs:this.appGlobalByteSlices},apfa:this.appForeignApps,apas:this.appForeignAssets,apep:this.extraPages};return void 0!==this.reKeyTo&&(t.rekey=f.from(this.reKeyTo.publicKey)),void 0!==this.appApprovalProgram&&(t.apap=f.from(this.appApprovalProgram)),void 0!==this.appClearProgram&&(t.apsu=f.from(this.appClearProgram)),void 0!==this.appArgs&&(t.apaa=this.appArgs.map((t=>f.from(t)))),void 0!==this.appAccounts&&(t.apat=this.appAccounts.map((t=>f.from(t.publicKey)))),t.note.length||delete t.note,t.lx.length||delete t.lx,t.amt||delete t.amt,t.fee||delete t.fee,t.fv||delete t.fv,t.gen||delete t.gen,t.apid||delete t.apid,t.apls.nui||delete t.apls.nui,t.apls.nbs||delete t.apls.nbs,t.apls.nui||t.apls.nbs||delete t.apls,t.apgs.nui||delete t.apgs.nui,t.apgs.nbs||delete t.apgs.nbs,t.apaa&&t.apaa.length||delete t.apaa,t.apgs.nui||t.apgs.nbs||delete t.apgs,t.apap||delete t.apap,t.apsu||delete t.apsu,t.apan||delete t.apan,t.apfa&&t.apfa.length||delete t.apfa,t.apas&&t.apas.length||delete t.apas,t.apat&&t.apat.length||delete t.apat,t.apep||delete t.apep,void 0===t.grp&&delete t.grp,t}}static from_obj_for_encoding(t){const e=Object.create(this.prototype);if(e.name="Transaction",e.tag=f.from("TX"),e.genesisID=t.gen,e.genesisHash=f.from(t.gh),!(0,c.v8)(t.type))throw new Error(`Unrecognized transaction type: ${t.type}`);return e.type=t.type,e.fee=t.fee,e.firstRound=t.fv,e.lastRound=t.lv,e.note=new Uint8Array(t.note),e.lease=new Uint8Array(t.lx),e.from=o.decodeAddress(o.encodeAddress(new Uint8Array(t.snd))),void 0!==t.grp&&(e.group=f.from(t.grp)),void 0!==t.rekey&&(e.reKeyTo=o.decodeAddress(o.encodeAddress(new Uint8Array(t.rekey)))),"pay"===t.type?(e.amount=t.amt,e.to=o.decodeAddress(o.encodeAddress(new Uint8Array(t.rcv))),void 0!==t.close&&(e.closeRemainderTo=o.decodeAddress(o.encodeAddress(t.close)))):"keyreg"===t.type?(void 0!==t.votekey&&(e.voteKey=f.from(t.votekey)),void 0!==t.selkey&&(e.selectionKey=f.from(t.selkey)),void 0!==t.sprfkey&&(e.stateProofKey=f.from(t.sprfkey)),void 0!==t.votekd&&(e.voteKeyDilution=t.votekd),void 0!==t.votefst&&(e.voteFirst=t.votefst),void 0!==t.votelst&&(e.voteLast=t.votelst),void 0!==t.nonpart&&(e.nonParticipation=t.nonpart)):"acfg"===t.type?(void 0!==t.caid&&(e.assetIndex=t.caid),void 0!==t.apar&&(e.assetTotal=t.apar.t,e.assetDefaultFrozen=t.apar.df,void 0!==t.apar.dc&&(e.assetDecimals=t.apar.dc),void 0!==t.apar.m&&(e.assetManager=o.decodeAddress(o.encodeAddress(new Uint8Array(t.apar.m)))),void 0!==t.apar.r&&(e.assetReserve=o.decodeAddress(o.encodeAddress(new Uint8Array(t.apar.r)))),void 0!==t.apar.f&&(e.assetFreeze=o.decodeAddress(o.encodeAddress(new Uint8Array(t.apar.f)))),void 0!==t.apar.c&&(e.assetClawback=o.decodeAddress(o.encodeAddress(new Uint8Array(t.apar.c)))),void 0!==t.apar.un&&(e.assetUnitName=t.apar.un),void 0!==t.apar.an&&(e.assetName=t.apar.an),void 0!==t.apar.au&&(e.assetURL=t.apar.au),void 0!==t.apar.am&&(e.assetMetadataHash=t.apar.am))):"axfer"===t.type?(void 0!==t.xaid&&(e.assetIndex=t.xaid),void 0!==t.aamt&&(e.amount=t.aamt),void 0!==t.aclose&&(e.closeRemainderTo=o.decodeAddress(o.encodeAddress(new Uint8Array(t.aclose)))),void 0!==t.asnd&&(e.assetRevocationTarget=o.decodeAddress(o.encodeAddress(new Uint8Array(t.asnd)))),e.to=o.decodeAddress(o.encodeAddress(new Uint8Array(t.arcv)))):"afrz"===t.type?(void 0!==t.afrz&&(e.freezeState=t.afrz),void 0!==t.faid&&(e.assetIndex=t.faid),e.freezeAccount=o.decodeAddress(o.encodeAddress(new Uint8Array(t.fadd)))):"appl"===t.type&&(void 0!==t.apid&&(e.appIndex=t.apid),void 0!==t.apan&&(e.appOnComplete=t.apan),void 0!==t.apls&&(void 0!==t.apls.nui&&(e.appLocalInts=t.apls.nui),void 0!==t.apls.nbs&&(e.appLocalByteSlices=t.apls.nbs)),void 0!==t.apgs&&(void 0!==t.apgs.nui&&(e.appGlobalInts=t.apgs.nui),void 0!==t.apgs.nbs&&(e.appGlobalByteSlices=t.apgs.nbs)),void 0!==t.apep&&(e.extraPages=t.apep),void 0!==t.apap&&(e.appApprovalProgram=new Uint8Array(t.apap)),void 0!==t.apsu&&(e.appClearProgram=new Uint8Array(t.apsu)),void 0!==t.apaa&&(e.appArgs=t.apaa.map((t=>new Uint8Array(t)))),void 0!==t.apat&&(e.appAccounts=t.apat.map((t=>o.decodeAddress(o.encodeAddress(new Uint8Array(t)))))),void 0!==t.apfa&&(e.appForeignApps=t.apfa),void 0!==t.apas&&(e.appForeignAssets=t.apas)),e}estimateSize(){return this.toByte().length+75}bytesToSign(){const t=this.toByte();return f.from(u.concatArrays(this.tag,t))}toByte(){return s.encode(this.get_obj_for_encoding())}rawSignTxn(t){const e=this.bytesToSign(),r=a.sign(e,t);return f.from(r)}signTxn(t){const e={sig:this.rawSignTxn(t),txn:this.get_obj_for_encoding()},r=a.keyPairFromSecretKey(t).publicKey;return o.encodeAddress(r)!==o.encodeAddress(this.from.publicKey)&&(e.sgnr=f.from(r)),new Uint8Array(s.encode(e))}rawTxID(){const t=this.toByte(),e=f.from(u.concatArrays(this.tag,t));return f.from(a.genericHash(e))}txID(){const t=this.rawTxID();return i().encode(t).slice(0,52)}addLease(t,e=0){let r;if(void 0!==t){if(t.constructor!==Uint8Array)throw Error("lease must be a Uint8Array.");if(32!==t.length)throw Error(`lease must be of length ${32..toString()}.`);r=new Uint8Array(t)}else r=new Uint8Array(0);this.lease=r,0!==e&&(this.fee+=37*e)}addRekey(t,e=0){void 0!==t&&(this.reKeyTo=o.decodeAddress(t)),0!==e&&(this.fee+=37*e)}_getDictForDisplay(){const t={...this};return t.tag=t.tag.toString(),t.from=o.encodeAddress(t.from.publicKey),void 0!==t.to&&(t.to=o.encodeAddress(t.to.publicKey)),void 0!==t.freezeAccount&&(t.freezeAccount=o.encodeAddress(t.freezeAccount.publicKey)),void 0!==t.closeRemainderTo&&(t.closeRemainderTo=o.encodeAddress(t.closeRemainderTo.publicKey)),void 0!==t.assetManager&&(t.assetManager=o.encodeAddress(t.assetManager.publicKey)),void 0!==t.assetReserve&&(t.assetReserve=o.encodeAddress(t.assetReserve.publicKey)),void 0!==t.assetFreeze&&(t.assetFreeze=o.encodeAddress(t.assetFreeze.publicKey)),void 0!==t.assetClawback&&(t.assetClawback=o.encodeAddress(t.assetClawback.publicKey)),void 0!==t.assetRevocationTarget&&(t.assetRevocationTarget=o.encodeAddress(t.assetRevocationTarget.publicKey)),void 0!==t.reKeyTo&&(t.reKeyTo=o.encodeAddress(t.reKeyTo.publicKey)),t.genesisHash=t.genesisHash.toString("base64"),t}prettyPrint(){console.log(this._getDictForDisplay())}toString(){return JSON.stringify(this._getDictForDisplay())}}function p(t){const e=t.get_obj_for_encoding();return s.encode(e)}function m(t){const e=s.decode(t);return d.from_obj_for_encoding(e)}function g(t){const e=s.decode(t);return{...e,txn:d.from_obj_for_encoding(e.txn)}}function b(t){return t instanceof d?t:new d(t)}const y=d},2380:(t,e,r)=>{"use strict";r.d(e,{i:()=>n.i});var n=r(1824)},7197:(t,e,r)=>{"use strict";var n;r.d(e,{Z:()=>i}),function(t){t.DEFAULT="default",t.SAFE="safe",t.MIXED="mixed",t.BIGINT="bigint"}(n||(n={}));const i=n},1624:(t,e,r)=>{"use strict";var n,i;function o(t){return t===n.pay||t===n.keyreg||t===n.acfg||t===n.axfer||t===n.afrz||t===n.appl}r.d(e,{iU:()=>n,v8:()=>o,hq:()=>i}),function(t){t.pay="pay",t.keyreg="keyreg",t.acfg="acfg",t.axfer="axfer",t.afrz="afrz",t.appl="appl"}(n||(n={})),function(t){t[t.NoOpOC=0]="NoOpOC",t[t.OptInOC=1]="OptInOC",t[t.CloseOutOC=2]="CloseOutOC",t[t.ClearStateOC=3]="ClearStateOC",t[t.UpdateApplicationOC=4]="UpdateApplicationOC",t[t.DeleteApplicationOC=5]="DeleteApplicationOC"}(i||(i={}))},1824:(t,e,r)=>{"use strict";r.d(e,{i:()=>n.iU});var n=r(1624)},413:(t,e,r)=>{"use strict";r.r(e),r.d(e,{parseJSON:()=>a,arrayEqual:()=>u,concatArrays:()=>c,removeUndefinedProperties:()=>f,isNode:()=>l});var n=r(4360),i=r.n(n),o=r(7197);const s=i()({useNativeBigInt:!0,strict:!0});function a(t,e){const r=e&&e.intDecoding?e.intDecoding:o.Z.DEFAULT;return s.parse(t,((t,e)=>{if(null!=e&&"object"==typeof e&&null==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,Object.prototype),"bigint"==typeof e){if("bigint"===r||"mixed"===r&&e>Number.MAX_SAFE_INTEGER)return e;if("default"===r||"mixed"===r)return Number(e);throw new Error(`Integer exceeds maximum safe integer: ${e.toString()}. Try parsing with a different intDecoding option.`)}return"number"==typeof e&&"bigint"===r&&Number.isInteger(e)?BigInt(e):e}))}function u(t,e){return t.length===e.length&&Array.from(t).every(((t,r)=>t===e[r]))}function c(...t){const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);let n=0;for(let e=0;e<t.length;e++)r.set(t[e],n),n+=t[e].length;return r}function f(t){const e={...t};return Object.keys(e).forEach((t=>{void 0===e[t]&&delete e[t]})),e}function l(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}},5062:(t,e,r)=>{"use strict";async function n(t,e,r){const n=await t.status().do();if(void 0===n)throw new Error("Unable to get node status");const i=n["last-round"]+1;let o=i;for(;o<i+r;){let r=!1;try{const n=await t.pendingTransactionInformation(e).do();if(n["confirmed-round"])return n;if(n["pool-error"])throw r=!0,new Error(`Transaction Rejected: ${n["pool-error"]}`)}catch(t){if(r)throw t}await t.statusAfterBlock(o).do(),o+=1}throw new Error(`Transaction not confirmed after ${r} rounds`)}r.d(e,{K:()=>n})},4654:()=>{}},__webpack_module_cache__={};function __nested_webpack_require_413522__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__nested_webpack_require_413522__),r.exports}__nested_webpack_require_413522__.amdO={},__nested_webpack_require_413522__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __nested_webpack_require_413522__.d(e,{a:e}),e},__nested_webpack_require_413522__.d=(t,e)=>{for(var r in e)__nested_webpack_require_413522__.o(e,r)&&!__nested_webpack_require_413522__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__nested_webpack_require_413522__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__nested_webpack_require_413522__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__nested_webpack_require_413522__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__nested_webpack_require_413522__.r(__webpack_exports__),__nested_webpack_require_413522__.d(__webpack_exports__,{default:()=>r});var t=__nested_webpack_require_413522__(6608),e={};for(const r in t)"default"!==r&&(e[r]=()=>t[r]);__nested_webpack_require_413522__.d(__webpack_exports__,e);const r=t})(),__webpack_exports__})()},module.exports=t()},5055:(t,e,r)=>{"use strict";const n=e;n.bignum=r(9611),n.define=r(7753).define,n.base=r(5779),n.constants=r(9239),n.decoders=r(8538),n.encoders=r(2212)},7753:(t,e,r)=>{"use strict";const n=r(2212),i=r(8538),o=r(8575);function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new s(t,e)},s.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},s.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},s.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},s.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},s.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},4716:(t,e,r)=>{"use strict";const n=r(8575),i=r(7346).b,o=r(4563).Buffer;function s(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(s,i),e.C=s,s.isDecoderBuffer=function(t){return t instanceof s||"object"==typeof t&&o.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(t){const e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=o.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},5779:(t,e,r)=>{"use strict";const n=e;n.Reporter=r(7346).b,n.DecoderBuffer=r(4716).C,n.EncoderBuffer=r(4716).R,n.Node=r(5680)},5680:(t,e,r)=>{"use strict";const n=r(7346).b,i=r(4716).R,o=r(4716).C,s=r(5997),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function c(t,e,r){const n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=c;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},c.prototype._wrap=function(){const t=this._baseState;u.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},c.prototype._init=function(t){const e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){c.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){c.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),c.prototype.use=function(t){s(t);const e=this._baseState;return s(null===e.use),e.use=t,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(t){const e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},c.prototype.explicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},c.prototype.implicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},c.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},c.prototype.key=function(t){const e=this._baseState;return s(null===e.key),e.key=t,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(t){const e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},c.prototype.contains=function(t){const e=this._baseState;return s(null===e.use),e.contains=t,this},c.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(t,n,r.any),t.isError(s))return s}else{const n=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(n)}}if(r.obj&&s&&(n=t.enterObject()),s){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const n=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const n=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(n))return n;r.any?i=t.raw(e):t=n}if(e&&e.track&&null!==r.tag&&e.track(t.path(),n,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(n,e)}}return r.obj&&s&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},c.prototype._decodeGeneric=function(t,e,r){const n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},c.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(t,e){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=t.save(),a=r.choice[o];try{const r=a._decode(t,e);if(t.isError(r))return!1;n={type:o,value:r},i=!0}catch(e){return t.restore(s),!1}return!0}),this),i?n:t.error("Choice not matched")},c.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},c.prototype._encode=function(t,e,r){const n=this._baseState;if(null!==n.default&&n.default===t)return;const i=this._encodeValue(t,e,r);return void 0===i||this._skipDefault(i,e,r)?void 0:i},c.prototype._encodeValue=function(t,e,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);let o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}let s=null,a=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)s=this._getUse(i.contains,r)._encode(t,e),a=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){const n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(s=this._encodePrimitive(i.tag,t),a=!0);if(!i.any&&null===i.choice){const t=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===t?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(t,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(t,e){const r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},c.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},c.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},c.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},7346:(t,e,r)=>{"use strict";const n=r(8575);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){const n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){let e;const r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},4873:(t,e)=>{"use strict";function r(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=r(e.tag)},9239:(t,e,r)=>{"use strict";const n=e;n._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e},n.der=r(4873)},7469:(t,e,r)=>{"use strict";const n=r(8575),i=r(9611),o=r(4716).C,s=r(5680),a=r(4873);function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new c,this.tree._init(t.body)}function c(t){s.call(this,"der",t)}function f(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=t.readUInt8(e),t.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function l(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(let e=0;e<i;e++){n<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;n|=e}return n}t.exports=u,u.prototype.decode=function(t,e){return o.isDecoderBuffer(t)||(t=new o(t,e)),this.tree._decode(t,e)},n(c,s),c.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;const n=t.save(),i=f(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},c.prototype._decodeTag=function(t,e,r){const n=f(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;let i=l(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');const o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},c.prototype._skipUntilEnd=function(t,e){for(;;){const r=f(t,e);if(t.isError(r))return r;const n=l(t,r.primitive,e);if(t.isError(n))return n;let i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},c.prototype._decodeList=function(t,e,r,n){const i=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=r.decode(t,"der",n);if(t.isError(o)&&e)break;i.push(o)}return i},c.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},c.prototype._decodeObjid=function(t,e,r){let n;const i=[];let o=0,s=0;for(;!t.isEmpty();)s=t.readUInt8(),o<<=7,o|=127&s,0==(128&s)&&(i.push(o),o=0);128&s&&i.push(o);const a=i[0]/40|0,u=i[0]%40;if(n=r?i:[a,u].concat(i.slice(1)),e){let t=e[n.join(" ")];void 0===t&&(t=e[n.join(".")]),void 0!==t&&(n=t)}return n},c.prototype._decodeTime=function(t,e){const r=t.raw().toString();let n,i,o,s,a,u;if("gentime"===e)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,u,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},c.prototype._decodeInt=function(t,e){const r=t.raw();let n=new i(r);return e&&(n=e[n.toString(10)]||n),n},c.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},8538:(t,e,r)=>{"use strict";const n=e;n.der=r(7469),n.pem=r(7810)},7810:(t,e,r)=>{"use strict";const n=r(8575),i=r(4563).Buffer,o=r(7469);function s(t){o.call(this,t),this.enc="pem"}n(s,o),t.exports=s,s.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,u=-1;for(let t=0;t<r.length;t++){const e=r[t].match(s);if(null!==e&&e[2]===n){if(-1!==a){if("END"!==e[1])break;u=t;break}if("BEGIN"!==e[1])break;a=t}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+n);const c=r.slice(a+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const f=i.from(c,"base64");return o.prototype.decode.call(this,f,e)}},8694:(t,e,r)=>{"use strict";const n=r(8575),i=r(4563).Buffer,o=r(5680),s=r(4873);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function c(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,o),u.prototype._encodeComposite=function(t,e,r,n){const o=function(t,e,r,n){let i;if("seqof"===t?t="seq":"setof"===t&&(t="set"),s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=s.tagClassByName[r||"universal"]<<6,i)}(t,e,r,this.reporter);if(n.length<128){const t=i.alloc(2);return t[0]=o,t[1]=n.length,this._createEncoderBuffer([t,n])}let a=1;for(let t=n.length;t>=256;t>>=8)a++;const u=i.alloc(2+a);u[0]=o,u[1]=128|a;for(let t=1+a,e=n.length;e>0;t--,e>>=8)u[t]=255&e;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=i.alloc(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let n=0;for(let e=0;e<t.length;e++){let r=t[e];for(n++;r>=128;r>>=7)n++}const o=i.alloc(n);let s=o.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(o[s--]=127&r;(r>>=7)>0;)o[s--]=128|127&r}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(t,e){let r;const n=new Date(t);return"gentime"===e?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=i.from(e)}if(i.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=i.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const n=new Array(r);for(let e=n.length-1;e>=0;e--)n[e]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},2212:(t,e,r)=>{"use strict";const n=e;n.der=r(8694),n.pem=r(7859)},7859:(t,e,r)=>{"use strict";const n=r(8575),i=r(8694);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){const r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"];for(let t=0;t<r.length;t+=64)n.push(r.slice(t,t+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},138:function(t){t.exports=function(){"use strict";class t{constructor(){this._id=null,this._delay=null}get id(){return this._id}get delay(){return this._delay}set(t,e=""){return new Promise(((r,n)=>{this.clear();const i=e?()=>{return n("string"==typeof(t="function"==typeof(t=e)?t():t)?new Error(t):t);var t}:r;this._id=setTimeout(i,t),this._delay=t}))}wrap(t,e,r=""){const n=function(t,e){return Promise.resolve(t).then((t=>(e(),t)),(t=>(e(),Promise.reject(t))))}(t,(()=>this.clear())),i=this.set(e,r);return Promise.race([n,i])}clear(){this._id&&clearTimeout(this._id)}}return t.set=function(e,r){return(new t).set(e,r)},t.wrap=function(e,r,n){return(new t).wrap(e,r,n)},t}()},5155:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;a<u;a+=s)o.push(c(t,a,a+s>u?u:a+s));return 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]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function u(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 c(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3863:t=>{"use strict";for(var e="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<e.length;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;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=o(e)^n>>5}for(e=o(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=o(e)^31&i}return e}function a(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)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 f=s(u);if("string"==typeof f)return f;for(var l=[],h=0;h<c.length;++h){var d=c.charAt(h),p=r[d];if(void 0===p)return"Unknown character "+d;f=o(f)^p,h+6>=c.length||l.push(p)}return 1!==f?"Invalid checksum for "+t:{prefix:u,words:l}}function u(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<t.length;++u)for(i=i<<e|t[u],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}t.exports={decodeUnsafe:function(){var t=a.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=a.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)},encode:function(t,r,n){if(n=n||90,t.length+7+r.length>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<r.length;++u){var c=r[u];if(c>>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)}}},9611: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(6601).Buffer}catch(t){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=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<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=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,f=r;f<a;f+=n)c=u(t,f,f+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var l=1;for(c=u(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>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=f[t],d=l[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),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[o-a-1]=s}return c},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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,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<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 g={k256:null,p224:null,p192:null,p25519:null};function b(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 y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(y,b),y.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,b),i(w,b),i(_,b),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=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 y;else if("p224"===t)e=new v;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(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)},5060:(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;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(9214);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},701:(t,e,r)=>{var n=r(7512).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,u,c=r[0],f=r[1],l=r[2],h=r[3],d=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],b=4,y=1;y<i;y++)o=c[d>>>24]^f[p>>>16&255]^l[m>>>8&255]^h[255&g]^e[b++],s=c[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^h[255&d]^e[b++],a=c[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^h[255&p]^e[b++],u=c[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&m]^e[b++],d=o,p=s,m=a,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^e[b++],s=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^e[b++],a=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[b++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[b++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^255&c^99,r[s]=c,n[c]=s;var f=t[s],l=t[f],h=t[l],d=257*t[c]^16843008*c;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*h^65537*l^257*f^16843008*s,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===s?s=a=1:(s=f^t[t[t[h^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(t){this._key=i(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-e]^s}for(var c=[],f=0;f<n;f++){var l=n-f,h=i[l-(f%4?0:4)];c[f]=f<4||l<=4?h:u.INV_SUB_MIX[0][u.SBOX[h>>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},c.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=c},5271:(t,e,r)=>{var n=r(701),i=r(7512).Buffer,o=r(7154),s=r(8575),a=r(8082),u=r(745),c=r(3617);function f(t,e,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var f=this._cipher.encryptBlock(u);this._ghash=new a(f),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,f=i.alloc(8);f.writeUIntBE(u,0,8),n.update(f),t._finID=n.state;var l=i.from(t._finID);return c(l),l}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},f.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=f},1721:(t,e,r)=>{var n=r(1890),i=r(4060),o=r(4946);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},4060:(t,e,r)=>{var n=r(5271),i=r(7512).Buffer,o=r(8977),s=r(6263),a=r(7154),u=r(701),c=r(9366);function f(t,e,r){a.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function h(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new f(a.module,e,r)}r(8575)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=i.concat([this.cache,t])},l.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(e,!1,r.key,r.iv);return h(t,n.key,n.iv)},e.createDecipheriv=h},1890:(t,e,r)=>{var n=r(8977),i=r(5271),o=r(7512).Buffer,s=r(6263),a=r(7154),u=r(701),c=r(9366);function f(t,e,r){a.call(this),this._cache=new h,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(8575)(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new f(a.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=o.concat([this.cache,t])},h.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},h.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},8082:(t,e,r)=>{var n=r(7512).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},3617:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},6710:(t,e,r)=>{var n=r(745);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},9236:(t,e,r)=>{var n=r(7512).Buffer,i=r(745);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},8008:(t,e,r)=>{var n=r(7512).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},5531:(t,e,r)=>{var n=r(7512).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},9108:(t,e,r)=>{var n=r(745),i=r(7512).Buffer,o=r(3617);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(t),c=o+16*a;t._cache.writeUInt32BE(u[0],c+0),t._cache.writeUInt32BE(u[1],c+4),t._cache.writeUInt32BE(u[2],c+8),t._cache.writeUInt32BE(u[3],c+12)}var f=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,f)}},3408:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},8977:(t,e,r)=>{var n={ECB:r(3408),CBC:r(6710),CFB:r(9236),CFB8:r(5531),CFB1:r(8008),OFB:r(5194),CTR:r(9108),GCM:r(9108)},i=r(4946);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},5194:(t,e,r)=>{var n=r(2486).Buffer,i=r(745);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=n.concat([t._cache,o(t)]);var r=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,r)}},6263:(t,e,r)=>{var n=r(701),i=r(7512).Buffer,o=r(7154);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(8575)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},4375:(t,e,r)=>{var n=r(9865),i=r(1721),o=r(8977),s=r(7756),a=r(9366);function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function c(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},e.createCipheriv=e.Cipheriv=u,e.createDecipher=e.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return c(t,i.key,i.iv)},e.createDecipheriv=e.Decipheriv=c,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},9865:(t,e,r)=>{var n=r(7154),i=r(3655),o=r(8575),s=r(7512).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=u,o(u,n),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},7756:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},2657:(t,e,r)=>{var n=r(2486).Buffer,i=r(3449),o=r(3313);function s(t){var e,r=t.modulus.byteLength();do{e=new i(o(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,e){var r=function(t){var e=s(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=new i(t).mul(r.blinder).umod(e.modulus),u=a.toRed(i.mont(e.prime1)),c=a.toRed(i.mont(e.prime2)),f=e.coefficient,l=e.prime1,h=e.prime2,d=u.redPow(e.exponent1).fromRed(),p=c.redPow(e.exponent2).fromRed(),m=d.isub(p).imul(f).umod(l).imul(h);return p.iadd(m).imul(r.unblinder).umod(e.modulus).toArrayLike(n,"be",o)}a.getr=s,t.exports=a},3449: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(1922).Buffer}catch(t){}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<a;u++){var c=t.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function f(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(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<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=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,f=r;f<a;f+=n)u=c(t,f,f+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){f(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&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")]=l}catch(t){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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];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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?h[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=d[t],f=p[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(f).toString(t);r=(l=l.idivn(f)).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)},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<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,0!==c&&(u[19]=c,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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 y(t,e,r){return b(t,e,r)}function v(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?b(this,t,e):y(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 x(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 A(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(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 k(t){x.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?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(A,_),A.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(E,_),i(S,_),i(M,_),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=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 A;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.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")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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)},k.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)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},7992:(t,e,r)=>{t.exports=r(5207)},3461:(t,e,r)=>{var n=r(7512).Buffer,i=r(1667),o=r(8104),s=r(8575),a=r(7e3),u=r(6806),c=r(5207);function f(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function d(t){return new l(t)}Object.keys(c).forEach((function(t){c[t].id=n.from(c[t].id,"hex"),c[t.toLowerCase()]=c[t]})),s(f,o.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},s(l,o.Writable),l.prototype._write=function(t,e,r){this._hash.update(t),r()},l.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},l.prototype.verify=function(t,e,r){"string"==typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return u(e,i,t,this._signType,this._tag)},t.exports={Sign:h,Verify:d,createSign:h,createVerify:d}},7e3:(t,e,r)=>{var n=r(7512).Buffer,i=r(9632),o=r(2657),s=r(4231).ec,a=r(2163),u=r(6581),c=r(1308);function f(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var s=n.alloc(e.byteLength()-t.length);t=n.concat([s,t])}var a=r.length,u=function(t,e){t=(t=l(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),c=n.alloc(a);c.fill(1);var f=n.alloc(a);return f=i(o,f).update(c).update(n.from([0])).update(t).update(u).digest(),c=i(o,f).update(c).digest(),{k:f=i(o,f).update(c).update(n.from([1])).update(t).update(u).digest(),v:c=i(o,f).update(c).digest()}}function l(t,e){var r=new a(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function h(t,e,r){var o,s;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);s=l(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,n){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(n)}t.exports=function(t,e,r,i,p){var m=u(e);if(m.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=c[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new s(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){for(var i,o=e.params.priv_key,s=e.params.p,u=e.params.q,c=e.params.g,p=new a(0),m=l(t,u).mod(u),g=!1,b=f(o,u,t,r);!1===g;)p=d(c,i=h(u,b,r),s,u),0===(g=i.invm(u).imul(m.add(o.mul(p))).mod(u)).cmpn(0)&&(g=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(p,g)}(t,m,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([p,t]);for(var g=m.modulus.byteLength(),b=[0,1];t.length+b.length+1<g;)b.push(255);b.push(0);for(var y=-1;++y<t.length;)b.push(t[y]);return o(b,m)},t.exports.getKey=f,t.exports.makeKey=h},6806:(t,e,r)=>{var n=r(7512).Buffer,i=r(2163),o=r(4231).ec,s=r(6581),a=r(1308);function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,c,f){var l=s(r);if("ec"===l.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}(t,e,l)}if("dsa"===l.type){if("dsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,a=r.data.g,c=r.data.pub_key,f=s.signature.decode(t,"der"),l=f.s,h=f.r;u(l,o),u(h,o);var d=i.mont(n),p=l.invm(o);return 0===a.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(c.toRed(d).redPow(h.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(t,e,l)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");e=n.concat([f,e]);for(var h=l.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<h;)d.push(255),p++;d.push(0);for(var m=-1;++m<e.length;)d.push(e[m]);d=n.from(d);var g=i.mont(l.modulus);t=(t=new i(t).toRed(g)).redPow(new i(l.publicExponent)),t=n.from(t.fromRed().toArray());var b=p<8?1:0;for(h=Math.min(t.length,d.length),t.length!==d.length&&(b=1),m=-1;++m<h;)b|=t[m]^d[m];return 0===b}},2163: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(2363).Buffer}catch(t){}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<a;u++){var c=t.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function f(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(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<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=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,f=r;f<a;f+=n)u=c(t,f,f+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){f(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&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")]=l}catch(t){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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];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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?h[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=d[t],f=p[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modrn(f).toString(t);r=(l=l.idivn(f)).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)},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<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,0!==c&&(u[19]=c,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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 y(t,e,r){return b(t,e,r)}function v(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?b(this,t,e):y(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 x(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 A(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(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 k(t){x.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?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(A,_),A.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(E,_),i(S,_),i(M,_),M.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=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 A;else if("p224"===t)e=new E;else if("p192"===t)e=new S;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return w[t]=e,e},x.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},x.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")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},x.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},x.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},x.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},x.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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)},k.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)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},745:(t,e,r)=>{var n=r(2486).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o<r;++o)i[o]=t[o]^e[o];return i}},2486:(t,e,r)=>{"use strict";const n=r(5155),i=r(4525),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const 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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|m(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const 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(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(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');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(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 f(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 l(t){return f(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=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)||X(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);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(i)return n?-1:W(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let 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 C(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function y(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),Y(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:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let 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){let n=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Y(n))return s;t[r+s]=n}return s}function _(t,e,r,n){return $(W(e,t.length-r),t,r,n)}function A(t,e,r,n){return $(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return $(V(e),t,r,n)}function S(t,e,r,n){return $(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return l(t)},u.allocUnsafeSlow=function(t){return l(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(X(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),X(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(X(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(X(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;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),c=this.slice(n,i),f=t.slice(e,r);for(let t=0;t<a;++t)if(c[t]!==f[t]){o=c[t],s=f[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const 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");let o=!1;for(;;)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 A(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(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)}};const k=4096;function T(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=J[t[n]];return i}function R(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function B(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function P(t,e,r,n,i){z(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function D(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 L(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const 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<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(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||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||B(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||B(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||B(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||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=Z((function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||K(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(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||N(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(this,t,e,r,Math.pow(2,8*r)-1,0);let 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||N(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||N(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||N(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||N(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||N(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.writeBigUInt64LE=Z((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Z((function(t,e=0){return P(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||N(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||N(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||N(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||N(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||N(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.writeBigInt64LE=Z((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Z((function(t,e=0){return P(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return U(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<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const j={};function F(t,e,r){j[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function q(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function z(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||K(e,t.length-(r+1))}(n,i,o)}function H(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function K(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function W(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&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 V(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Z(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},4768: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"}},7154:(t,e,r)=>{var n=r(7512).Buffer,i=r(202).Transform,o=r(301).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(8575)(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(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}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},1069:t=>{function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<n.length;i++)if((r=n[i])===e||r.fn===e){n.splice(i,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}},7447:(t,e,r)=>{"use strict";var n=r(2817),i={"text/plain":"Text","text/html":"Url",default:"Text"};t.exports=function(t,e){var r,o,s,a,u,c,f=!1;e||(e={}),r=e.debug||!1;try{if(s=n(),a=document.createRange(),u=document.getSelection(),(c=document.createElement("span")).textContent=t,c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(n){if(n.stopPropagation(),e.format)if(n.preventDefault(),void 0===n.clipboardData){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[e.format]||i.default;window.clipboardData.setData(o,t)}else n.clipboardData.clearData(),n.clipboardData.setData(e.format,t);e.onCopy&&(n.preventDefault(),e.onCopy(n.clipboardData))})),document.body.appendChild(c),a.selectNodeContents(c),u.addRange(a),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");f=!0}catch(n){r&&console.error("unable to copy using execCommand: ",n),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),f=!0}catch(n){r&&console.error("unable to copy using clipboardData: ",n),r&&console.error("falling back to prompt"),o=function(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}("message"in e?e.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,t)}}finally{u&&("function"==typeof u.removeRange?u.removeRange(a):u.removeAllRanges()),c&&document.body.removeChild(c),s()}return f}},9266:(t,e,r)=>{var n=r(2486).Buffer,i=r(4231),o=r(9611);t.exports=function(t){return new a(t)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function u(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new n(t);if(r&&i.length<r){var o=new n(r-i.length);o.fill(0),i=n.concat([o,i])}return e?i.toString(e):i}s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,a.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},a.prototype.computeSecret=function(t,e,r){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),u(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},a.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),u(r,t)},a.prototype.getPrivateKey=function(t){return u(this.keys.getPrivate(),t)},a.prototype.setPublicKey=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.keys._importPublic(t),this},a.prototype.setPrivateKey=function(t,e){e=e||"utf8",n.isBuffer(t)||(t=new n(t,e));var r=new o(t);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},1667:(t,e,r)=>{"use strict";var n=r(8575),i=r(1141),o=r(5991),s=r(1396),a=r(7154);function u(t){a.call(this,"digest"),this._hash=t}n(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},4781:(t,e,r)=>{var n=r(1141);t.exports=function(t){return(new n).update(t).digest()}},9632:(t,e,r)=>{"use strict";var n=r(8575),i=r(6468),o=r(7154),s=r(7512).Buffer,a=r(4781),u=r(5991),c=r(1396),f=s.alloc(128);function l(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new u:c(t)).update(e).digest():e.length<r&&(e=s.concat([e,f],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new u:c(t),this._hash.update(n)}n(l,o),l.prototype._update=function(t){this._hash.update(t)},l.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new l("rmd160",e):"md5"===t?new i(a,e):new l(t,e)}},6468:(t,e,r)=>{"use strict";var n=r(8575),i=r(7512).Buffer,o=r(7154),s=i.alloc(128),a=64;function u(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=i.concat([e,s],a));for(var r=this._ipad=i.allocUnsafe(a),n=this._opad=i.allocUnsafe(a),u=0;u<a;u++)r[u]=54^e[u],n[u]=92^e[u];this._hash=[r]}n(u,o),u.prototype._update=function(t){this._hash.push(t)},u.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=u},9842:(t,e,r)=>{"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(3313),e.createHash=e.Hash=r(1667),e.createHmac=e.Hmac=r(9632);var n=r(7992),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var s=r(4222);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var a=r(4375);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var u=r(1535);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var c=r(3461);e.createSign=c.createSign,e.Sign=c.Sign,e.createVerify=c.createVerify,e.Verify=c.Verify,e.createECDH=r(9266);var f=r(9475);e.publicEncrypt=f.publicEncrypt,e.privateEncrypt=f.privateEncrypt,e.publicDecrypt=f.publicDecrypt,e.privateDecrypt=f.privateDecrypt;var l=r(6451);e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},3947:t=>{"use strict";var e="%[a-f0-9]{2}",r=new RegExp(e,"gi"),n=new RegExp("("+e+")+","gi");function i(t,e){try{return decodeURIComponent(t.join(""))}catch(t){}if(1===t.length)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],i(r),i(n))}function o(t){try{return decodeURIComponent(t)}catch(o){for(var e=t.match(r),n=1;n<e.length;n++)e=(t=i(e,n).join("")).match(r);return t}}t.exports=function(t){if("string"!=typeof t)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch(e){return function(t){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=n.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch(t){var i=o(r[0]);i!==r[0]&&(e[r[0]]=i)}r=n.exec(t)}e["%C2"]="�";for(var s=Object.keys(e),a=0;a<s.length;a++){var u=s[a];t=t.replace(new RegExp(u,"g"),e[u])}return t}(t)}}},3655:(t,e,r)=>{"use strict";e.utils=r(8227),e.Cipher=r(1303),e.DES=r(9941),e.CBC=r(8720),e.EDE=r(4877)},8720:(t,e,r)=>{"use strict";var n=r(5997),i=r(8575),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];for(o._update.call(this,s,0,r,n),a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{for(o._update.call(this,t,e,r,n),a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},1303:(t,e,r)=>{"use strict";var n=r(5997);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},9941:(t,e,r)=>{"use strict";var n=r(5997),i=r(8575),o=r(8227),s=r(1303);function a(){this.tmp=new Array(2),this.keys=null}function u(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(u,s),t.exports=u,u.create=function(t){return new u(t)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=c[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},u.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},u.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},u.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,u=0;u<t.keys.length;u+=2){var c=t.keys[u],f=t.keys[u+1];o.expand(a,t.tmp,0),c^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(c,f),h=a;a=(s^o.permute(l))>>>0,s=h}o.rip(a,s,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],f=t.keys[u+1];o.expand(s,t.tmp,0),c^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(c,f),h=s;s=(a^o.permute(l))>>>0,a=h}o.rip(s,a,n,i)}},4877:(t,e,r)=>{"use strict";var n=r(5997),i=r(8575),o=r(1303),s=r(9941);function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},8227:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,s=0,a=r.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>r[u]&1;for(u=a;u<r.length;u++)s<<=1,s|=e>>>r[u]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(t>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<i.length;r++)e<<=1,e|=t>>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},1535:(t,e,r)=>{var n=r(2486).Buffer,i=r(883),o=r(9799),s=r(8461),a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new n(o[t].prime,"hex"),r=new n(o[t].gen,"hex");return new s(e,r)},e.createDiffieHellman=e.DiffieHellman=function t(e,r,o,u){return n.isBuffer(r)||void 0===a[r]?t(e,"binary",r,o):(r=r||"binary",u=u||"binary",o=o||new n([2]),n.isBuffer(o)||(o=new n(o,u)),"number"==typeof e?new s(i(e,o),o,!0):(n.isBuffer(e)||(e=new n(e,r)),new s(e,o,!0)))}},8461:(t,e,r)=>{var n=r(2486).Buffer,i=r(9611),o=new(r(3758)),s=new i(24),a=new i(11),u=new i(10),c=new i(3),f=new i(7),l=r(883),h=r(3313);function d(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._pub=new i(t),this}function p(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._priv=new i(t),this}t.exports=g;var m={};function g(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}function b(t,e){var r=new n(t.toArray());return e?r.toString(e):r}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in m)return m[n];var i,h=0;if(t.isEven()||!l.simpleSieve||!l.fermatTest(t)||!o.test(t))return h+=1,h+="02"===r||"05"===r?8:4,m[n]=h,h;switch(o.test(t.shrn(1))||(h+=2),r){case"02":t.mod(s).cmp(a)&&(h+=8);break;case"05":(i=t.mod(u)).cmp(c)&&i.cmp(f)&&(h+=8);break;default:h+=4}return m[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new i(h(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var e=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new n(e.toArray()),o=this.getPrime();if(r.length<o.length){var s=new n(o.length-r.length);s.fill(0),r=n.concat([s,r])}return r},g.prototype.getPublicKey=function(t){return b(this._pub,t)},g.prototype.getPrivateKey=function(t){return b(this._priv,t)},g.prototype.getPrime=function(t){return b(this.__prime,t)},g.prototype.getGenerator=function(t){return b(this._gen,t)},g.prototype.setGenerator=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.__gen=t,this._gen=new i(t),this}},883:(t,e,r)=>{var n=r(3313);t.exports=y,y.simpleSieve=g,y.fermatTest=b;var i=r(9611),o=new i(24),s=new(r(3758)),a=new i(1),u=new i(2),c=new i(5),f=(new i(16),new i(8),new i(10)),l=new i(3),h=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function m(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}function g(t){for(var e=m(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function b(t){var e=i.mont(t);return 0===u.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function y(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(h);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&b(p)&&b(r)&&s.test(p)&&s.test(r))return r}}},9687:t=>{"use strict";var e={single_source_shortest_paths:function(t,r,n){var i={},o={};o[r]=0;var s,a,u,c,f,l,h,d=e.PriorityQueue.make();for(d.push(r,0);!d.empty();)for(u in a=(s=d.pop()).value,c=s.cost,f=t[a]||{})f.hasOwnProperty(u)&&(l=c+f[u],h=o[u],(void 0===o[u]||h>l)&&(o[u]=l,d.push(u,l),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},4231:(t,e,r)=>{"use strict";var n=e;n.version=r(8597).i8,n.utils=r(9995),n.rand=r(5060),n.curve=r(4204),n.curves=r(1704),n.ec=r(7079),n.eddsa=r(9245)},3404:(t,e,r)=>{"use strict";var n=r(1406),i=r(9995),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<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,c=[];for(s=0;s<n.length;s+=r.step){u=0;for(var f=s+r.step-1;f>=s;f--)u=(u<<1)+n[f];c.push(u)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<c.length;s++)(u=c[s])===d?h=h.mixedAdd(r.points[s]):u===-d&&(h=h.mixedAdd(r.points[s].neg()));l=l.add(h)}return l.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(var f=0;c>=0&&0===s[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var l=s[c];a(0!==l),u="affine"===t.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,c,f=this._wnafT1,l=this._wnafT2,h=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(c=e[a])._getNAFPoints(t);f[a]=p.wnd,l[a]=p.points}for(a=n-1;a>=1;a-=2){var m=a-1,g=a;if(1===f[m]&&1===f[g]){var b=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(b[1]=e[m].add(e[g]),b[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(b[1]=e[m].toJ().mixedAdd(e[g]),b[2]=e[m].add(e[g].neg())):(b[1]=e[m].toJ().mixedAdd(e[g]),b[2]=e[m].toJ().mixedAdd(e[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[m],r[g]);for(d=Math.max(v[0].length,d),h[m]=new Array(d),h[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],_=0|v[1][u];h[m][u]=y[3*(w+1)+(_+1)],h[g][u]=0,l[m]=b}}else h[m]=o(r[m],f[m],this._bitLength),h[g]=o(r[g],f[g],this._bitLength),d=Math.max(h[m].length,d),d=Math.max(h[g].length,d)}var A=this.jpoint(null,null,null),E=this._wnafT4;for(a=d;a>=0;a--){for(var S=0;a>=0;){var M=!0;for(u=0;u<n;u++)E[u]=0|h[u][a],0!==E[u]&&(M=!1);if(!M)break;S++,a--}if(a>=0&&S++,A=A.dblp(S),a<0)break;for(u=0;u<n;u++){var x=E[u];0!==x&&(x>0?c=l[u][x-1>>1]:x<0&&(c=l[u][-x-1>>1].neg()),A="affine"===c.type?A.mixedAdd(c):A.add(c))}}for(a=0;a<n;a++)l[a]=null;return i?A:A.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=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<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},2411:(t,e,r)=>{"use strict";var n=r(9995),i=r(1406),o=r(8575),s=r(3404),a=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function c(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(c,s.BasePoint),u.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new c(this,t,e,r,n)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},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),f=i.redMul(a),l=s.redMul(o);return this.curve.point(u,c,l,f)},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),f=a.redMul(u),l=o.redMul(u),h=s.redMul(a);return this.curve.point(c,f,h,l)},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),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),l=n.redMul(u).redMul(f);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(l,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},4204:(t,e,r)=>{"use strict";var n=e;n.base=r(3404),n.short=r(6931),n.mont=r(6972),n.edwards=r(2411)},6972:(t,e,r)=>{"use strict";var n=r(1406),i=r(8575),o=r(3404),s=r(9995);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()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},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()}},6931:(t,e,r)=>{"use strict";var n=r(9995),i=r(1406),o=r(8575),s=r(3404),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 f(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,f,l=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),b=new i(1),y=0;0!==h.cmpn(0);){var v=d.div(h);c=d.sub(v.mul(h)),f=g.sub(v.mul(p));var w=b.sub(v.mul(m));if(!n&&c.cmp(l)<0)e=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++y)break;u=c,d=h,h=c,g=p,p=f,b=m,m=w}s=c.neg(),a=f;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<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},o(c,s.BasePoint),u.prototype.point=function(t,e,r){return new c(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return c.fromJSON(this,t,e)},c.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},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(f,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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(),f=c.redMul(a),l=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},f.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),f=r.redMul(u),l=a.redSqr().redIAdd(c).redISub(f).redISub(f),h=a.redMul(f.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(l,h,d)},f.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<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(e=0;e<t;e++){var f=o.redSqr(),l=c.redSqr(),h=l.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(l),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),b=d.redMul(g);b=b.redIAdd(b).redISub(h);var y=c.redMul(a);e+1<t&&(u=u.redMul(h)),o=m,a=y,c=b}return this.curve.jpoint(o,c.redMul(i),a)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=u,e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(f).redISub(h);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},f.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),h=this.x.redMul(l),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},f.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),c=(u=u.redIAdd(u)).redMul(s),f=a.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=a.redMul(l).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,d,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),f=e.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(a).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,h,d)},f.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},f.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1704:(t,e,r)=>{"use strict";var n,i=e,o=r(927),s=r(4204),a=r(9995).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(3214)}catch(t){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]})},7079:(t,e,r)=>{"use strict";var n=r(1406),i=r(5662),o=r(9995),s=r(1704),a=r(5060),u=o.assert,c=r(4729),f=r(8378);function l(t){if(!(this instanceof l))return new l(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=l,l.prototype.keyPair=function(t){return new c(this,t)},l.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},l.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)}},l.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},l.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"}),l=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(l)>=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 b=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),y^=1),new f({r:g,s:b,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new f(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),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new f(e,i);var o=this.n,s=new n(t),a=e.r,c=e.s,l=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),l):this.curve.pointFromX(a,l);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)},l.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(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")}},4729:(t,e,r)=>{"use strict";var n=r(1406),i=r(9995).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"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},8378:(t,e,r)=>{"use strict";var n=r(1406),i=r(9995),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<n;o++,s++)i<<=8,i|=t[s],i>>>=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<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>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 f=u(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var l=t.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),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];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),s=[48];return f(s,o.length),s=s.concat(o),i.encode(s,t)}},9245:(t,e,r)=>{"use strict";var n=r(927),i=r(1704),o=r(9995),s=o.assert,a=o.parseBytes,u=r(3380),c=r(8787);function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(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=f,f.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})},f.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)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},f.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},f.prototype.makeSignature=function(t){return t instanceof c?t:new c(this,t)},f.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},f.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(t){return o.intFromLE(t)},f.prototype.isPoint=function(t){return t instanceof this.pointClass}},3380:(t,e,r)=>{"use strict";var n=r(9995),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},8787:(t,e,r)=>{"use strict";var n=r(1406),i=r(9995),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},3214:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},9995:(t,e,r)=>{"use strict";var n=e,i=r(1406),o=r(5997),s=r(5526);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(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")}},1406: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(5568).Buffer}catch(t){}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<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=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<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=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,f=r;f<a;f+=n)u=c(t,f,f+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=c(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","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],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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?f[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=l[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:f[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),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[o-a-1]=s}return c},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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,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<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 E(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 b={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 w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(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){E.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():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<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(_,y),i(A,y),A.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;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 A}return b[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.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")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.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)},E.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},E.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)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,E),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)},3825:(t,e,r)=>{"use strict";r.r(e),r.d(e,{BaseContract:()=>Nn,BigNumber:()=>V,Contract:()=>On,ContractFactory:()=>Pn,FixedNumber:()=>Wn,Signer:()=>ar,VoidSigner:()=>ur,Wallet:()=>wo,Wordlist:()=>Ai,constants:()=>i,errors:()=>g,ethers:()=>u,getDefaultProvider:()=>ru,logger:()=>_u,providers:()=>o,utils:()=>a,version:()=>wu,wordlists:()=>xi});var n={};r.r(n),r.d(n,{decode:()=>Mt,encode:()=>At});var i={};r.r(i),r.d(i,{AddressZero:()=>Eo,EtherSymbol:()=>Mo,HashZero:()=>So,MaxInt256:()=>pe,MaxUint256:()=>he,MinInt256:()=>de,NegativeOne:()=>ae,One:()=>ce,Two:()=>fe,WeiPerEther:()=>le,Zero:()=>ue});var o={};r.r(o),r.d(o,{AlchemyProvider:()=>ca,AlchemyWebSocketProvider:()=>ua,AnkrProvider:()=>da,BaseProvider:()=>Us,CloudflareProvider:()=>ma,EtherscanProvider:()=>Sa,FallbackProvider:()=>ja,Formatter:()=>fs,InfuraProvider:()=>Ka,InfuraWebSocketProvider:()=>Ha,IpcProvider:()=>Fa,JsonRpcBatchProvider:()=>Ga,JsonRpcProvider:()=>Js,JsonRpcSigner:()=>$s,NodesmithProvider:()=>Va,PocketProvider:()=>Ya,Provider:()=>rr,Resolver:()=>Ps,StaticJsonRpcProvider:()=>ia,UrlJsonRpcProvider:()=>oa,Web3Provider:()=>tu,WebSocketProvider:()=>ra,getDefaultProvider:()=>ru,getNetwork:()=>No,isCommunityResourcable:()=>ls,isCommunityResource:()=>hs,showThrottleMessage:()=>ps});var s={};r.r(s),r.d(s,{decode:()=>Jo,encode:()=>Zo});var a={};r.r(a),r.d(a,{AbiCoder:()=>Ke,ConstructorFragment:()=>Ne,ErrorFragment:()=>De,EventFragment:()=>Ie,FormatTypes:()=>Se,Fragment:()=>Te,FunctionFragment:()=>Oe,HDNode:()=>Li,Indexed:()=>Ye,Interface:()=>Qe,LogDescription:()=>Ve,Logger:()=>y,ParamType:()=>xe,RLP:()=>n,SigningKey:()=>Zr,SupportedAlgorithm:()=>pi,TransactionDescription:()=>$e,TransactionTypes:()=>rn,UnicodeNormalizationForm:()=>Ut,Utf8ErrorFuncs:()=>qt,Utf8ErrorReason:()=>jt,_TypedDataEncoder:()=>li,_fetchData:()=>ns,_toEscapedUtf8String:()=>Gt,accessListify:()=>hn,arrayify:()=>M,base58:()=>di,base64:()=>s,checkProperties:()=>rt,checkResultErrors:()=>lt,commify:()=>mu,computeAddress:()=>un,computeHmac:()=>vi,computePublicKey:()=>tn,concat:()=>x,deepCopy:()=>at,defaultAbiCoder:()=>Ge,defaultPath:()=>Di,defineReadOnly:()=>Q,dnsEncode:()=>Yo,entropyToMnemonic:()=>Fi,fetchJson:()=>is,formatBytes32String:()=>lu,formatEther:()=>yu,formatUnits:()=>gu,getAccountPath:()=>zi,getAddress:()=>Bt,getContractAddress:()=>Pt,getCreate2Address:()=>Dt,getIcapAddress:()=>Ot,getJsonWalletAddress:()=>so,getStatic:()=>tt,hashMessage:()=>Xn,hexConcat:()=>O,hexDataLength:()=>B,hexDataSlice:()=>N,hexStripZeros:()=>D,hexValue:()=>P,hexZeroPad:()=>L,hexlify:()=>R,id:()=>Xt,isAddress:()=>Nt,isBytes:()=>S,isBytesLike:()=>A,isHexString:()=>I,isValidMnemonic:()=>qi,isValidName:()=>$o,joinSignature:()=>j,keccak256:()=>bt,mnemonicToEntropy:()=>ji,mnemonicToSeed:()=>Ui,namehash:()=>Xo,nameprep:()=>Ko,parseBytes32String:()=>hu,parseEther:()=>vu,parseTransaction:()=>yn,parseUnits:()=>bu,poll:()=>os,randomBytes:()=>Wi,recoverAddress:()=>cn,recoverPublicKey:()=>Qr,resolveProperties:()=>et,ripemd160:()=>gi,serializeTransaction:()=>gn,sha256:()=>bi,sha512:()=>yi,shallowCopy:()=>nt,shuffled:()=>Ma,solidityKeccak256:()=>cu,solidityPack:()=>uu,soliditySha256:()=>fu,splitSignature:()=>U,stripZeros:()=>k,toUtf8Bytes:()=>Ht,toUtf8CodePoints:()=>$t,toUtf8String:()=>Vt,verifyMessage:()=>_o,verifyTypedData:()=>Ao,zeroPad:()=>T});var u={};r.r(u),r.d(u,{BaseContract:()=>Nn,BigNumber:()=>V,Contract:()=>On,ContractFactory:()=>Pn,FixedNumber:()=>Wn,Signer:()=>ar,VoidSigner:()=>ur,Wallet:()=>wo,Wordlist:()=>Ai,constants:()=>i,errors:()=>g,getDefaultProvider:()=>ru,logger:()=>_u,providers:()=>o,utils:()=>a,version:()=>wu,wordlists:()=>xi});let c=!1,f=!1;const l={debug:1,default:2,info:2,warning:3,error:4,off:5};let h=l.default,d=null;const p=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 m,g;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(m||(m={})),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"}(g||(g={}));const b="0123456789abcdef";class y{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const r=t.toLowerCase();null==l[r]&&this.throwArgumentError("invalid log level name","logLevel",t),h>l[r]||console.log.apply(console,e)}debug(...t){this._log(y.levels.DEBUG,t)}info(...t){this._log(y.levels.INFO,t)}warn(...t){this._log(y.levels.WARNING,t)}makeError(t,e,r){if(f)return this.makeError("censored error",e,{});e||(e=y.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<e.length;t++)r+=b[e[t]>>4],r+=b[15&e[t]];n.push(t+"=Uint8Array(0x"+r+")")}else n.push(t+"="+JSON.stringify(e))}catch(e){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 g.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 g.CALL_EXCEPTION:case g.INSUFFICIENT_FUNDS:case g.MISSING_NEW:case g.NONCE_EXPIRED:case g.REPLACEMENT_UNDERPRICED:case g.TRANSACTION_REPLACED:case g.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,y.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"),p&&this.throwError("platform missing String.prototype.normalize",y.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:p})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,y.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,y.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",t<e&&this.throwError("missing argument"+r,y.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+r,y.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){t!==Object&&null!=t||this.throwError("missing new",y.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",y.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",y.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return d||(d=new y("logger/5.6.0")),d}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",y.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),c){if(!t)return;this.globalLogger().throwError("error censorship permanent",y.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}f=!!t,c=!!e}static setLogLevel(t){const e=l[t.toLowerCase()];null!=e?h=e:y.globalLogger().warn("invalid log level - "+t)}static from(t){return new y(t)}}y.errors=g,y.levels=m;const v=new y("bytes/5.6.1");function w(t){return!!t.toHexString}function _(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return _(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function A(t){return I(t)&&!(t.length%2)||S(t)}function E(t){return"number"==typeof t&&t==t&&t%1==0}function S(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!E(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!E(r)||r<0||r>=256)return!1}return!0}function M(t,e){if(e||(e={}),"number"==typeof t){v.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),_(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),w(t)&&(t=t.toHexString()),I(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":v.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let t=0;t<r.length;t+=2)n.push(parseInt(r.substring(t,t+2),16));return _(new Uint8Array(n))}return S(t)?_(new Uint8Array(t)):v.throwArgumentError("invalid arrayify value","value",t)}function x(t){const e=t.map((t=>M(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),_(n)}function k(t){let e=M(t);if(0===e.length)return e;let r=0;for(;r<e.length&&0===e[r];)r++;return r&&(e=e.slice(r)),e}function T(t,e){(t=M(t)).length>e&&v.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),_(r)}function I(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const C="0123456789abcdef";function R(t,e){if(e||(e={}),"number"==typeof t){v.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=C[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),w(t))return t.toHexString();if(I(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":v.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(S(t)){let e="0x";for(let r=0;r<t.length;r++){let n=t[r];e+=C[(240&n)>>4]+C[15&n]}return e}return v.throwArgumentError("invalid hexlify value","value",t)}function B(t){if("string"!=typeof t)t=R(t);else if(!I(t)||t.length%2)return null;return(t.length-2)/2}function N(t,e,r){return"string"!=typeof t?t=R(t):(!I(t)||t.length%2)&&v.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function O(t){let e="0x";return t.forEach((t=>{e+=R(t).substring(2)})),e}function P(t){const e=D(R(t,{hexPad:"left"}));return"0x"===e?"0x0":e}function D(t){"string"!=typeof t&&(t=R(t)),I(t)||v.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e<t.length&&"0"===t[e];)e++;return"0x"+t.substring(e)}function L(t,e){for("string"!=typeof t?t=R(t):I(t)||v.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&v.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function U(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(A(t)){let r=M(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=R(r.slice(0,32)),e.s=R(r.slice(32,64))):65===r.length?(e.r=R(r.slice(0,32)),e.s=R(r.slice(32,64)),e.v=r[64]):v.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:v.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=R(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=T(M(e._vs),32);e._vs=R(r);const n=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=n:e.recoveryParam!==n&&v.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;const i=R(r);null==e.s?e.s=i:e.s!==i&&v.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?v.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&&v.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&I(e.r)?e.r=L(e.r,32):v.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&I(e.s)?e.s=L(e.s,32):v.throwArgumentError("signature missing or invalid s","signature",t);const r=M(e.s);r[0]>=128&&v.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=R(r);e._vs&&(I(e._vs)||v.throwArgumentError("signature invalid _vs","signature",t),e._vs=L(e._vs,32)),null==e._vs?e._vs=n:e._vs!==n&&v.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function j(t){return R(x([(t=U(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}var F=r(9847);const q="bignumber/5.6.0";var z=r.n(F)().BN;const H=new y(q),K={},G=9007199254740991;let W=!1;class V{constructor(t,e){H.checkNew(new.target,V),t!==K&&H.throwError("cannot call constructor directly; use BigNumber.from",y.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return X(Y(this).fromTwos(t))}toTwos(t){return X(Y(this).toTwos(t))}abs(){return"-"===this._hex[0]?V.from(this._hex.substring(1)):this}add(t){return X(Y(this).add(Y(t)))}sub(t){return X(Y(this).sub(Y(t)))}div(t){return V.from(t).isZero()&&J("division-by-zero","div"),X(Y(this).div(Y(t)))}mul(t){return X(Y(this).mul(Y(t)))}mod(t){const e=Y(t);return e.isNeg()&&J("division-by-zero","mod"),X(Y(this).umod(e))}pow(t){const e=Y(t);return e.isNeg()&&J("negative-power","pow"),X(Y(this).pow(e))}and(t){const e=Y(t);return(this.isNegative()||e.isNeg())&&J("unbound-bitwise-result","and"),X(Y(this).and(e))}or(t){const e=Y(t);return(this.isNegative()||e.isNeg())&&J("unbound-bitwise-result","or"),X(Y(this).or(e))}xor(t){const e=Y(t);return(this.isNegative()||e.isNeg())&&J("unbound-bitwise-result","xor"),X(Y(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&J("negative-width","mask"),X(Y(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&J("negative-width","shl"),X(Y(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&J("negative-width","shr"),X(Y(this).shrn(t))}eq(t){return Y(this).eq(Y(t))}lt(t){return Y(this).lt(Y(t))}lte(t){return Y(this).lte(Y(t))}gt(t){return Y(this).gt(Y(t))}gte(t){return Y(this).gte(Y(t))}isNegative(){return"-"===this._hex[0]}isZero(){return Y(this).isZero()}toNumber(){try{return Y(this).toNumber()}catch(t){J("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return H.throwError("this platform does not support BigInt",y.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?W||(W=!0,H.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?H.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",y.errors.UNEXPECTED_ARGUMENT,{}):H.throwError("BigNumber.toString does not accept parameters",y.errors.UNEXPECTED_ARGUMENT,{})),Y(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof V)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new V(K,$(t)):t.match(/^-?[0-9]+$/)?new V(K,$(new z(t))):H.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&J("underflow","BigNumber.from",t),(t>=G||t<=-G)&&J("overflow","BigNumber.from",t),V.from(String(t));const e=t;if("bigint"==typeof e)return V.from(e.toString());if(S(e))return V.from(R(e));if(e)if(e.toHexString){const t=e.toHexString();if("string"==typeof t)return V.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&(I(t)||"-"===t[0]&&I(t.substring(1))))return V.from(t)}return H.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function $(t){if("string"!=typeof t)return $(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&H.throwArgumentError("invalid hex","value",t),"0x00"===(t=$(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 X(t){return V.from($(t))}function Y(t){const e=V.from(t).toHexString();return"-"===e[0]?new z("-"+e.substring(3),16):new z(e.substring(2),16)}function J(t,e,r){const n={fault:t,operation:e};return null!=r&&(n.value=r),H.throwError(t,y.errors.NUMERIC_FAULT,n)}const Z=new y("properties/5.6.0");function Q(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function tt(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 et(t){return e=this,r=void 0,i=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)),{})},new((n=void 0)||(n=Promise))((function(t,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(s,a)}u((i=i.apply(e,r||[])).next())}));var e,r,n,i}function rt(t,e){t&&"object"==typeof t||Z.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||Z.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}function nt(t){const e={};for(const r in t)e[r]=t[r];return e}const it={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function ot(t){if(null==t||it[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;r<e.length;r++){let n=null;try{n=t[e[r]]}catch(t){continue}if(!ot(n))return!1}return!0}return Z.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function st(t){if(ot(t))return t;if(Array.isArray(t))return Object.freeze(t.map((t=>at(t))));if("object"==typeof t){const e={};for(const r in t){const n=t[r];void 0!==n&&Q(e,r,at(n))}return e}return Z.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}function at(t){return st(t)}class ut{constructor(t){for(const e in t)this[e]=at(t[e])}}const ct="abi/5.6.0",ft=new y(ct);function lt(t){const e=[],r=function(t,n){if(Array.isArray(n))for(let i in n){const o=t.slice();o.push(i);try{r(o,n[i])}catch(t){e.push({path:o,error:t})}}};return r([],t),e}class ht{constructor(t,e,r,n){this.name=t,this.type=e,this.localName=r,this.dynamic=n}_throwError(t,e){ft.throwArgumentError(t,this.localName,e)}}class dt{constructor(t){Q(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return O(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(x(t._data))}writeBytes(t){let e=M(t);const r=e.length%this.wordSize;return r&&(e=x([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=M(V.from(t));return e.length>this.wordSize&&ft.throwError("value out-of-bounds",y.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=x([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class pt{constructor(t,e,r,n){Q(this,"_data",M(t)),Q(this,"wordSize",e||32),Q(this,"_coerceFunc",r),Q(this,"allowLoose",n),this._offset=0}get data(){return R(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):pt.coerce(t,e)}_peekBytes(t,e,r){let n=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?n=e:ft.throwError("data out-of-bounds",y.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(t){return new pt(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return V.from(this.readBytes(this.wordSize))}}var mt=r(583),gt=r.n(mt);function bt(t){return"0x"+gt().keccak_256(M(t))}const yt=new y("rlp/5.6.0");function vt(t){const e=[];for(;t;)e.unshift(255&t),t>>=8;return e}function wt(t,e,r){let n=0;for(let i=0;i<r;i++)n=256*n+t[e+i];return n}function _t(t){if(Array.isArray(t)){let e=[];if(t.forEach((function(t){e=e.concat(_t(t))})),e.length<=55)return e.unshift(192+e.length),e;const r=vt(e.length);return r.unshift(247+r.length),r.concat(e)}A(t)||yt.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(M(t));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=vt(e.length);return r.unshift(183+r.length),r.concat(e)}function At(t){return R(_t(t))}function Et(t,e,r,n){const i=[];for(;r<e+1+n;){const o=St(t,r);i.push(o.result),(r+=o.consumed)>e+1+n&&yt.throwError("child data too short",y.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function St(t,e){if(0===t.length&&yt.throwError("data too short",y.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&yt.throwError("data short segment too short",y.errors.BUFFER_OVERRUN,{});const n=wt(t,e+1,r);return e+1+r+n>t.length&&yt.throwError("data long segment too short",y.errors.BUFFER_OVERRUN,{}),Et(t,e,e+1+r,r+n)}if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&yt.throwError("data array too short",y.errors.BUFFER_OVERRUN,{}),Et(t,e,e+1,r)}if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&yt.throwError("data array too short",y.errors.BUFFER_OVERRUN,{});const n=wt(t,e+1,r);return e+1+r+n>t.length&&yt.throwError("data array too short",y.errors.BUFFER_OVERRUN,{}),{consumed:1+r+n,result:R(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){const r=t[e]-128;return e+1+r>t.length&&yt.throwError("data too short",y.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:R(t.slice(e+1,e+1+r))}}return{consumed:1,result:R(t[e])}}function Mt(t){const e=M(t),r=St(e,0);return r.consumed!==e.length&&yt.throwArgumentError("invalid rlp data","data",t),r.result}const xt=new y("address/5.6.0");function kt(t){I(t,20)||xt.throwArgumentError("invalid address","address",t);const e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);const n=M(bt(r));for(let t=0;t<40;t+=2)n[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&n[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const Tt={};for(let t=0;t<10;t++)Tt[String(t)]=String(t);for(let t=0;t<26;t++)Tt[String.fromCharCode(65+t)]=String(10+t);const It=Math.floor((Ct=9007199254740991,Math.log10?Math.log10(Ct):Math.log(Ct)/Math.LN10));var Ct;function Rt(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>Tt[t])).join("");for(;e.length>=It;){let t=e.substring(0,It);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 Bt(t){let e=null;if("string"!=typeof t&&xt.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=kt(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&xt.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)!==Rt(t)&&xt.throwArgumentError("bad icap checksum","address",t),r=t.substring(4),e=new z(r,36).toString(16);e.length<40;)e="0"+e;e=kt("0x"+e)}else xt.throwArgumentError("invalid address","address",t);var r;return e}function Nt(t){try{return Bt(t),!0}catch(t){}return!1}function Ot(t){let e=(r=Bt(t).substring(2),new z(r,16).toString(36)).toUpperCase();for(var r;e.length<30;)e="0"+e;return"XE"+Rt("XE00"+e)+e}function Pt(t){let e=null;try{e=Bt(t.from)}catch(e){xt.throwArgumentError("missing from address","transaction",t)}return Bt(N(bt(At([e,k(M(V.from(t.nonce).toHexString()))])),12))}function Dt(t,e,r){return 32!==B(e)&&xt.throwArgumentError("salt must be 32 bytes","salt",e),32!==B(r)&&xt.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Bt(N(bt(x(["0xff",Bt(t),e,r])),12))}const Lt=new y("strings/5.6.0");var Ut,jt;function Ft(t,e,r,n,i){if(t===jt.BAD_PREFIX||t===jt.UNEXPECTED_CONTINUE){let t=0;for(let n=e+1;n<r.length&&r[n]>>6==2;n++)t++;return t}return t===jt.OVERRUN?r.length-e-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(Ut||(Ut={})),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"}(jt||(jt={}));const qt=Object.freeze({error:function(t,e,r,n,i){return Lt.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:Ft,replace:function(t,e,r,n,i){return t===jt.OVERLONG?(n.push(i),0):(n.push(65533),Ft(t,e,r))}});function zt(t,e){null==e&&(e=qt.error),t=M(t);const r=[];let n=0;for(;n<t.length;){const i=t[n++];if(i>>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)?jt.UNEXPECTED_CONTINUE:jt.BAD_PREFIX,n-1,t,r);continue}o=3,s=65535}if(n-1+o>=t.length){n+=e(jt.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-o-1)-1;for(let i=0;i<o;i++){let i=t[n];if(128!=(192&i)){n+=e(jt.MISSING_CONTINUE,n,t,r),a=null;break}a=a<<6|63&i,n++}null!==a&&(a>1114111?n+=e(jt.OUT_OF_RANGE,n-1-o,t,r,a):a>=55296&&a<=57343?n+=e(jt.UTF16_SURROGATE,n-1-o,t,r,a):a<=s?n+=e(jt.OVERLONG,n-1-o,t,r,a):r.push(a))}return r}function Ht(t,e=Ut.current){e!=Ut.current&&(Lt.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){e++;const i=t.charCodeAt(e);if(e>=t.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<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(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return M(r)}function Kt(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function Gt(t,e){return'"'+zt(t,e).map((t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?Kt(t):Kt(55296+((t-=65536)>>10&1023))+Kt(56320+(1023&t))})).join("")+'"'}function Wt(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function Vt(t,e){return Wt(zt(t,e))}function $t(t,e=Ut.current){return zt(Ht(t,e))}function Xt(t){return bt(Ht(t))}class Yt extends ht{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=Bt(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return Bt(L(t.readValue().toHexString(),20))}}class Jt extends ht{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const Zt=new y(ct);function Qt(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let t={};n=e.map((e=>{const n=e.localName;return n||Zt.throwError("cannot encode object for signature with missing names",y.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]&&Zt.throwError("cannot encode object for signature with duplicate names",y.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[n]=!0,r[n]}))}else Zt.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Zt.throwArgumentError("types/value length mismatch","tuple",r);let i=new dt(t.wordSize),o=new dt(t.wordSize),s=[];e.forEach(((t,e)=>{let r=n[e];if(t.dynamic){let e=o.length;t.encode(o,r);let n=i.writeUpdatableValue();s.push((t=>{n(t+e)}))}else t.encode(i,r)})),s.forEach((t=>{t(i.length)}));let a=t.appendWriter(i);return a+=t.appendWriter(o),a}function te(t,e){let r=[],n=t.subReader(0);e.forEach((e=>{let i=null;if(e.dynamic){let r=t.readValue(),o=n.subReader(r.toNumber());try{i=e.decode(o)}catch(t){if(t.code===y.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===y.errors.BUFFER_OVERRUN)throw t;i=t,i.baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));const i=e.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach(((t,e)=>{let n=t.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[e];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let t=0;t<r.length;t++){const e=r[t];e instanceof Error&&Object.defineProperty(r,t,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(r)}class ee extends ht{constructor(t,e,r){super("array",t.type+"["+(e>=0?e:"")+"]",r,-1===e||t.dynamic),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let r=0;r<this.length;r++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),Zt.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let t=0;t<e.length;t++)n.push(this.coder);return Qt(t,n,e)}decode(t){let e=this.length;-1===e&&(e=t.readValue().toNumber(),32*e>t._data.length&&Zt.throwError("insufficient data length",y.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let r=[];for(let t=0;t<e;t++)r.push(new Jt(this.coder));return t.coerce(this.name,te(t,r))}}class re extends ht{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class ne extends ht{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=M(e);let r=t.writeValue(e.length);return r+=t.writeBytes(e),r}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class ie extends ne{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,R(super.decode(t)))}}class oe extends ht{constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let r=M(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return t.coerce(this.name,R(t.readBytes(this.size)))}}class se extends ht{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}const ae=V.from(-1),ue=V.from(0),ce=V.from(1),fe=V.from(2),le=V.from("1000000000000000000"),he=V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),de=V.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),pe=V.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class me extends ht{constructor(t,e,r){const n=(e?"int":"uint")+8*t;super(n,n,r,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let r=V.from(e),n=he.mask(8*t.wordSize);if(this.signed){let t=n.mask(8*this.size-1);(r.gt(t)||r.lt(t.add(ce).mul(ae)))&&this._throwError("value out-of-bounds",e)}else(r.lt(ue)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}class ge extends ne{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,Ht(e))}decode(t){return Vt(super.decode(t))}}class be extends ht{constructor(t,e){let r=!1;const n=[];t.forEach((t=>{t.dynamic&&(r=!0),n.push(t.type)})),super("tuple","tuple("+n.join(",")+")",e,r),this.coders=t}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===e[i]&&("length"===i&&(i="_length"),null==t[i]&&(t[i]=t[n]))})),Object.freeze(t)}encode(t,e){return Qt(t,this.coders,e)}decode(t){return t.coerce(this.name,te(t,this.coders))}}const ye=new y(ct),ve={};let we={calldata:!0,memory:!0,storage:!0},_e={calldata:!0,memory:!0};function Ae(t,e){if("bytes"===t||"string"===t){if(we[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&_e[e])return!0;return(we[e]||"payable"===e)&&ye.throwArgumentError("invalid modifier","name",e),!1}function Ee(t,e){for(let r in e)Q(t,r,e[r])}const Se=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Me=new RegExp(/^(.*)\[([0-9]*)\]$/);class xe{constructor(t,e){t!==ve&&ye.throwError("use fromString",y.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ee(this,e);let r=this.type.match(Me);Ee(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:xe.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=Se.sighash),Se[t]||ye.throwArgumentError("invalid format type","format",t),t===Se.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(e)}let e="";return"array"===this.baseType?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(t!==Se.sighash&&(e+=this.type),e+="("+this.components.map((e=>e.format(t))).join(t===Se.full?", ":",")+")"):e+=this.type,t!==Se.sighash&&(!0===this.indexed&&(e+=" indexed"),t===Se.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?xe.fromString(t,e):xe.fromObject(t)}static fromObject(t){return xe.isParamType(t)?t:new xe(ve,{name:t.name||null,type:Le(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(xe.fromObject):null})}static fromString(t,e){return r=function(t,e){let r=t;function n(e){ye.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function i(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let r=0;r<t.length;r++){let o=t[r];switch(o){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=Le(s.type),s.components=[i(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(e||n(r),s.indexed=!0,s.name=""),Ae(s.type,s.name)&&(s.name=""),s.type=Le(s.type);let t=s;s=s.parent,s||n(r),delete t.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(e||n(r),s.indexed=!0,s.name=""),Ae(s.type,s.name)&&(s.name=""),s.type=Le(s.type);let a=i(s.parent);s.parent.components.push(a),delete s.parent,s=a;break;case" ":s.state.allowType&&""!==s.type&&(s.type=Le(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(e||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):Ae(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=o,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=o,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=o,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=o,delete s.state.allowArray):s.state.readArray?s.type+=o:n(r)}}return s.parent&&ye.throwArgumentError("unexpected eof","param",t),delete o.state,"indexed"===s.name?(e||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):Ae(s.type,s.name)&&(s.name=""),o.type=Le(o.type),o}(t,!!e),xe.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(t){return!(null==t||!t._isParamType)}}function ke(t,e){return function(t){t=t.trim();let e=[],r="",n=0;for(let i=0;i<t.length;i++){let o=t[i];","===o&&0===n?(e.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&ye.throwArgumentError("unbalanced parenthesis","value",t)))}return r&&e.push(r),e}(t).map((t=>xe.fromString(t,e)))}class Te{constructor(t,e){t!==ve&&ye.throwError("use a static from method",y.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ee(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return Te.isFragment(t)?t:"string"==typeof t?Te.fromString(t):Te.fromObject(t)}static fromObject(t){if(Te.isFragment(t))return t;switch(t.type){case"function":return Oe.fromObject(t);case"event":return Ie.fromObject(t);case"constructor":return Ne.fromObject(t);case"error":return De.fromObject(t);case"fallback":case"receive":return null}return ye.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Ie.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?Oe.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?Ne.fromString(t.trim()):"error"===t.split(" ")[0]?De.fromString(t.substring(5).trim()):ye.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!(!t||!t._isFragment)}}class Ie extends Te{format(t){if(t||(t=Se.sighash),Se[t]||ye.throwArgumentError("invalid format type","format",t),t===Se.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==Se.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===Se.full?", ":",")+") ",t!==Se.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?Ie.fromString(t):Ie.fromObject(t)}static fromObject(t){if(Ie.isEventFragment(t))return t;"event"!==t.type&&ye.throwArgumentError("invalid event object","value",t);const e={name:je(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(xe.fromObject):[],type:"event"};return new Ie(ve,e)}static fromString(t){let e=t.match(Fe);e||ye.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach((t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:ye.warn("unknown modifier: "+t)}})),Ie.fromObject({name:e[1].trim(),anonymous:r,inputs:ke(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function Ce(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&ye.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||ye.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=V.from(r[1]),r[0]):t}function Re(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach((t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}}))}function Be(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&ye.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&ye.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||ye.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&ye.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&ye.throwArgumentError("unable to determine stateMutability","value",t),e}class Ne extends Te{format(t){if(t||(t=Se.sighash),Se[t]||ye.throwArgumentError("invalid format type","format",t),t===Se.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});t===Se.sighash&&ye.throwError("cannot format a constructor for sighash",y.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map((e=>e.format(t))).join(t===Se.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?Ne.fromString(t):Ne.fromObject(t)}static fromObject(t){if(Ne.isConstructorFragment(t))return t;"constructor"!==t.type&&ye.throwArgumentError("invalid constructor object","value",t);let e=Be(t);e.constant&&ye.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(xe.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?V.from(t.gas):null};return new Ne(ve,r)}static fromString(t){let e={type:"constructor"},r=(t=Ce(t,e)).match(Fe);return r&&"constructor"===r[1].trim()||ye.throwArgumentError("invalid constructor string","value",t),e.inputs=ke(r[2].trim(),!1),Re(r[3].trim(),e),Ne.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class Oe extends Ne{format(t){if(t||(t=Se.sighash),Se[t]||ye.throwArgumentError("invalid format type","format",t),t===Se.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==Se.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===Se.full?", ":",")+") ",t!==Se.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map((e=>e.format(t))).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?Oe.fromString(t):Oe.fromObject(t)}static fromObject(t){if(Oe.isFunctionFragment(t))return t;"function"!==t.type&&ye.throwArgumentError("invalid function object","value",t);let e=Be(t);const r={type:t.type,name:je(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(xe.fromObject):[],outputs:t.outputs?t.outputs.map(xe.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?V.from(t.gas):null};return new Oe(ve,r)}static fromString(t){let e={type:"function"},r=(t=Ce(t,e)).split(" returns ");r.length>2&&ye.throwArgumentError("invalid function string","value",t);let n=r[0].match(Fe);if(n||ye.throwArgumentError("invalid function signature","value",t),e.name=n[1].trim(),e.name&&je(e.name),e.inputs=ke(n[2],!1),Re(n[3].trim(),e),r.length>1){let n=r[1].match(Fe);""==n[1].trim()&&""==n[3].trim()||ye.throwArgumentError("unexpected tokens","value",t),e.outputs=ke(n[2],!1)}else e.outputs=[];return Oe.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function Pe(t){const e=t.format();return"Error(string)"!==e&&"Panic(uint256)"!==e||ye.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class De extends Te{format(t){if(t||(t=Se.sighash),Se[t]||ye.throwArgumentError("invalid format type","format",t),t===Se.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});let e="";return t!==Se.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map((e=>e.format(t))).join(t===Se.full?", ":",")+") ",e.trim()}static from(t){return"string"==typeof t?De.fromString(t):De.fromObject(t)}static fromObject(t){if(De.isErrorFragment(t))return t;"error"!==t.type&&ye.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:je(t.name),inputs:t.inputs?t.inputs.map(xe.fromObject):[]};return Pe(new De(ve,e))}static fromString(t){let e={type:"error"},r=t.match(Fe);return r||ye.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&je(e.name),e.inputs=ke(r[2],!1),Pe(De.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function Le(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const Ue=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function je(t){return t&&t.match(Ue)||ye.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Fe=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),qe=new y(ct),ze=new RegExp(/^bytes([0-9]*)$/),He=new RegExp(/^(u?int)([0-9]*)$/);class Ke{constructor(t){qe.checkNew(new.target,Ke),Q(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new Yt(t.name);case"bool":return new re(t.name);case"string":return new ge(t.name);case"bytes":return new ie(t.name);case"array":return new ee(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new be((t.components||[]).map((t=>this._getCoder(t))),t.name);case"":return new se(t.name)}let e=t.type.match(He);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&qe.throwArgumentError("invalid "+e[1]+" bit length","param",t),new me(r/8,"int"===e[1],t.name)}if(e=t.type.match(ze),e){let r=parseInt(e[1]);return(0===r||r>32)&&qe.throwArgumentError("invalid bytes length","param",t),new oe(r,t.name)}return qe.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new pt(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new dt(this._getWordSize())}getDefaultValue(t){const e=t.map((t=>this._getCoder(xe.from(t))));return new be(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&qe.throwError("types/values length mismatch",y.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const r=t.map((t=>this._getCoder(xe.from(t)))),n=new be(r,"_"),i=this._getWriter();return n.encode(i,e),i.data}decode(t,e,r){const n=t.map((t=>this._getCoder(xe.from(t))));return new be(n,"_").decode(this._getReader(M(e),r))}}const Ge=new Ke,We=new y(ct);class Ve extends ut{}class $e extends ut{}class Xe extends ut{}class Ye extends ut{static isIndexed(t){return!(!t||!t._isIndexed)}}const Je={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Ze(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class Qe{constructor(t){We.checkNew(new.target,Qe);let e=[];e="string"==typeof t?JSON.parse(t):t,Q(this,"fragments",e.map((t=>Te.from(t))).filter((t=>null!=t))),Q(this,"_abiCoder",tt(new.target,"getAbiCoder")()),Q(this,"functions",{}),Q(this,"errors",{}),Q(this,"events",{}),Q(this,"structs",{}),this.fragments.forEach((t=>{let e=null;switch(t.type){case"constructor":return this.deploy?void We.warn("duplicate definition - constructor"):void Q(this,"deploy",t);case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();e[r]?We.warn("duplicate definition - "+r):e[r]=t})),this.deploy||Q(this,"deploy",Ne.from({payable:!1,type:"constructor"})),Q(this,"_isInterface",!0)}format(t){t||(t=Se.full),t===Se.sighash&&We.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map((e=>e.format(t)));return t===Se.json?JSON.stringify(e.map((t=>JSON.parse(t)))):e}static getAbiCoder(){return Ge}static getAddress(t){return Bt(t)}static getSighash(t){return N(Xt(t.format()),0,4)}static getEventTopic(t){return Xt(t.format())}getFunction(t){if(I(t)){for(const e in this.functions)if(t===this.getSighash(e))return this.functions[e];We.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.functions).filter((t=>t.split("(")[0]===e));return 0===r.length?We.throwArgumentError("no matching function","name",e):r.length>1&&We.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}const e=this.functions[Oe.fromString(t).format()];return e||We.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(I(t)){const e=t.toLowerCase();for(const t in this.events)if(e===this.getEventTopic(t))return this.events[t];We.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.events).filter((t=>t.split("(")[0]===e));return 0===r.length?We.throwArgumentError("no matching event","name",e):r.length>1&&We.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}const e=this.events[Ie.fromString(t).format()];return e||We.throwArgumentError("no matching event","signature",t),e}getError(t){if(I(t)){const e=tt(this.constructor,"getSighash");for(const r in this.errors)if(t===e(this.errors[r]))return this.errors[r];We.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){const e=t.trim(),r=Object.keys(this.errors).filter((t=>t.split("(")[0]===e));return 0===r.length?We.throwArgumentError("no matching error","name",e):r.length>1&&We.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}const e=this.errors[Oe.fromString(t).format()];return e||We.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return tt(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),tt(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));const r=M(e);return R(r.slice(0,4))!==this.getSighash(t)&&We.throwArgumentError(`data signature does not match error ${t.name}.`,"data",R(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),R(x([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));const r=M(e);return R(r.slice(0,4))!==this.getSighash(t)&&We.throwArgumentError(`data signature does not match function ${t.name}.`,"data",R(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),R(x([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=M(e),n=null,i=null,o=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{const t=R(r.slice(0,4)),e=Je[t];if(e)i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.signature,e.reason&&(n=i[0]);else try{const e=this.getError(t);i=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,s=e.format()}catch(t){}break}}return We.throwError("call revert exception",y.errors.CALL_EXCEPTION,{method:t.format(),errorArgs:i,errorName:o,errorSignature:s,reason:n})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),R(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&We.throwError("too many arguments for "+t.format(),y.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));const n=(t,e)=>"string"===t.type?Xt(e):"bytes"===t.type?bt(R(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),L(R(e),32));for(e.forEach(((e,i)=>{let o=t.inputs[i];o.indexed?null==e?r.push(null):"array"===o.baseType||"tuple"===o.baseType?We.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,e):Array.isArray(e)?r.push(e.map((t=>n(o,t)))):r.push(n(o,e)):null!=e&&We.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,e)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));const r=[],n=[],i=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&We.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach(((t,o)=>{const s=e[o];if(t.indexed)if("string"===t.type)r.push(Xt(s));else if("bytes"===t.type)r.push(bt(s));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([t.type],[s]))}else n.push(t),i.push(s)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let e=this.getEventTopic(t);I(r[0],32)&&r[0].toLowerCase()===e||We.throwError("fragment/topic mismatch",y.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(n.push(xe.fromObject({type:"bytes32",name:t.name})),o.push(!0)):(n.push(t),o.push(!1)):(i.push(t),o.push(!1))}));let s=null!=r?this._abiCoder.decode(n,x(r)):null,a=this._abiCoder.decode(i,e,!0),u=[],c=0,f=0;t.inputs.forEach(((t,e)=>{if(t.indexed)if(null==s)u[e]=new Ye({_isIndexed:!0,hash:null});else if(o[e])u[e]=new Ye({_isIndexed:!0,hash:s[f++]});else try{u[e]=s[f++]}catch(t){u[e]=t}else try{u[e]=a[c++]}catch(t){u[e]=t}if(t.name&&null==u[t.name]){const r=u[e];r instanceof Error?Object.defineProperty(u,t.name,{enumerable:!0,get:()=>{throw Ze(`property ${JSON.stringify(t.name)}`,r)}}):u[t.name]=r}}));for(let t=0;t<u.length;t++){const e=u[t];e instanceof Error&&Object.defineProperty(u,t,{enumerable:!0,get:()=>{throw Ze(`index ${t}`,e)}})}return Object.freeze(u)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new $e({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:V.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Ve({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=R(t);let r=this.getError(e.substring(0,10).toLowerCase());return r?new Xe({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(t){return!(!t||!t._isInterface)}}const tr=new y("abstract-provider/5.6.0");class er extends ut{static isForkEvent(t){return!(!t||!t._isForkEvent)}}class rr{constructor(){tr.checkAbstract(new.target,rr),Q(this,"_isProvider",!0)}getFeeData(){return t=this,e=void 0,n=function*(){const{block:t,gasPrice:e}=yield et({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((t=>null))});let r=null,n=null;return t&&t.baseFeePerGas&&(n=V.from("1500000000"),r=t.baseFeePerGas.mul(2).add(n)),{maxFeePerGas:r,maxPriorityFeePerGas:n,gasPrice:e}},new((r=void 0)||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}));var t,e,r,n}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!(!t||!t._isProvider)}}var nr=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 ir=new y("abstract-signer/5.6.0"),or=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],sr=[y.errors.INSUFFICIENT_FUNDS,y.errors.NONCE_EXPIRED,y.errors.REPLACEMENT_UNDERPRICED];class ar{constructor(){ir.checkAbstract(new.target,ar),Q(this,"_isSigner",!0)}getBalance(t){return nr(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)}))}getTransactionCount(t){return nr(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)}))}estimateGas(t){return nr(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const e=yield et(this.checkTransaction(t));return yield this.provider.estimateGas(e)}))}call(t,e){return nr(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield et(this.checkTransaction(t));return yield this.provider.call(r,e)}))}sendTransaction(t){return nr(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 nr(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return nr(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return nr(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(t){return nr(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)}))}checkTransaction(t){for(const e in t)-1===or.indexOf(e)&&ir.throwArgumentError("invalid transaction key: "+e,"transaction",t);const e=nt(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()&&ir.throwArgumentError("from address mismatch","transaction",t),e[0]))),e}populateTransaction(t){return nr(this,void 0,void 0,(function*(){const e=yield et(this.checkTransaction(t));null!=e.to&&(e.to=Promise.resolve(e.to).then((t=>nr(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.resolveName(t);return null==e&&ir.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||ir.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t):ir.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&&ir.throwError("network does not support EIP-1559",y.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==e.gasPrice&&(e.gasPrice=t.gasPrice),e.type=0):ir.throwError("failed to get consistent fee data",y.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(sr.indexOf(t.code)>=0)throw t;return ir.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.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]&&ir.throwArgumentError("chainId address mismatch","transaction",t),e[0]))),yield et(e)}))}_checkProvider(t){this.provider||ir.throwError("missing provider",y.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!(!t||!t._isSigner)}}class ur extends ar{constructor(t,e){ir.checkNew(new.target,ur),super(),Q(this,"address",t),Q(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then((()=>{ir.throwError(t,y.errors.UNSUPPORTED_OPERATION,{operation:e})}))}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new ur(this.address,t)}}var cr=r(8409),fr=r.n(cr),lr=r(927),hr=r.n(lr);function dr(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}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var pr=mr;function mr(t,e){if(!t)throw new Error(e||"Assertion failed")}mr.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var gr=dr((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<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>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}})),br=dr((function(t,e){var r=e;r.assert=pr,r.toArray=gr.toArray,r.zero2=gr.zero2,r.toHex=gr.toHex,r.encode=gr.encode,r.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(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(fr())(t,"hex","le")}})),yr=br.getNAF,vr=br.getJSF,wr=br.assert;function _r(t,e){this.type=t,this.p=new(fr())(e.p,16),this.red=e.prime?fr().red(e.prime):fr().mont(this.p),this.zero=new(fr())(0).toRed(this.red),this.one=new(fr())(1).toRed(this.red),this.two=new(fr())(2).toRed(this.red),this.n=e.n&&new(fr())(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 Ar=_r;function Er(t,e){this.curve=t,this.type=e,this.precomputed=null}_r.prototype.point=function(){throw new Error("Not implemented")},_r.prototype.validate=function(){throw new Error("Not implemented")},_r.prototype._fixedNafMul=function(t,e){wr(t.precomputed);var r=t._getDoubles(),n=yr(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,a=[];for(o=0;o<n.length;o+=r.step){s=0;for(var u=o+r.step-1;u>=o;u--)s=(s<<1)+n[u];a.push(s)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),l=i;l>0;l--){for(o=0;o<a.length;o++)(s=a[o])===l?f=f.mixedAdd(r.points[o]):s===-l&&(f=f.mixedAdd(r.points[o].neg()));c=c.add(f)}return c.toP()},_r.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=yr(e,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=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];wr(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},_r.prototype._wnafMulAdd=function(t,e,r,n,i){var o,s,a,u=this._wnafT1,c=this._wnafT2,f=this._wnafT3,l=0;for(o=0;o<n;o++){var h=(a=e[o])._getNAFPoints(t);u[o]=h.wnd,c[o]=h.points}for(o=n-1;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],b=vr(r[d],r[p]);for(l=Math.max(b[0].length,l),f[d]=new Array(l),f[p]=new Array(l),s=0;s<l;s++){var y=0|b[0][s],v=0|b[1][s];f[d][s]=g[3*(y+1)+(v+1)],f[p][s]=0,c[d]=m}}else f[d]=yr(r[d],u[d],this._bitLength),f[p]=yr(r[p],u[p],this._bitLength),l=Math.max(f[d].length,l),l=Math.max(f[p].length,l)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=l;o>=0;o--){for(var A=0;o>=0;){var E=!0;for(s=0;s<n;s++)_[s]=0|f[s][o],0!==_[s]&&(E=!1);if(!E)break;A++,o--}if(o>=0&&A++,w=w.dblp(A),o<0)break;for(s=0;s<n;s++){var S=_[s];0!==S&&(S>0?a=c[s][S-1>>1]:S<0&&(a=c[s][-S-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<n;o++)c[o]=null;return i?w:w.toP()},_r.BasePoint=Er,Er.prototype.eq=function(){throw new Error("Not implemented")},Er.prototype.validate=function(){return this.curve.validate(this)},_r.prototype.decodePoint=function(t,e){t=br.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?wr(t[t.length-1]%2==0):7===t[0]&&wr(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},Er.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Er.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},Er.prototype.encode=function(t,e){return br.encode(this._encode(e),t)},Er.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Er.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},Er.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},Er.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},Er.prototype._getBeta=function(){return null},Er.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var Sr=dr((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}}})),Mr=br.assert;function xr(t){Ar.call(this,"short",t),this.a=new(fr())(t.a,16).toRed(this.red),this.b=new(fr())(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)}Sr(xr,Ar);var kr=xr;function Tr(t,e,r,n){Ar.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(fr())(e,16),this.y=new(fr())(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 Ir(t,e,r,n){Ar.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(fr())(0)):(this.x=new(fr())(e,16),this.y=new(fr())(r,16),this.z=new(fr())(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}xr.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new(fr())(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(fr())(t.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?r=i[0]:(r=i[1],Mr(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(fr())(t.a,16),b:new(fr())(t.b,16)}})):this._getEndoBasis(r)}}},xr.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:fr().mont(t),r=new(fr())(2).toRed(e).redInvm(),n=r.redNeg(),i=new(fr())(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},xr.prototype._getEndoBasis=function(t){for(var e,r,n,i,o,s,a,u,c,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,h=this.n.clone(),d=new(fr())(1),p=new(fr())(0),m=new(fr())(0),g=new(fr())(1),b=0;0!==l.cmpn(0);){var y=h.div(l);u=h.sub(y.mul(l)),c=m.sub(y.mul(d));var v=g.sub(y.mul(p));if(!n&&u.cmp(f)<0)e=a.neg(),r=d,n=u.neg(),i=c;else if(n&&2==++b)break;a=u,h=l,l=u,m=d,d=c,g=p,p=v}o=u.neg(),s=c;var w=n.sqr().add(i.sqr());return o.sqr().add(s.sqr()).cmp(w)>=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}]},xr.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()}},xr.prototype.pointFromX=function(t,e){(t=new(fr())(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)},xr.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)},xr.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},Sr(Tr,Ar.BasePoint),xr.prototype.point=function(t,e,r){return new Tr(this,t,e,r)},xr.prototype.pointFromJSON=function(t,e){return Tr.fromJSON(this,t,e)},Tr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},Tr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Tr.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},Tr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Tr.prototype.isInfinity=function(){return this.inf},Tr.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)},Tr.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)},Tr.prototype.getX=function(){return this.x.fromRed()},Tr.prototype.getY=function(){return this.y.fromRed()},Tr.prototype.mul=function(t){return t=new(fr())(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)},Tr.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)},Tr.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)},Tr.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))},Tr.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},Tr.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Sr(Ir,Ar.BasePoint),xr.prototype.jpoint=function(t,e,r){return new Ir(this,t,e,r)},Ir.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)},Ir.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ir.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(),f=c.redMul(a),l=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},Ir.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),f=r.redMul(u),l=a.redSqr().redIAdd(c).redISub(f).redISub(f),h=a.redMul(f.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(l,h,d)},Ir.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<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(e=0;e<t;e++){var f=o.redSqr(),l=c.redSqr(),h=l.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(l),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),b=d.redMul(g);b=b.redIAdd(b).redISub(h);var y=c.redMul(a);e+1<t&&(u=u.redMul(h)),o=m,a=y,c=b}return this.curve.jpoint(o,c.redMul(i),a)},Ir.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ir.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=u,e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(f).redISub(h);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},Ir.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),h=this.x.redMul(l),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},Ir.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),c=(u=u.redIAdd(u)).redMul(s),f=a.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=a.redMul(l).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,d,p)},Ir.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),f=e.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(a).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,h,d)},Ir.prototype.mul=function(t,e){return t=new(fr())(t,e),this.curve._wnafMul(this,t)},Ir.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},Ir.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Ir.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Ir.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Cr=dr((function(t,e){var r=e;r.base=Ar,r.short=kr,r.mont=null,r.edwards=null})),Rr=dr((function(t,e){var r,n=e,i=br.assert;function o(t){"short"===t.type?this.curve=new Cr.short(t):"edwards"===t.type?this.curve=new Cr.edwards(t):this.curve=new Cr.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:hr().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:hr().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:hr().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:hr().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:hr().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:hr().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:hr().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(t){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:hr().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Br(t){if(!(this instanceof Br))return new Br(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=gr.toArray(t.entropy,t.entropyEnc||"hex"),r=gr.toArray(t.nonce,t.nonceEnc||"hex"),n=gr.toArray(t.pers,t.persEnc||"hex");pr(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var Nr=Br;Br.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.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Br.prototype._hmac=function(){return new(hr().hmac)(this.hash,this.K)},Br.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},Br.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=gr.toArray(t,e),r=gr.toArray(r,n),pr(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},Br.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=gr.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<t;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,t);return this._update(r),this._reseed++,gr.encode(o,e)};var Or=br.assert;function Pr(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)}var Dr=Pr;Pr.fromPublic=function(t,e,r){return e instanceof Pr?e:new Pr(t,{pub:e,pubEnc:r})},Pr.fromPrivate=function(t,e,r){return e instanceof Pr?e:new Pr(t,{priv:e,privEnc:r})},Pr.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"}},Pr.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},Pr.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},Pr.prototype._importPrivate=function(t,e){this.priv=new(fr())(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Pr.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?Or(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Or(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)},Pr.prototype.derive=function(t){return t.validate()||Or(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Pr.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Pr.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Pr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Lr=br.assert;function Ur(t,e){if(t instanceof Ur)return t;this._importDER(t,e)||(Lr(t.r&&t.s,"Signature without r or s"),this.r=new(fr())(t.r,16),this.s=new(fr())(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var jr=Ur;function Fr(){this.place=0}function qr(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<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function zr(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function Hr(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}Ur.prototype._importDER=function(t,e){t=br.toArray(t,e);var r=new Fr;if(48!==t[r.place++])return!1;var n=qr(t,r);if(!1===n)return!1;if(n+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var i=qr(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=qr(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(fr())(o),this.s=new(fr())(a),this.recoveryParam=null,!0},Ur.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=zr(e),r=zr(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Hr(n,e.length),(n=n.concat(e)).push(2),Hr(n,r.length);var i=n.concat(r),o=[48];return Hr(o,i.length),o=o.concat(i),br.encode(o,t)};var Kr=function(){throw new Error("unsupported")},Gr=br.assert;function Wr(t){if(!(this instanceof Wr))return new Wr(t);"string"==typeof t&&(Gr(Object.prototype.hasOwnProperty.call(Rr,t),"Unknown curve "+t),t=Rr[t]),t instanceof Rr.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 Vr=Wr;Wr.prototype.keyPair=function(t){return new Dr(this,t)},Wr.prototype.keyFromPrivate=function(t,e){return Dr.fromPrivate(this,t,e)},Wr.prototype.keyFromPublic=function(t,e){return Dr.fromPublic(this,t,e)},Wr.prototype.genKeyPair=function(t){t||(t={});for(var e=new Nr({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Kr(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(fr())(2));;){var i=new(fr())(e.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Wr.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},Wr.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(fr())(t,16));for(var i=this.n.byteLength(),o=e.getPrivate().toArray("be",i),s=t.toArray("be",i),a=new Nr({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(fr())(1)),c=0;;c++){var f=n.k?n.k(c):new(fr())(a.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(u)>=0)){var l=this.g.mul(f);if(!l.isInfinity()){var h=l.getX(),d=h.umod(this.n);if(0!==d.cmpn(0)){var p=f.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(l.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 jr({r:d,s:p,recoveryParam:m})}}}}}},Wr.prototype.verify=function(t,e,r,n){t=this._truncateToN(new(fr())(t,16)),r=this.keyFromPublic(r,n);var i=(e=new jr(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)},Wr.prototype.recoverPubKey=function(t,e,r,n){Gr((3&r)===r,"The recovery param is more than two bits"),e=new jr(e,n);var i=this.n,o=new(fr())(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 f=e.r.invm(i),l=i.sub(o).mul(f).umod(i),h=a.mul(f).umod(i);return this.g.mulAdd(l,s,h)},Wr.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new jr(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 $r=dr((function(t,e){var r=e;r.version="6.5.4",r.utils=br,r.rand=function(){throw new Error("unsupported")},r.curve=Cr,r.curves=Rr,r.ec=Vr,r.eddsa=null})).ec;const Xr=new y("signing-key/5.6.0");let Yr=null;function Jr(){return Yr||(Yr=new $r("secp256k1")),Yr}class Zr{constructor(t){Q(this,"curve","secp256k1"),Q(this,"privateKey",R(t));const e=Jr().keyFromPrivate(M(this.privateKey));Q(this,"publicKey","0x"+e.getPublic(!1,"hex")),Q(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),Q(this,"_isSigningKey",!0)}_addPoint(t){const e=Jr().keyFromPublic(M(this.publicKey)),r=Jr().keyFromPublic(M(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){const e=Jr().keyFromPrivate(M(this.privateKey)),r=M(t);32!==r.length&&Xr.throwArgumentError("bad digest length","digest",t);const n=e.sign(r,{canonical:!0});return U({recoveryParam:n.recoveryParam,r:L("0x"+n.r.toString(16),32),s:L("0x"+n.s.toString(16),32)})}computeSharedSecret(t){const e=Jr().keyFromPrivate(M(this.privateKey)),r=Jr().keyFromPublic(M(tn(t)));return L("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!(!t||!t._isSigningKey)}}function Qr(t,e){const r=U(e),n={r:M(r.r),s:M(r.s)};return"0x"+Jr().recoverPubKey(M(t),n,r.recoveryParam).encode("hex",!1)}function tn(t,e){const r=M(t);if(32===r.length){const t=new Zr(r);return e?"0x"+Jr().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?R(r):"0x"+Jr().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+Jr().keyFromPublic(r).getPublic(!0,"hex"):R(r):Xr.throwArgumentError("invalid public or private key","key","[REDACTED]")}const en=new y("transactions/5.6.0");var rn;function nn(t){return"0x"===t?null:Bt(t)}function on(t){return"0x"===t?ue:V.from(t)}!function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"}(rn||(rn={}));const sn=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],an={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function un(t){return Bt(N(bt(N(tn(t),1)),12))}function cn(t,e){return un(Qr(M(t),e))}function fn(t,e){const r=k(V.from(t).toHexString());return r.length>32&&en.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function ln(t,e){return{address:Bt(t),storageKeys:(e||[]).map(((e,r)=>(32!==B(e)&&en.throwArgumentError("invalid access list storageKey",`accessList[${t}:${r}]`,e),e.toLowerCase())))}}function hn(t){if(Array.isArray(t))return t.map(((t,e)=>Array.isArray(t)?(t.length>2&&en.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${e}]`,t),ln(t[0],t[1])):ln(t.address,t.storageKeys)));const e=Object.keys(t).map((e=>{const r=t[e].reduce(((t,e)=>(t[e]=!0,t)),{});return ln(e,Object.keys(r).sort())}));return e.sort(((t,e)=>t.address.localeCompare(e.address))),e}function dn(t){return hn(t).map((t=>[t.address,t.storageKeys]))}function pn(t,e){if(null!=t.gasPrice){const e=V.from(t.gasPrice),r=V.from(t.maxFeePerGas||0);e.eq(r)||en.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:e,maxFeePerGas:r})}const r=[fn(t.chainId||0,"chainId"),fn(t.nonce||0,"nonce"),fn(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),fn(t.maxFeePerGas||0,"maxFeePerGas"),fn(t.gasLimit||0,"gasLimit"),null!=t.to?Bt(t.to):"0x",fn(t.value||0,"value"),t.data||"0x",dn(t.accessList||[])];if(e){const t=U(e);r.push(fn(t.recoveryParam,"recoveryParam")),r.push(k(t.r)),r.push(k(t.s))}return O(["0x02",At(r)])}function mn(t,e){const r=[fn(t.chainId||0,"chainId"),fn(t.nonce||0,"nonce"),fn(t.gasPrice||0,"gasPrice"),fn(t.gasLimit||0,"gasLimit"),null!=t.to?Bt(t.to):"0x",fn(t.value||0,"value"),t.data||"0x",dn(t.accessList||[])];if(e){const t=U(e);r.push(fn(t.recoveryParam,"recoveryParam")),r.push(k(t.r)),r.push(k(t.s))}return O(["0x01",At(r)])}function gn(t,e){if(null==t.type||0===t.type)return null!=t.accessList&&en.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),function(t,e){rt(t,an);const r=[];sn.forEach((function(e){let n=t[e.name]||[];const i={};e.numeric&&(i.hexPad="left"),n=M(R(n,i)),e.length&&n.length!==e.length&&n.length>0&&en.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=k(n),n.length>e.maxLength&&en.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n)),r.push(R(n))}));let n=0;if(null!=t.chainId?(n=t.chainId,"number"!=typeof n&&en.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!A(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),0!==n&&(r.push(R(n)),r.push("0x"),r.push("0x")),!e)return At(r);const i=U(e);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&en.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==o&&en.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(R(o)),r.push(k(M(i.r))),r.push(k(M(i.s))),At(r)}(t,e);switch(t.type){case 1:return mn(t,e);case 2:return pn(t,e)}return en.throwError(`unsupported transaction type: ${t.type}`,y.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function bn(t,e,r){try{const r=on(e[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");t.v=r}catch(t){en.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=L(e[1],32),t.s=L(e[2],32);try{const e=bt(r(t));t.from=cn(e,{r:t.r,s:t.s,recoveryParam:t.v})}catch(t){console.log(t)}}function yn(t){const e=M(t);if(e[0]>127)return function(t){const e=Mt(t);9!==e.length&&6!==e.length&&en.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:on(e[0]).toNumber(),gasPrice:on(e[1]),gasLimit:on(e[2]),to:nn(e[3]),value:on(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=V.from(e[6]).toNumber()}catch(t){return console.log(t),r}if(r.r=L(e[7],32),r.s=L(e[8],32),V.from(r.r).isZero()&&V.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 n=r.v-27;const i=e.slice(0,6);0!==r.chainId&&(i.push(R(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=bt(At(i));try{r.from=cn(o,{r:R(r.r),s:R(r.s),recoveryParam:n})}catch(t){console.log(t)}r.hash=bt(t)}return r.type=null,r}(e);switch(e[0]){case 1:return function(t){const e=Mt(t.slice(1));8!==e.length&&11!==e.length&&en.throwArgumentError("invalid component count for transaction type: 1","payload",R(t));const r={type:1,chainId:on(e[0]).toNumber(),nonce:on(e[1]).toNumber(),gasPrice:on(e[2]),gasLimit:on(e[3]),to:nn(e[4]),value:on(e[5]),data:e[6],accessList:hn(e[7])};return 8===e.length||(r.hash=bt(t),bn(r,e.slice(8),mn)),r}(e);case 2:return function(t){const e=Mt(t.slice(1));9!==e.length&&12!==e.length&&en.throwArgumentError("invalid component count for transaction type: 2","payload",R(t));const r=on(e[2]),n=on(e[3]),i={type:2,chainId:on(e[0]).toNumber(),nonce:on(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:on(e[4]),to:nn(e[5]),value:on(e[6]),data:e[7],accessList:hn(e[8])};return 9===e.length||(i.hash=bt(t),bn(i,e.slice(9),pn)),i}(e)}return en.throwError(`unsupported transaction type: ${e[0]}`,y.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}var vn=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 wn=new y("contracts/5.6.0"),_n={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function An(t,e){return vn(this,void 0,void 0,(function*(){const r=yield e;"string"!=typeof r&&wn.throwArgumentError("invalid address or ENS name","name",r);try{return Bt(r)}catch(t){}t||wn.throwError("a provider or signer is needed to resolve ENS names",y.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return null==n&&wn.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function En(t,e,r){return vn(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>En(t,Array.isArray(e)?e[n]:e[r.name],r)))):"address"===r.type?yield An(t,e):"tuple"===r.type?yield En(t,e,r.components):"array"===r.baseType?Array.isArray(e)?yield Promise.all(e.map((e=>En(t,e,r.arrayChildren)))):Promise.reject(wn.makeError("invalid value for array",y.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e}))}function Sn(t,e,r){return vn(this,void 0,void 0,(function*(){let n={};r.length===e.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=nt(r.pop())),wn.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=et({override:An(t.signer,n.from),signer:t.signer.getAddress()}).then((t=>vn(this,void 0,void 0,(function*(){return Bt(t.signer)!==t.override&&wn.throwError("Contract with a Signer cannot override from",y.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.override})))):n.from=t.signer.getAddress():n.from&&(n.from=An(t.provider,n.from));const i=yield et({args:En(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:et(n)||{}}),o=t.interface.encodeFunctionData(e,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=V.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=V.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=V.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=V.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=V.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=hn(a.accessList)),null==s.gasLimit&&null!=e.gas){let t=21e3;const r=M(o);for(let e=0;e<r.length;e++)t+=4,r[e]&&(t+=64);s.gasLimit=V.from(e.gas).add(t)}if(a.value){const t=V.from(a.value);t.isZero()||e.payable||wn.throwError("non-payable method cannot override value",y.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),s.value=t}a.customData&&(s.customData=nt(a.customData)),a.ccipReadEnabled&&(s.ccipReadEnabled=!!a.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const u=Object.keys(n).filter((t=>null!=n[t]));return u.length&&wn.throwError(`cannot override ${u.map((t=>JSON.stringify(t))).join(",")}`,y.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),s}))}function Mn(t,e){const r=e.wait.bind(e);e.wait=e=>r(e).then((e=>(e.events=e.logs.map((r=>{let n=at(r),i=null;try{i=t.interface.parseLog(r)}catch(t){}return i&&(n.args=i.args,n.decode=(e,r)=>t.interface.decodeEventLog(i.eventFragment,e,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>t.provider,n.getBlock=()=>t.provider.getBlock(e.blockHash),n.getTransaction=()=>t.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(e),n})),e)))}function xn(t,e,r){const n=t.signer||t.provider;return function(...i){return vn(this,void 0,void 0,(function*(){let o;if(i.length===e.inputs.length+1&&"object"==typeof i[i.length-1]){const t=nt(i.pop());null!=t.blockTag&&(o=yield t.blockTag),delete t.blockTag,i.push(t)}null!=t.deployTransaction&&(yield t._deployed(o));const s=yield Sn(t,e,i),a=yield n.call(s,o);try{let n=t.interface.decodeFunctionResult(e,a);return r&&1===e.outputs.length&&(n=n[0]),n}catch(e){throw e.code===y.errors.CALL_EXCEPTION&&(e.address=t.address,e.args=i,e.transaction=s),e}}))}}function kn(t,e,r){return e.constant?xn(t,e,r):function(t,e){return function(...r){return vn(this,void 0,void 0,(function*(){t.signer||wn.throwError("sending a transaction requires a signer",y.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=t.deployTransaction&&(yield t._deployed());const n=yield Sn(t,e,r),i=yield t.signer.sendTransaction(n);return Mn(t,i),i}))}}(t,e)}function Tn(t){return!t.address||null!=t.topics&&0!==t.topics.length?(t.address||"*")+"@"+(t.topics?t.topics.map((t=>Array.isArray(t)?t.join("|"):t)).join(":"):""):"*"}class In{constructor(t,e){Q(this,"tag",t),Q(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter((r=>!(!e&&r.listener===t&&(e=!0,1))))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((t=>t.listener))}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter((e=>{const r=t.slice();return setTimeout((()=>{e.listener.apply(this,r)}),0),!e.once})),e}prepareEvent(t){}getEmit(t){return[t]}}class Cn extends In{constructor(){super("error",null)}}class Rn extends In{constructor(t,e,r,n){const i={address:t};let o=e.getEventTopic(r);n?(o!==n[0]&&wn.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Tn(i),i),Q(this,"address",t),Q(this,"interface",e),Q(this,"fragment",r)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(t,e)=>this.interface.decodeEventLog(this.fragment,t,e);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=lt(t.args);if(e.length)throw e[0].error;const r=(t.args||[]).slice();return r.push(t),r}}class Bn extends In{constructor(t,e){super("*",{address:t}),Q(this,"address",t),Q(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(t,r)=>this.interface.decodeEventLog(e.eventFragment,t,r),t.args=e.args}catch(t){}}}class Nn{constructor(t,e,r){wn.checkNew(new.target,On),Q(this,"interface",tt(new.target,"getInterface")(e)),null==r?(Q(this,"provider",null),Q(this,"signer",null)):ar.isSigner(r)?(Q(this,"provider",r.provider||null),Q(this,"signer",r)):rr.isProvider(r)?(Q(this,"provider",r),Q(this,"signer",null)):wn.throwArgumentError("invalid signer or provider","signerOrProvider",r),Q(this,"callStatic",{}),Q(this,"estimateGas",{}),Q(this,"functions",{}),Q(this,"populateTransaction",{}),Q(this,"filters",{});{const t={};Object.keys(this.interface.events).forEach((e=>{const r=this.interface.events[e];Q(this.filters,e,((...t)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,t)}))),t[r.name]||(t[r.name]=[]),t[r.name].push(e)})),Object.keys(t).forEach((e=>{const r=t[e];1===r.length?Q(this.filters,e,this.filters[r[0]]):wn.warn(`Duplicate definition of ${e} (${r.join(", ")})`)}))}if(Q(this,"_runningEvents",{}),Q(this,"_wrappedEmits",{}),null==t&&wn.throwArgumentError("invalid contract address or ENS name","addressOrName",t),Q(this,"address",t),this.provider)Q(this,"resolvedAddress",An(this.provider,t));else try{Q(this,"resolvedAddress",Promise.resolve(Bt(t)))}catch(t){wn.throwError("provider is required to use ENS name as contract address",y.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((t=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((t=>{const e=this.interface.functions[t];if(i[t])wn.warn(`Duplicate ABI entry for ${JSON.stringify(t)}`);else{i[t]=!0;{const r=e.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(t)}null==this[t]&&Q(this,t,kn(this,e,!0)),null==this.functions[t]&&Q(this.functions,t,kn(this,e,!1)),null==this.callStatic[t]&&Q(this.callStatic,t,xn(this,e,!0)),null==this.populateTransaction[t]&&Q(this.populateTransaction,t,function(t,e){return function(...r){return Sn(t,e,r)}}(this,e)),null==this.estimateGas[t]&&Q(this.estimateGas,t,function(t,e){const r=t.signer||t.provider;return function(...n){return vn(this,void 0,void 0,(function*(){r||wn.throwError("estimate require a provider or signer",y.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Sn(t,e,n);return yield r.estimateGas(i)}))}}(this,e))}})),Object.keys(n).forEach((t=>{const e=n[t];if(e.length>1)return;t=t.substring(1);const r=e[0];try{null==this[t]&&Q(this,t,this[r])}catch(t){}null==this.functions[t]&&Q(this.functions,t,this.functions[r]),null==this.callStatic[t]&&Q(this.callStatic,t,this.callStatic[r]),null==this.populateTransaction[t]&&Q(this.populateTransaction,t,this.populateTransaction[r]),null==this.estimateGas[t]&&Q(this.estimateGas,t,this.estimateGas[r])}))}static getContractAddress(t){return Pt(t)}static getInterface(t){return Qe.isInterface(t)?t:new Qe(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,t).then((t=>("0x"===t&&wn.throwError("contract not deployed",y.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(t){this.signer||wn.throwError("sending a transactions require a signer",y.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=nt(t||{});return["from","to"].forEach((function(t){null!=e[t]&&wn.throwError("cannot override "+t,y.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(e)))}connect(t){"string"==typeof t&&(t=new ur(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&Q(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return Ye.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if("string"==typeof t){if("error"===t)return this._normalizeRunningEvent(new Cn);if("event"===t)return this._normalizeRunningEvent(new In("event",null));if("*"===t)return this._normalizeRunningEvent(new Bn(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new Rn(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const e=t.topics[0];if("string"!=typeof e)throw new Error("invalid topic");const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new Rn(this.address,this.interface,r,t.topics))}catch(t){}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new In(Tn(e),e))}return this._normalizeRunningEvent(new Bn(this.address,this.interface))}_checkRunningEvents(t){if(0===t.listenerCount()){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,r){const n=at(e);return n.removeListener=()=>{r&&(t.removeListener(r),this._checkRunningEvents(t))},n.getBlock=()=>this.provider.getBlock(e.blockHash),n.getTransaction=()=>this.provider.getTransaction(e.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(n),n}_addEventListener(t,e,r){if(this.provider||wn.throwError("events require a provider or a signer with a provider",y.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,r),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const r=r=>{let n=this._wrapEvent(t,r,e);if(null==n.decodeError)try{const e=t.getEmit(n);this.emit(t.filter,...e)}catch(t){n.decodeError=t.error}null!=t.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[t.tag]=r,null!=t.filter&&this.provider.on(t.filter,r)}}queryFilter(t,e,r){const n=this._getRunningEvent(t),i=nt(n.filter);return"string"==typeof e&&I(e,32)?(null!=r&&wn.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=e):(i.fromBlock=null!=e?e:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((t=>t.map((t=>this._wrapEvent(n,t,null)))))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const r=this._getRunningEvent(t),n=r.run(e)>0;return this._checkRunningEvents(r),n}listenerCount(t){return this.provider?null==t?Object.keys(this._runningEvents).reduce(((t,e)=>t+this._runningEvents[e].listenerCount()),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(null==t){const t=[];for(let e in this._runningEvents)this._runningEvents[e].listeners().forEach((e=>{t.push(e)}));return t}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(null==t){for(const t in this._runningEvents){const e=this._runningEvents[t];e.removeAllListeners(),this._checkRunningEvents(e)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const r=this._getRunningEvent(t);return r.removeListener(e),this._checkRunningEvents(r),this}removeListener(t,e){return this.off(t,e)}}class On extends Nn{}class Pn{constructor(t,e,r){let n=null;n="string"==typeof e?e:S(e)?R(e):e&&"string"==typeof e.object?e.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!I(n)||n.length%2)&&wn.throwArgumentError("invalid bytecode","bytecode",e),r&&!ar.isSigner(r)&&wn.throwArgumentError("invalid signer","signer",r),Q(this,"bytecode",n),Q(this,"interface",tt(new.target,"getInterface")(t)),Q(this,"signer",r||null)}getDeployTransaction(...t){let e={};if(t.length===this.interface.deploy.inputs.length+1&&"object"==typeof t[t.length-1]){e=nt(t.pop());for(const t in e)if(!_n[t])throw new Error("unknown transaction override "+t)}return["data","from","to"].forEach((t=>{null!=e[t]&&wn.throwError("cannot override "+t,y.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value&&(V.from(e.value).isZero()||this.interface.deploy.payable||wn.throwError("non-payable constructor cannot override value",y.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})),wn.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=R(x([this.bytecode,this.interface.encodeDeploy(t)])),e}deploy(...t){return vn(this,void 0,void 0,(function*(){let e={};t.length===this.interface.deploy.inputs.length+1&&(e=t.pop()),wn.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield En(this.signer,t,this.interface.deploy.inputs);r.push(e);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=tt(this.constructor,"getContractAddress")(i),s=tt(this.constructor,"getContract")(o,this.interface,this.signer);return Mn(s,i),Q(s,"deployTransaction",i),s}))}attach(t){return this.constructor.getContract(t,this.interface,this.signer)}connect(t){return new this.constructor(this.interface,this.bytecode,t)}static fromSolidity(t,e){null==t&&wn.throwError("missing compiler output",y.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof t&&(t=JSON.parse(t));const r=t.abi;let n=null;return t.bytecode?n=t.bytecode:t.evm&&t.evm.bytecode&&(n=t.evm.bytecode),new this(r,n,e)}static getInterface(t){return On.getInterface(t)}static getContractAddress(t){return Pt(t)}static getContract(t,e,r){return new On(t,e,r)}}const Dn=new y(q),Ln={},Un=V.from(0),jn=V.from(-1);function Fn(t,e,r,n){const i={fault:e,operation:r};return void 0!==n&&(i.value=n),Dn.throwError(t,y.errors.NUMERIC_FAULT,i)}let qn="0";for(;qn.length<256;)qn+=qn;function zn(t){if("number"!=typeof t)try{t=V.from(t).toNumber()}catch(t){}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+qn.substring(0,t):Dn.throwArgumentError("invalid decimal size","decimals",t)}function Hn(t,e){null==e&&(e=0);const r=zn(e),n=(t=V.from(t)).lt(Un);n&&(t=t.mul(jn));let i=t.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=t.div(r).toString();return t=1===r.length?o:o+"."+i,n&&(t="-"+t),t}function Kn(t,e){null==e&&(e=0);const r=zn(e);"string"==typeof t&&t.match(/^-?[0-9.]+$/)||Dn.throwArgumentError("invalid decimal value","value",t);const n="-"===t.substring(0,1);n&&(t=t.substring(1)),"."===t&&Dn.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&Dn.throwArgumentError("too many decimal points","value",t);let o=i[0],s=i[1];for(o||(o="0"),s||(s="0");"0"===s[s.length-1];)s=s.substring(0,s.length-1);for(s.length>r.length-1&&Fn("fractional component exceeds decimals","underflow","parseFixed"),""===s&&(s="0");s.length<r.length-1;)s+="0";const a=V.from(o),u=V.from(s);let c=a.mul(r).add(u);return n&&(c=c.mul(jn)),c}class Gn{constructor(t,e,r,n){t!==Ln&&Dn.throwError("cannot use FixedFormat constructor; use FixedFormat.from",y.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=e,this.width=r,this.decimals=n,this.name=(e?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=zn(n),Object.freeze(this)}static from(t){if(t instanceof Gn)return t;"number"==typeof t&&(t=`fixed128x${t}`);let e=!0,r=128,n=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)e=!1;else{const i=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||Dn.throwArgumentError("invalid fixed format","format",t),e="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(t){const i=(e,r,n)=>null==t[e]?n:(typeof t[e]!==r&&Dn.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=i("signed","boolean",e),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&Dn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Dn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new Gn(Ln,e,r,n)}}class Wn{constructor(t,e,r,n){Dn.checkNew(new.target,Wn),t!==Ln&&Dn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",y.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&Dn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=Kn(this._value,this.format.decimals),r=Kn(t._value,t.format.decimals);return Wn.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=Kn(this._value,this.format.decimals),r=Kn(t._value,t.format.decimals);return Wn.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=Kn(this._value,this.format.decimals),r=Kn(t._value,t.format.decimals);return Wn.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=Kn(this._value,this.format.decimals),r=Kn(t._value,t.format.decimals);return Wn.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Wn.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(Vn.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let e=Wn.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(Vn.toFormat(e.format))),e}round(t){null==t&&(t=0);const e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&Dn.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const r=Wn.from("1"+qn.substring(0,t),this.format),n=$n.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&Dn.throwArgumentError("invalid byte width","width",t),L(V.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Wn.fromString(this._value,t)}static fromValue(t,e,r){return null!=r||null==e||function(t){return null!=t&&(V.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||I(t)||"bigint"==typeof t||S(t))}(e)||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),Wn.fromString(Hn(t,e),Gn.from(r))}static fromString(t,e){null==e&&(e="fixed");const r=Gn.from(e),n=Kn(t,r.decimals);!r.signed&&n.lt(Un)&&Fn("unsigned value cannot be negative","overflow","value",t);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=L(i,r.width/8));const o=Hn(n,r.decimals);return new Wn(Ln,i,o,r)}static fromBytes(t,e){null==e&&(e="fixed");const r=Gn.from(e);if(M(t).length>r.width/8)throw new Error("overflow");let n=V.from(t);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=Hn(n,r.decimals);return new Wn(Ln,i,o,r)}static from(t,e){if("string"==typeof t)return Wn.fromString(t,e);if(S(t))return Wn.fromBytes(t,e);try{return Wn.fromValue(t,0,e)}catch(t){if(t.code!==y.errors.INVALID_ARGUMENT)throw t}return Dn.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!(!t||!t._isFixedNumber)}}const Vn=Wn.from(1),$n=Wn.from("0.5");function Xn(t){return"string"==typeof t&&(t=Ht(t)),bt(x([Ht("Ethereum Signed Message:\n"),Ht(String(t.length)),t]))}const Yn="hash/5.6.0";const Jn=new y(Yn),Zn=new Uint8Array(32);Zn.fill(0);const Qn=V.from(-1),ti=V.from(0),ei=V.from(1),ri=V.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ni=L(ei.toHexString(),32),ii=L(ti.toHexString(),32),oi={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},si=["name","version","chainId","verifyingContract","salt"];function ai(t){return function(e){return"string"!=typeof e&&Jn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const ui={name:ai("name"),version:ai("version"),chainId:function(t){try{return V.from(t).toString()}catch(t){}return Jn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Bt(t).toLowerCase()}catch(t){}return Jn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=M(t);if(32!==e.length)throw new Error("bad length");return R(e)}catch(t){}return Jn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function ci(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))&&Jn.throwArgumentError("invalid numeric width","type",t);const i=ri.mask(r?n-1:n),o=r?i.add(ei).mul(Qn):ti;return function(e){const r=V.from(e);return(r.lt(o)||r.gt(i))&&Jn.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),L(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))&&Jn.throwArgumentError("invalid bytes width","type",t),function(e){return M(e).length!==r&&Jn.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=M(t),r=e.length%32;return r?O([e,Zn.slice(r)]):R(e)}(e)}}}switch(t){case"address":return function(t){return L(Bt(t),32)};case"bool":return function(t){return t?ni:ii};case"bytes":return function(t){return bt(t)};case"string":return function(t){return Xt(t)}}return null}function fi(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class li{constructor(t){Q(this,"types",Object.freeze(at(t))),Q(this,"_encoderCache",{}),Q(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&Jn.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&Jn.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t),ci(s)||(r[s]||Jn.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?Jn.throwArgumentError("missing primary type","types",t):i.length>1&&Jn.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),Q(this,"primaryType",i[0]),function i(o,s){s[o]&&Jn.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 e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=fi(e,t[e])+r.map((e=>fi(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=ci(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&&Jn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(bt)),bt(O(i))}}const r=this.types[t];if(r){const e=Xt(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?bt(n):n}));return n.unshift(e),O(n)}}return Jn.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||Jn.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return bt(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(ci(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&&Jn.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)),{}):Jn.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new li(t)}static getPrimaryType(t){return li.from(t).primaryType}static hashStruct(t,e,r){return li.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=oi[r];n||Jn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>si.indexOf(t.name)-si.indexOf(e.name))),li.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return O(["0x1901",li.hashDomain(t),li.from(e).hash(r)])}static hash(t,e,r){return bt(li.encode(t,e,r))}static resolveNames(t,e,r,n){return i=this,o=void 0,a=function*(){t=nt(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=li.from(e);o.visit(r,((t,e)=>("address"!==t||I(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}},new((s=void 0)||(s=Promise))((function(t,e){function r(t){try{u(a.next(t))}catch(t){e(t)}}function n(t){try{u(a.throw(t))}catch(t){e(t)}}function u(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(r,n)}u((a=a.apply(i,o||[])).next())}));var i,o,s,a}static getPayload(t,e,r){li.hashDomain(t);const n={},i=[];si.forEach((e=>{const r=t[e];null!=r&&(n[e]=ui[e](r),i.push({name:e,type:oi[e]}))}));const o=li.from(e),s=nt(e);return s.EIP712Domain?Jn.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 R(M(e));if(t.match(/^u?int/))return V.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Jn.throwArgumentError("invalid string","value",e),e}return Jn.throwArgumentError("unsupported type","type",t)}))}}}class hi{constructor(t){Q(this,"alphabet",t),Q(this,"base",t.length),Q(this,"_alphabetMap",{}),Q(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=M(t);if(0===e.length)return"";let r=[0];for(let t=0;t<e.length;++t){let n=e[t];for(let t=0;t<r.length;++t)n+=r[t]<<8,r[t]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let t=0;0===e[t]&&t<e.length-1;++t)n+=this._leader;for(let t=r.length-1;t>=0;--t)n+=this.alphabet[r[t]];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<t.length;r++){let n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r<t.length-1;++r)e.push(0);return M(new Uint8Array(e.reverse()))}}new hi("abcdefghijklmnopqrstuvwxyz234567");const di=new hi("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var pi;!function(t){t.sha256="sha256",t.sha512="sha512"}(pi||(pi={}));const mi=new y("sha2/5.6.0");function gi(t){return"0x"+hr().ripemd160().update(M(t)).digest("hex")}function bi(t){return"0x"+hr().sha256().update(M(t)).digest("hex")}function yi(t){return"0x"+hr().sha512().update(M(t)).digest("hex")}function vi(t,e,r){return pi[t]||mi.throwError("unsupported algorithm "+t,y.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+hr().hmac(hr()[t],M(e)).update(M(r)).digest("hex")}function wi(t,e,r,n,i){let o;t=M(t),e=M(e);let s=1;const a=new Uint8Array(n),u=new Uint8Array(e.length+4);let c,f;u.set(e);for(let l=1;l<=s;l++){u[e.length]=l>>24&255,u[e.length+1]=l>>16&255,u[e.length+2]=l>>8&255,u[e.length+3]=255&l;let h=M(vi(i,t,u));o||(o=h.length,f=new Uint8Array(o),s=Math.ceil(n/o),c=n-(s-1)*o),f.set(h);for(let e=1;e<r;e++){h=M(vi(i,t,h));for(let t=0;t<o;t++)f[t]^=h[t]}const d=(l-1)*o,p=l===s?c:o;a.set(M(f).slice(0,p),d)}return R(a)}const _i=new y("wordlists/5.6.0");class Ai{constructor(t){_i.checkAbstract(new.target,Ai),Q(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){const e=[];for(let r=0;r<2048;r++){const n=t.getWord(r);if(r!==t.getWordIndex(n))return"0x";e.push(n)}return Xt(e.join("\n")+"\n")}static register(t,e){e||(e=t.locale)}}let Ei=null;function Si(t){if(null==Ei&&(Ei="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Ai.check(t)))throw Ei=null,new Error("BIP39 Wordlist for en (English) FAILED")}const Mi=new class extends Ai{constructor(){super("en")}getWord(t){return Si(this),Ei[t]}getWordIndex(t){return Si(this),Ei.indexOf(t)}};Ai.register(Mi);const xi={en:Mi},ki=new y("hdnode/5.6.0"),Ti=V.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ii=Ht("Bitcoin seed"),Ci=2147483648;function Ri(t){return(1<<t)-1<<8-t}function Bi(t){return L(R(t),32)}function Ni(t){return di.encode(x([t,N(bi(bi(t)),0,4)]))}function Oi(t){if(null==t)return xi.en;if("string"==typeof t){const e=xi[t];return null==e&&ki.throwArgumentError("unknown locale","wordlist",t),e}return t}const Pi={},Di="m/44'/60'/0'/0/0";class Li{constructor(t,e,r,n,i,o,s,a){if(ki.checkNew(new.target,Li),t!==Pi)throw new Error("HDNode constructor cannot be called directly");if(e){const t=new Zr(e);Q(this,"privateKey",t.privateKey),Q(this,"publicKey",t.compressedPublicKey)}else Q(this,"privateKey",null),Q(this,"publicKey",R(r));Q(this,"parentFingerprint",n),Q(this,"fingerprint",N(gi(bi(this.publicKey)),0,4)),Q(this,"address",un(this.publicKey)),Q(this,"chainCode",i),Q(this,"index",o),Q(this,"depth",s),null==a?(Q(this,"mnemonic",null),Q(this,"path",null)):"string"==typeof a?(Q(this,"mnemonic",null),Q(this,"path",a)):(Q(this,"mnemonic",a),Q(this,"path",a.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Ni(x([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",R(this.depth),this.parentFingerprint,L(R(this.index),4),this.chainCode,null!=this.privateKey?x(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Li(Pi,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw new Error("invalid index - "+String(t));let e=this.path;e&&(e+="/"+(2147483647&t));const r=new Uint8Array(37);if(t&Ci){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(M(this.privateKey),1),e&&(e+="'")}else r.set(M(this.publicKey));for(let e=24;e>=0;e-=8)r[33+(e>>3)]=t>>24-e&255;const n=M(vi(pi.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let s=null,a=null;this.privateKey?s=Bi(V.from(i).add(this.privateKey).mod(Ti)):a=new Zr(R(i))._addPoint(this.publicKey);let u=e;const c=this.mnemonic;return c&&(u=Object.freeze({phrase:c.phrase,path:e,locale:c.locale||"en"})),new Li(Pi,s,a,this.fingerprint,Bi(o),t,this.depth+1,u)}derivePath(t){const e=t.split("/");if(0===e.length||"m"===e[0]&&0!==this.depth)throw new Error("invalid path - "+t);"m"===e[0]&&e.shift();let r=this;for(let t=0;t<e.length;t++){const n=e[t];if(n.match(/^[0-9]+'$/)){const t=parseInt(n.substring(0,n.length-1));if(t>=Ci)throw new Error("invalid path index - "+n);r=r._derive(Ci+t)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const t=parseInt(n);if(t>=Ci)throw new Error("invalid path index - "+n);r=r._derive(t)}}}return r}static _fromSeed(t,e){const r=M(t);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=M(vi(pi.sha512,Ii,r));return new Li(Pi,Bi(n.slice(0,32)),null,"0x00000000",Bi(n.slice(32)),0,0,e)}static fromMnemonic(t,e,r){return t=Fi(ji(t,r=Oi(r)),r),Li._fromSeed(Ui(t,e),{phrase:t,path:"m",locale:r.locale})}static fromSeed(t){return Li._fromSeed(t,null)}static fromExtendedKey(t){const e=di.decode(t);82===e.length&&Ni(e.slice(0,78))===t||ki.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=e[4],n=R(e.slice(5,9)),i=parseInt(R(e.slice(9,13)).substring(2),16),o=R(e.slice(13,45)),s=e.slice(45,78);switch(R(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Li(Pi,null,R(s),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new Li(Pi,R(s.slice(1)),null,n,o,i,r,null)}return ki.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Ui(t,e){e||(e="");const r=Ht("mnemonic"+e,Ut.NFKD);return wi(Ht(t,Ut.NFKD),r,2048,64,"sha512")}function ji(t,e){e=Oi(e),ki.checkNormalize();const r=e.split(t);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=M(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let t=0;t<r.length;t++){let o=e.getWordIndex(r[t].normalize("NFKD"));if(-1===o)throw new Error("invalid mnemonic");for(let t=0;t<11;t++)o&1<<10-t&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,s=Ri(r.length/3);if((M(bi(n.slice(0,o/8)))[0]&s)!=(n[n.length-1]&s))throw new Error("invalid checksum");return R(n.slice(0,o/8))}function Fi(t,e){if(e=Oi(e),(t=M(t)).length%4!=0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let e=0;e<t.length;e++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[e],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[e]>>8-n,r.push(t[e]&(1<<8-n)-1),n+=3);const i=t.length/4,o=M(bi(t))[0]&Ri(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,e.join(r.map((t=>e.getWord(t))))}function qi(t,e){try{return ji(t,e),!0}catch(t){}return!1}function zi(t){return("number"!=typeof t||t<0||t>=Ci||t%1)&&ki.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const Hi=new y("random/5.6.0"),Ki=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();let Gi=Ki.crypto||Ki.msCrypto;function Wi(t){(t<=0||t>1024||t%1||t!=t)&&Hi.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return Gi.getRandomValues(e),M(e)}Gi&&Gi.getRandomValues||(Hi.warn("WARNING: Missing strong random number source"),Gi={getRandomValues:function(t){return Hi.throwError("no secure random source avaialble",y.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Vi=r(9502),$i=r.n(Vi);const Xi="json-wallets/5.6.0";function Yi(t){return"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),M(t)}function Ji(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function Zi(t){return"string"==typeof t?Ht(t,Ut.NFKC):M(t)}function Qi(t,e){let r=t;const n=e.toLowerCase().split("/");for(let t=0;t<n.length;t++){let e=null;for(const i in r)if(i.toLowerCase()===n[t]){e=r[i];break}if(null===e)return null;r=e}return r}function to(t){const e=M(t);e[6]=15&e[6]|64,e[8]=63&e[8]|128;const r=R(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const eo=new y(Xi);class ro extends ut{isCrowdsaleAccount(t){return!(!t||!t._isCrowdsaleAccount)}}function no(t,e){const r=JSON.parse(t);e=Zi(e);const n=Bt(Qi(r,"ethaddr")),i=Yi(Qi(r,"encseed"));i&&i.length%16==0||eo.throwArgumentError("invalid encseed","json",t);const o=M(wi(e,e,2e3,32,"sha256")).slice(0,16),s=i.slice(0,16),a=i.slice(16),u=new($i().ModeOfOperation.cbc)(o,s),c=$i().padding.pkcs7.strip(M(u.decrypt(a)));let f="";for(let t=0;t<c.length;t++)f+=String.fromCharCode(c[t]);const l=bt(Ht(f));return new ro({_isCrowdsaleAccount:!0,address:n,privateKey:l})}function io(t){let e=null;try{e=JSON.parse(t)}catch(t){return!1}return e.encseed&&e.ethaddr}function oo(t){let e=null;try{e=JSON.parse(t)}catch(t){return!1}return!(!e.version||parseInt(e.version)!==e.version||3!==parseInt(e.version))}function so(t){if(io(t))try{return Bt(JSON.parse(t).ethaddr)}catch(t){return null}if(oo(t))try{return Bt(JSON.parse(t).address)}catch(t){return null}return null}var ao=r(9374),uo=r.n(ao);const co=new y(Xi);function fo(t){return null!=t&&t.mnemonic&&t.mnemonic.phrase}class lo extends ut{isKeystoreAccount(t){return!(!t||!t._isKeystoreAccount)}}function ho(t,e){const r=Yi(Qi(t,"crypto/ciphertext"));if(R(bt(x([e.slice(16,32),r]))).substring(2)!==Qi(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(t,e,r){if("aes-128-ctr"===Qi(t,"crypto/cipher")){const n=Yi(Qi(t,"crypto/cipherparams/iv")),i=new($i().Counter)(n);return M(new($i().ModeOfOperation.ctr)(e,i).decrypt(r))}return null}(t,e.slice(0,16),r);n||co.throwError("unsupported cipher",y.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=e.slice(32,64),o=un(n);if(t.address){let e=t.address.toLowerCase();if("0x"!==e.substring(0,2)&&(e="0x"+e),Bt(e)!==o)throw new Error("address mismatch")}const s={_isKeystoreAccount:!0,address:o,privateKey:R(n)};if("0.1"===Qi(t,"x-ethers/version")){const e=Yi(Qi(t,"x-ethers/mnemonicCiphertext")),r=Yi(Qi(t,"x-ethers/mnemonicCounter")),n=new($i().Counter)(r),o=new($i().ModeOfOperation.ctr)(i,n),a=Qi(t,"x-ethers/path")||Di,u=Qi(t,"x-ethers/locale")||"en",c=M(o.decrypt(e));try{const t=Fi(c,u),e=Li.fromMnemonic(t,null,u).derivePath(a);if(e.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=e.mnemonic}catch(t){if(t.code!==y.errors.INVALID_ARGUMENT||"wordlist"!==t.argument)throw t}}return new lo(s)}function po(t,e,r,n,i){return M(wi(t,e,r,n,i))}function mo(t,e,r,n,i){return Promise.resolve(po(t,e,r,n,i))}function go(t,e,r,n,i){const o=Zi(e),s=Qi(t,"crypto/kdf");if(s&&"string"==typeof s){const e=function(t,e){return co.throwArgumentError("invalid key-derivation function parameters",t,e)};if("scrypt"===s.toLowerCase()){const r=Yi(Qi(t,"crypto/kdfparams/salt")),a=parseInt(Qi(t,"crypto/kdfparams/n")),u=parseInt(Qi(t,"crypto/kdfparams/r")),c=parseInt(Qi(t,"crypto/kdfparams/p"));a&&u&&c||e("kdf",s),0!=(a&a-1)&&e("N",a);const f=parseInt(Qi(t,"crypto/kdfparams/dklen"));return 32!==f&&e("dklen",f),n(o,r,a,u,c,64,i)}if("pbkdf2"===s.toLowerCase()){const n=Yi(Qi(t,"crypto/kdfparams/salt"));let i=null;const s=Qi(t,"crypto/kdfparams/prf");"hmac-sha256"===s?i="sha256":"hmac-sha512"===s?i="sha512":e("prf",s);const a=parseInt(Qi(t,"crypto/kdfparams/c")),u=parseInt(Qi(t,"crypto/kdfparams/dklen"));return 32!==u&&e("dklen",u),r(o,n,a,u,i)}}return co.throwArgumentError("unsupported key-derivation function","kdf",s)}function bo(t,e,r){if(io(t)){r&&r(0);const n=no(t,e);return r&&r(1),Promise.resolve(n)}return oo(t)?function(t,e,r){return n=this,i=void 0,s=function*(){const n=JSON.parse(t);return ho(n,yield go(n,e,mo,uo().scrypt,r))},new((o=void 0)||(o=Promise))((function(t,e){function r(t){try{u(s.next(t))}catch(t){e(t)}}function a(t){try{u(s.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,a)}u((s=s.apply(n,i||[])).next())}));var n,i,o,s}(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}var yo=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 vo=new y("wallet/5.6.0");class wo extends ar{constructor(t,e){if(vo.checkNew(new.target,wo),super(),null!=(r=t)&&I(r.privateKey,32)&&null!=r.address){const e=new Zr(t.privateKey);if(Q(this,"_signingKey",(()=>e)),Q(this,"address",un(this.publicKey)),this.address!==Bt(t.address)&&vo.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(t){const e=t.mnemonic;return e&&e.phrase}(t)){const e=t.mnemonic;Q(this,"_mnemonic",(()=>({phrase:e.phrase,path:e.path||Di,locale:e.locale||"en"})));const r=this.mnemonic;un(Li.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&vo.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else Q(this,"_mnemonic",(()=>null))}else{if(Zr.isSigningKey(t))"secp256k1"!==t.curve&&vo.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),Q(this,"_signingKey",(()=>t));else{"string"==typeof t&&t.match(/^[0-9a-f]*$/i)&&64===t.length&&(t="0x"+t);const e=new Zr(t);Q(this,"_signingKey",(()=>e))}Q(this,"_mnemonic",(()=>null)),Q(this,"address",un(this.publicKey))}var r;e&&!rr.isProvider(e)&&vo.throwArgumentError("invalid provider","provider",e),Q(this,"provider",e||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(t){return new wo(this,t)}signTransaction(t){return et(t).then((e=>{null!=e.from&&(Bt(e.from)!==this.address&&vo.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete e.from);const r=this._signingKey().signDigest(bt(gn(e)));return gn(e,r)}))}signMessage(t){return yo(this,void 0,void 0,(function*(){return j(this._signingKey().signDigest(Xn(t)))}))}_signTypedData(t,e,r){return yo(this,void 0,void 0,(function*(){const n=yield li.resolveNames(t,e,r,(t=>(null==this.provider&&vo.throwError("cannot resolve ENS names without a provider",y.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:t}),this.provider.resolveName(t))));return j(this._signingKey().signDigest(li.hash(n.domain,e,n.value)))}))}encrypt(t,e,r){if("function"!=typeof e||r||(r=e,e={}),r&&"function"!=typeof r)throw new Error("invalid callback");return e||(e={}),function(t,e,r,n){try{if(Bt(t.address)!==un(t.privateKey))throw new Error("address/privateKey mismatch");if(fo(t)){const e=t.mnemonic;if(Li.fromMnemonic(e.phrase,null,e.locale).derivePath(e.path||Di).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(t){return Promise.reject(t)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=M(t.privateKey),o=Zi(e);let s=null,a=null,u=null;if(fo(t)){const e=t.mnemonic;s=M(ji(e.phrase,e.locale||"en")),a=e.path||Di,u=e.locale||"en"}let c=r.client;c||(c="ethers.js");let f=null;f=r.salt?M(r.salt):Wi(32);let l=null;if(r.iv){if(l=M(r.iv),16!==l.length)throw new Error("invalid iv")}else l=Wi(16);let h=null;if(r.uuid){if(h=M(r.uuid),16!==h.length)throw new Error("invalid uuid")}else h=Wi(16);let d=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(d=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),uo().scrypt(o,f,d,p,m,64,n).then((e=>{const r=(e=M(e)).slice(0,16),n=e.slice(16,32),o=e.slice(32,64),g=new($i().Counter)(l),b=M(new($i().ModeOfOperation.ctr)(r,g).encrypt(i)),y=bt(x([n,b])),v={address:t.address.substring(2).toLowerCase(),id:to(h),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:R(l).substring(2)},ciphertext:R(b).substring(2),kdf:"scrypt",kdfparams:{salt:R(f).substring(2),n:d,dklen:32,p:m,r:p},mac:y.substring(2)}};if(s){const t=Wi(16),e=new($i().Counter)(t),r=M(new($i().ModeOfOperation.ctr)(o,e).encrypt(s)),n=new Date,i=n.getUTCFullYear()+"-"+Ji(n.getUTCMonth()+1,2)+"-"+Ji(n.getUTCDate(),2)+"T"+Ji(n.getUTCHours(),2)+"-"+Ji(n.getUTCMinutes(),2)+"-"+Ji(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:c,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:R(t).substring(2),mnemonicCiphertext:R(r).substring(2),path:a,locale:u,version:"0.1"}}return JSON.stringify(v)}))}(this,t,e,r)}static createRandom(t){let e=Wi(16);t||(t={}),t.extraEntropy&&(e=M(N(bt(x([e,t.extraEntropy])),0,16)));const r=Fi(e,t.locale);return wo.fromMnemonic(r,t.path,t.locale)}static fromEncryptedJson(t,e,r){return bo(t,e,r).then((t=>new wo(t)))}static fromEncryptedJsonSync(t,e){return new wo(function(t,e){if(io(t))return no(t,e);if(oo(t))return function(t,e){const r=JSON.parse(t);return ho(r,go(r,e,po,uo().syncScrypt))}(t,e);throw new Error("invalid JSON wallet")}(t,e))}static fromMnemonic(t,e,r){return e||(e=Di),new wo(Li.fromMnemonic(t,null,r).derivePath(e))}}function _o(t,e){return cn(Xn(t),e)}function Ao(t,e,r,n){return cn(li.hash(t,e,r),n)}const Eo="0x0000000000000000000000000000000000000000",So="0x0000000000000000000000000000000000000000000000000000000000000000",Mo="Ξ",xo=new y("networks/5.6.1");function ko(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(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const r=["goerli","ropsten","rinkeby"];try{const i=new e.PocketProvider(t);i.network&&-1===r.indexOf(i.network.name)&&n.push(i)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{n.push(new e.AnkrProvider(t,r.ankr))}catch(t){}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 ko(t)},e}function To(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return To(t,e)},r}const Io={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ko("homestead")},Co={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ko("ropsten")},Ro={chainId:63,name:"classicMordor",_defaultProvider:To("https://www.ethercluster.com/mordor","classicMordor")},Bo={unspecified:{chainId:0,name:"unspecified"},homestead:Io,mainnet:Io,morden:{chainId:2,name:"morden"},ropsten:Co,testnet:Co,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ko("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ko("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ko("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:To("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Ro,classicTestnet:Ro,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:To("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic"},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"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"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function No(t){if(null==t)return null;if("number"==typeof t){for(const e in Bo){const r=Bo[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=Bo[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=Bo[t.name];if(!e)return"number"!=typeof t.chainId&&xo.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&xo.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}}function Oo(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,n={};return t.split(",").forEach((t=>{let i=t.split(":");r+=parseInt(i[0],16),n[r]=e(i[1])})),n}function Po(t){let e=0;return t.split(",").map((t=>{let r=t.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=e+parseInt(r[0],16);return e=parseInt(r[1],16),{l:n,h:e}}))}function Do(t,e){let r=0;for(let n=0;n<e.length;n++){let i=e[n];if(r+=i.l,t>=r&&t<=r+i.h&&(t-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(t-r))continue;return i}}return null}const Lo=Po("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Uo="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((t=>parseInt(t,16))),jo=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Fo=Oo("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),qo=Oo("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),zo=Oo("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(t){if(t.length%4!=0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e})),Ho=Po("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Ko(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=$t(t);var r;r=e.map((t=>{if(Uo.indexOf(t)>=0)return[];if(t>=65024&&t<=65039)return[];let e=function(t){let e=Do(t,jo);if(e)return[t+e.s];let r=Fo[t];if(r)return r;let n=qo[t];return n?[t+n[0]]:zo[t]||null}(t);return e||[t]})),e=r.reduce(((t,e)=>(e.forEach((e=>{t.push(e)})),t)),[]),e=$t(Wt(e),Ut.NFKC),e.forEach((t=>{if(Do(t,Ho))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),e.forEach((t=>{if(Do(t,Lo))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Wt(e);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}const Go=new y(Yn),Wo=new Uint8Array(32);Wo.fill(0);const Vo=new RegExp("^((.*)\\.)?([^.]+)$");function $o(t){try{const e=t.split(".");for(let t=0;t<e.length;t++)if(0===Ko(e[t]).length)throw new Error("empty");return!0}catch(t){}return!1}function Xo(t){"string"!=typeof t&&Go.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Wo;for(;e.length;){const n=e.match(Vo);null!=n&&""!==n[2]||Go.throwArgumentError("invalid ENS address; missing component","name",t),r=bt(x([r,bt(Ht(Ko(n[3])))])),e=n[2]||""}return R(r)}function Yo(t){return R(x(t.split(".").map((t=>{const e=Ht("_"+Ko(t));return e[0]=e.length-1,e}))))+"00"}function Jo(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return M(e)}function Zo(t){t=M(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Qo(t,e){return r=this,n=void 0,o=function*(){null==e&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(t,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((t,e)=>{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:M(new Uint8Array(i))}},new((i=void 0)||(i=Promise))((function(t,e){function s(t){try{u(o.next(t))}catch(t){e(t)}}function a(t){try{u(o.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(s,a)}u((o=o.apply(r,n||[])).next())}));var r,n,i,o}const ts=new y("web/5.6.0");function es(t){return new Promise((e=>{setTimeout(e,t)}))}function rs(t,e){if(null==t)return null;if("string"==typeof t)return t;if(A(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return Vt(t)}catch(t){}return R(t)}return t}function ns(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;ts.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;ts.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 f=!1,l=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||ts.throwArgumentError("missing URL","connection.url",t),u=t.url,"number"==typeof t.timeout&&t.timeout>0&&(l=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&&(f=!0);if(c.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&ts.throwError("basic authentication requires a secure https url",y.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+Zo(Ht(e))}}null!=t.skipFetchSetup&&(c.skipFetchSetup=!!t.skipFetchSetup)}const h=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(h):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:Jo(d[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){ts.throwError("processing response error",y.errors.SERVER_ERROR,{body:rs(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}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 p={};Object.keys(a).forEach((t=>{const e=a[t];p[e.key]=e.value})),c.headers=p;const m=function(){let t=null;return{promise:new Promise((function(e,r){l&&(t=setTimeout((()=>{null!=t&&(t=null,r(ts.makeError("timeout",y.errors.TIMEOUT,{requestBody:rs(c.body,p["content-type"]),requestMethod:c.method,timeout:l,url:u})))}),l))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return t=this,e=void 0,l=function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield Qo(u,c),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===c.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(i&&(r=yield i(t,u)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,t))),yield es(r);continue}}}catch(t){e=t.response,null==e&&(m.cancel(),ts.throwError("missing response",y.errors.SERVER_ERROR,{requestBody:rs(c.body,p["content-type"]),requestMethod:c.method,serverError:t,url:u}))}let a=e.body;if(f&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(m.cancel(),ts.throwError("bad response",y.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:rs(a,e.headers?e.headers["content-type"]:null),requestBody:rs(c.body,p["content-type"]),requestMethod:c.method,url:u})),r)try{const t=yield r(a,e);return m.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield es(e);continue}}m.cancel(),ts.throwError("processing response error",y.errors.SERVER_ERROR,{body:rs(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:rs(c.body,p["content-type"]),requestMethod:c.method,url:u})}return m.cancel(),a}return ts.throwError("failed response",y.errors.SERVER_ERROR,{requestBody:rs(c.body,p["content-type"]),requestMethod:c.method,url:u})},new((a=void 0)||(a=Promise))((function(r,n){function i(t){try{s(l.next(t))}catch(t){n(t)}}function o(t){try{s(l.throw(t))}catch(t){n(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(i,o)}s((l=l.apply(t,e||[])).next())}));var t,e,a,l}();return Promise.race([m.promise,g])}function is(t,e,r){let n=null;if(null!=e){n=Ht(e);const r="string"==typeof t?{url:t}:nt(t);r.headers?0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=nt(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},t=r}return ns(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(Vt(t))}catch(e){ts.throwError("invalid JSON",y.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function os(t,e){return e||(e={}),null==(e=nt(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)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}var ss=r(3863),as=r.n(ss);const us="providers/5.6.2",cs=new y(us);class fs{constructor(){cs.checkNew(new.target,fs),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:fs.allowNull(this.accessList.bind(this),null),blockHash:fs.allowNull(o,null),blockNumber:fs.allowNull(a,null),transactionIndex:fs.allowNull(a,null),confirmations:fs.allowNull(a,null),from:e,gasPrice:fs.allowNull(r),maxPriorityFeePerGas:fs.allowNull(r),maxFeePerGas:fs.allowNull(r),gasLimit:r,to:fs.allowNull(e,null),value:r,nonce:a,data:i,r:fs.allowNull(this.uint256),s:fs.allowNull(this.uint256),v:fs.allowNull(a),creates:fs.allowNull(e,null),raw:fs.allowNull(i)},t.transactionRequest={from:fs.allowNull(e),nonce:fs.allowNull(a),gasLimit:fs.allowNull(r),gasPrice:fs.allowNull(r),maxPriorityFeePerGas:fs.allowNull(r),maxFeePerGas:fs.allowNull(r),to:fs.allowNull(e),value:fs.allowNull(r),data:fs.allowNull((t=>this.data(t,!0))),type:fs.allowNull(a),accessList:fs.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:fs.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:fs.allowNull(this.address,null),from:fs.allowNull(this.address,null),contractAddress:fs.allowNull(e,null),transactionIndex:a,root:fs.allowNull(s),gasUsed:r,logsBloom:fs.allowNull(i),blockHash:o,transactionHash:o,logs:fs.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:fs.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:fs.allowNull(r),status:fs.allowNull(a),type:u},t.block={hash:fs.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:fs.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:fs.allowNull(e),extraData:i,transactions:fs.allowNull(fs.arrayOf(o)),baseFeePerGas:fs.allowNull(r)},t.blockWithTransactions=nt(t.block),t.blockWithTransactions.transactions=fs.allowNull(fs.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:fs.allowNull(n,void 0),toBlock:fs.allowNull(n,void 0),blockHash:fs.allowNull(o,void 0),address:fs.allowNull(e,void 0),topics:fs.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:fs.allowNull(a),blockHash:fs.allowNull(o),transactionIndex:a,removed:fs.allowNull(this.boolean.bind(this)),address:e,data:fs.allowFalsish(i,"0x"),topics:fs.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return hn(t||[])}number(t){return"0x"===t?0:V.from(t).toNumber()}type(t){return"0x"===t||null==t?0:V.from(t).toNumber()}bigNumber(t){return V.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),I(t))?t.toLowerCase():cs.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 Bt(t)}callAddress(t){if(!I(t,32))return null;const e=Bt(N(t,12));return e===Eo?null:e}contractAddress(t){return Pt(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||I(t))return P(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==B(r)?cs.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=V.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!I(t))throw new Error("invalid uint256");return L(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=fs.check(e,t);return n._difficulty=null==r?null:V.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return fs.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&V.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=fs.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;I(r)&&(r=V.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),I(r)&&(r=V.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 yn(t)}receiptLog(t){return fs.check(this.formats.receiptLog,t)}receipt(t){const e=fs.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=V.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&cs.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):cs.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&cs.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 fs.check(this.formats.filter,t)}filterLog(t){return fs.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}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}}}function ls(t){return t&&"function"==typeof t.isCommunityResource}function hs(t){return ls(t)&&t.isCommunityResource()}let ds=!1;function ps(){ds||(ds=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded  (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var ms=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 gs=new y(us);function bs(t){return null==t?"null":(32!==B(t)&&gs.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function ys(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[bs(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return bs(t)})).join("&")}function vs(t){if("string"==typeof t){if(32===B(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+ys(t);if(er.isForkEvent(t))throw gs.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+ys(t.topics||[])}throw new Error("invalid event - "+t)}function ws(){return(new Date).getTime()}function _s(t){return new Promise((e=>{setTimeout(e,t)}))}const As=["block","network","pending","poll"];class Es{constructor(t,e,r){Q(this,"tag",t),Q(this,"listener",e),Q(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||As.indexOf(this.tag)>=0}}const Ss={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 Ms(t){return L(V.from(t).toHexString(),32)}function xs(t){return di.encode(x([t,N(bi(bi(t)),0,4)]))}const ks=new RegExp("^(ipfs)://(.*)$","i"),Ts=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ks,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Is(t,e){try{return Vt(Cs(t,e))}catch(t){}return null}function Cs(t,e){if("0x"===t)return null;const r=V.from(N(t,e,e+32)).toNumber(),n=V.from(N(t,r,r+32)).toNumber();return N(t,r+32,r+32+n)}function Rs(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):gs.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Bs(t){const e=M(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 Ns(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function Os(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=M(t[n]);e[n]=Bs(r),e.push(Bs(i.length)),e.push(Ns(i)),r+=32+32*Math.ceil(i.length/32)}return O(e)}class Ps{constructor(t,e,r,n){Q(this,"provider",t),Q(this,"name",r),Q(this,"address",t.formatter.address(e)),Q(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>V.from(t).eq(1))).catch((t=>{if(t.code===y.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return ms(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:O([t,Xo(this.name),e||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=O(["0x9061b923",Os([Yo(this.name),r.data])]));try{let t=yield this.provider.call(r);return M(t).length%32==4&&gs.throwError("resolver threw error",y.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=Cs(t,0)),t}catch(t){if(t.code===y.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return ms(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?Cs(r,0):null}))}_getAddress(t,e){const r=Ss[String(t)];if(null==r&&gs.throwError(`unsupported coin type: ${t}`,y.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=M(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 xs(x([[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 xs(x([[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=as().toWords(n.slice(2));return t.unshift(e),as().encode(r.prefix,t)}}return null}getAddress(t){return ms(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||t===So?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===y.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",Ms(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&gs.throwError("invalid or unsupported coin data",y.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return ms(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;r<Ts.length;r++){const n=e.match(Ts[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:Rs(e)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),u=L(V.from(s[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:O(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=V.from(yield this.provider.call({to:a,data:O(["0x00fdd58e",L(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const c={to:this.provider.formatter.address(s[0]),data:O([r,u])};let f=Is(yield this.provider.call(c),0);if(null==f)return null;t.push({type:"metadata-url-base",content:f}),"erc1155"===i&&(f=f.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:f})),f.match(/^ipfs:/i)&&(f=Rs(f)),t.push({type:"metadata-url",content:f});const l=yield is(f);if(!l)return null;t.push({type:"metadata",content:JSON.stringify(l)});let h=l.image;if("string"!=typeof h)return null;if(h.match(/^(https:\/\/|data:)/i));else{if(null==h.match(ks))return null;t.push({type:"url-ipfs",content:h}),h=Rs(h)}return t.push({type:"url",content:h}),{linkage:t,url:h}}}}}catch(t){}return null}))}getContentHash(){return ms(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+di.encode("0x"+e[1])}const r=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const t=parseInt(r[3],16);if(r[4].length===2*t)return"ipns://"+di.encode("0x"+r[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);return n&&64===n[1].length?"bzz://"+n[1]:gs.throwError("invalid or unsupported content hash data",y.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return ms(this,void 0,void 0,(function*(){let e=Ht(t);e=x([Ms(64),Ms(e.length),e]),e.length%32!=0&&(e=x([e,L("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",R(e));return null==r||"0x"===r?null:Vt(r)}))}}let Ds=null,Ls=1;class Us extends rr{constructor(t){if(gs.checkNew(new.target,rr),super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Q(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=tt(new.target,"getNetwork")(t);e?(Q(this,"_network",e),this.emit("network",e,null)):gs.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ms(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||gs.throwError("no network detected",y.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:Q(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return os((()=>this._ready().then((t=>t),(t=>{if(t.code!==y.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Ds&&(Ds=new fs),Ds}static getNetwork(t){return No(null==t?"homestead":t)}ccipReadFetch(t,e,r){return ms(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<r.length;t++){const e=r[t],s=e.replace("{sender}",n).replace("{data}",i),a=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),u=yield is({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 gs.throwError(`response not found during CCIP fetch: ${c}`,y.errors.SERVER_ERROR,{url:e,errorMessage:c});o.push(c)}return gs.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,y.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return ms(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(ws()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=ws(),r=et({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=ws();return(t=V.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=r,r.catch((t=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return ms(this,void 0,void 0,(function*(){const t=Ls++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}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)gs.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",gs.makeError("network block skew detected",y.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;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=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(i)}}})),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 ms(this,void 0,void 0,(function*(){return gs.throwError("provider does not support network detection",y.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return ms(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 _s(0),this._network;const r=gs.makeError("underlying network changed",y.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=ws();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&&t<this._fastBlockNumber||(this._fastQueryDate=ws(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return ms(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return ms(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<e||u()||i(t)};if(this.on(t,c),s.push((()=>{this.removeListener(t,c)})),n){let r=n.startBlock,i=null;const c=s=>ms(this,void 0,void 0,(function*(){a||(yield _s(1e3),this.getTransactionCount(n.from).then((f=>ms(this,void 0,void 0,(function*(){if(!a){if(f<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===t)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,e);if(u())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(gs.makeError("transaction was replaced",y.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:t,receipt:r}))}}i++}}a||this.once("block",c)}}))),(t=>{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(gs.makeError("timeout exceeded",y.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return ms(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return V.from(t)}catch(e){return gs.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield et({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return V.from(n)}catch(t){return gs.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield et({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return V.from(n).toNumber()}catch(t){return gs.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield et({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return R(n)}catch(t){return gs.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield et({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>P(t)))}),i=yield this.perform("getStorageAt",n);try{return R(i)}catch(t){return gs.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==B(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&gs.throwError("Transaction hash mismatch from Provider.sendTransaction.",y.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>ms(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&&gs.throwError("transaction failed",y.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>R(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(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return ms(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?V.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?R(t):null)))})),this.formatter.transactionRequest(yield et(r))}))}_getFilter(t){return ms(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 et(e))}))}_call(t,e,r){return ms(this,void 0,void 0,(function*(){r>=10&&gs.throwError("CCIP read exceeded maximum redirections",y.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)&&B(i)%32==4)try{const o=N(i,4),s=N(o,0,32);V.from(s).eq(n)||gs.throwError("CCIP Read sender did not match",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=V.from(N(o,32,64)).toNumber(),c=V.from(N(o,u,u+32)).toNumber(),f=N(o,u+32);for(let e=0;e<c;e++){const r=Is(f,32*e);null==r&&gs.throwError("CCIP Read contained corrupt URL string",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),a.push(r)}const l=Cs(o,64);V.from(N(o,100,128)).isZero()||gs.throwError("CCIP Read callback selector included junk",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const h=N(o,96,100),d=Cs(o,128),p=yield this.ccipReadFetch(t,l,a);null==p&&gs.throwError("CCIP Read disabled or provided no URLs",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const m={to:n,data:O([h,Os([p,d])])};return this._call(m,e,r+1)}catch(t){if(t.code===y.errors.SERVER_ERROR)throw t}try{return R(i)}catch(r){return gs.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:r})}}))}call(t,e){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield et({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(t){return ms(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield et({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return V.from(r)}catch(t){return gs.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return ms(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&gs.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&gs.throwError("ENS name not configured",y.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return ms(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(I(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),I(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){gs.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return os((()=>ms(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 r=0;r<t.transactions.length;r++){const n=t.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}}const r=this.formatter.blockWithTransactions(t);return r.transactions=r.transactions.map((t=>this._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 ms(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return os((()=>ms(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 ms(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return os((()=>ms(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 ms(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield et({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),fs.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return ms(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return ms(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&gs.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 ms(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 Ps(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return ms(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||gs.throwError("network does not support ENS",y.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Xo(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return ms(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(I(t))throw e}"string"!=typeof t&&gs.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return ms(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=Is(yield this.call({to:r,data:"0x691f3431"+Xo(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return ms(this,void 0,void 0,(function*(){let e=null;if(I(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new Ps(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==y.errors.CALL_EXCEPTION)throw t}try{const t=Is(yield this.call({to:n,data:"0x691f3431"+Xo(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==y.errors.CALL_EXCEPTION)throw t;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 gs.throwError(t+" not implemented",y.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 Es(vs(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=vs(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=vs(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=vs(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=vs(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=vs(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var js=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 Fs=new y(us),qs=["call","estimateGas"];function zs(t){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")&&I(t.data))return{message:t.message,data:t.data};if("object"==typeof t){for(const e in t){const r=zs(t[e]);if(r)return r}return null}if("string"==typeof t)try{return zs(JSON.parse(t))}catch(t){}return null}function Hs(t,e,r){if("call"===t){const t=zs(e);if(t)return t.data;Fs.throwError("missing revert data in call exception",y.errors.CALL_EXCEPTION,{error:e,data:"0x"})}let n=e.message;e.code===y.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?n=e.error.message:"string"==typeof e.body?n=e.body:"string"==typeof e.responseText&&(n=e.responseText),n=(n||"").toLowerCase();const i=r.transaction||r.signedTransaction;throw n.match(/insufficient funds|base fee exceeds gas limit/)&&Fs.throwError("insufficient funds for intrinsic transaction cost",y.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:i}),n.match(/nonce too low/)&&Fs.throwError("nonce has already been used",y.errors.NONCE_EXPIRED,{error:e,method:t,transaction:i}),n.match(/replacement transaction underpriced/)&&Fs.throwError("replacement fee too low",y.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:i}),n.match(/only replay-protected/)&&Fs.throwError("legacy pre-eip-155 transactions not supported",y.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:i}),qs.indexOf(t)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Fs.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:i}),e}function Ks(t){return new Promise((function(e){setTimeout(e,t)}))}function Gs(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 Ws(t){return t?t.toLowerCase():t}const Vs={};class $s extends ar{constructor(t,e,r){if(Fs.checkNew(new.target,$s),super(),t!==Vs)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Q(this,"provider",e),null==r&&(r=0),"string"==typeof r?(Q(this,"_address",this.provider.formatter.address(r)),Q(this,"_index",null)):"number"==typeof r?(Q(this,"_index",r),Q(this,"_address",null)):Fs.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return Fs.throwError("cannot alter JSON-RPC Signer connection",y.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Xs(Vs,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&&Fs.throwError("unknown account #"+this._index,y.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=nt(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=nt(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>js(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&Fs.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),et({tx:et(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&Fs.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=>Hs("sendTransaction",t,n)))}))}signTransaction(t){return Fs.throwError("signing transactions is unsupported",y.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return js(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 os((()=>js(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(t){throw t.transactionHash=r,t}}))}signMessage(t){return js(this,void 0,void 0,(function*(){const e="string"==typeof t?Ht(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[R(e),r.toLowerCase()])}))}_legacySignMessage(t){return js(this,void 0,void 0,(function*(){const e="string"==typeof t?Ht(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),R(e)])}))}_signTypedData(t,e,r){return js(this,void 0,void 0,(function*(){const n=yield li.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(li.getPayload(n.domain,e,n.value))])}))}unlock(t){return js(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class Xs extends $s{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 Ys={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Js extends Us{constructor(t,e){Fs.checkNew(new.target,Js);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=tt(this.constructor,"defaultUrl")()),Q(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(nt(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 js(this,void 0,void 0,(function*(){yield Ks(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=tt(this.constructor,"getNetwork");try{return e(V.from(t).toNumber())}catch(e){return Fs.throwError("could not detect network",y.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return Fs.throwError("could not detect network",y.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new $s(Vs,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:at(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=is(this.connection,JSON.stringify(r),Gs).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",[Ws(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Ws(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Ws(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Ws(e.address),e.position,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",[tt(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[tt(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Ws(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return js(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&V.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=nt(e)).transaction=nt(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&Fs.throwError(t+" not implemented",y.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return Hs(t,r,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 Ks(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=nt(Ys);if(e)for(const t in e)e[t]&&(r[t]=!0);rt(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=P(t[e]);"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=R(t[e]))})),t.accessList&&(n.accessList=hn(t.accessList)),n}}let Zs=null;try{if(Zs=WebSocket,null==Zs)throw new Error("inject please")}catch(t){const e=new y(us);Zs=function(){e.throwError("WebSockets not supported in this environment",y.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Qs=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 ta=new y(us);let ea=1;class ra extends Js{constructor(t,e){"any"===e&&ta.throwError("WebSocketProvider does not support 'any' network yet",y.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof t?t:"_websocket",e),this._pollingInterval=-1,this._wsReady=!1,Q(this,"_websocket","string"==typeof t?new Zs(this.connection.url):t),Q(this,"_requests",{}),Q(this,"_subs",{}),Q(this,"_subIds",{}),Q(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((t=>{this.websocket.send(this._requests[t].payload)}))},this.websocket.onmessage=t=>{const e=t.data,r=JSON.parse(e);if(null!=r.id){const t=String(r.id),n=this._requests[t];if(delete this._requests[t],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let t=null;r.error?(t=new Error(r.error.message||"unknown error"),Q(t,"code",r.error.code||null),Q(t,"response",e)):t=new Error("unknown error"),n.callback(t,void 0),this.emit("debug",{action:"response",error:t,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const t=this._subs[r.params.subscription];t&&t.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){ta.throwError("cannot reset events block on WebSocketProvider",y.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){ta.throwError("cannot set polling interval on WebSocketProvider",y.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Qs(this,void 0,void 0,(function*(){return null}))}set polling(t){t&&ta.throwError("cannot set polling on WebSocketProvider",y.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,e){const r=ea++;return new Promise(((n,i)=>{const o=JSON.stringify({method:t,params:e,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(t,e){return t?i(t):n(e)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,e,r){return Qs(this,void 0,void 0,(function*(){let n=this._subIds[t];null==n&&(n=Promise.all(e).then((t=>this.send("eth_subscribe",t))),this._subIds[t]=n);const i=yield n;this._subs[i]={tag:t,processFunc:r}}))}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],(t=>{const e=V.from(t.number).toNumber();this._emitted.block=e,this.emit("block",e)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(t=>{this.emit("pending",t)}));break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],(e=>{null==e.removed&&(e.removed=!1),this.emit(t.filter,this.formatter.filterLog(e))}));break;case"tx":{const e=t=>{const e=t.hash;this.getTransactionReceipt(e).then((t=>{t&&this.emit(e,t)}))};e(t),this._subscribe("tx",["newHeads"],(t=>{this._events.filter((t=>"tx"===t.type)).forEach(e)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t)}}_stopEvent(t){let e=t.tag;if("tx"===t.type){if(this._events.filter((t=>"tx"===t.type)).length)return;e="tx"}else if(this.listenerCount(t.event))return;const r=this._subIds[e];r&&(delete this._subIds[e],r.then((t=>{this._subs[t]&&(delete this._subs[t],this.send("eth_unsubscribe",[t]))})))}destroy(){return Qs(this,void 0,void 0,(function*(){this.websocket.readyState===Zs.CONNECTING&&(yield new Promise((t=>{this.websocket.onopen=function(){t(!0)},this.websocket.onerror=function(){t(!1)}}))),this.websocket.close(1e3)}))}}const na=new y(us);class ia extends Js{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return e=this,r=void 0,i=function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||na.throwError("no network detected",y.errors.UNKNOWN_ERROR,{}),null==this._network&&(Q(this,"_network",e),this.emit("network",e,null))),e},new((n=void 0)||(n=Promise))((function(t,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(s,a)}u((i=i.apply(e,r||[])).next())}));var e,r,n,i}}class oa extends ia{constructor(t,e){na.checkAbstract(new.target,oa),t=tt(new.target,"getNetwork")(t),e=tt(new.target,"getApiKey")(e),super(tt(new.target,"getUrl")(t,e),t),"string"==typeof e?Q(this,"apiKey",e):null!=e&&Object.keys(e).forEach((t=>{Q(this,t,e[t])}))}_startPending(){na.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return na.throwError("API provider does not support signing",y.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,e){return na.throwError("not implemented; sub-classes must override getUrl",y.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const sa=new y(us),aa="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class ua extends ra{constructor(t,e){const r=new ca(t,e);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),Q(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===aa}}class ca extends oa{static getWebSocketProvider(t,e){return new ua(t,e)}static getApiKey(t){return null==t?aa:(t&&"string"!=typeof t&&sa.throwArgumentError("invalid apiKey","apiKey",t),t)}static getUrl(t,e){let r=null;switch(t.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-rinkeby":r="arb-rinkeby.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":r="opt-kovan.g.alchemy.com/v2/";break;default:sa.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+e,throttleCallback:(t,r)=>(e===aa&&ps(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===aa}}const fa=new y(us),la="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function ha(t){switch(t){case"homestead":return"rpc.ankr.com/eth/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return fa.throwArgumentError("unsupported network","name",t)}class da extends oa{isCommunityResource(){return this.apiKey===la}static getApiKey(t){return null==t?la:t}static getUrl(t,e){null==e&&(e=la);const r={allowGzip:!0,url:"https://"+ha(t.name)+e,throttleCallback:(t,r)=>(e.apiKey===la&&ps(),Promise.resolve(!0))};return null!=e.projectSecret&&(r.user="",r.password=e.projectSecret),r}}const pa=new y(us);class ma extends oa{static getApiKey(t){return null!=t&&pa.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}static getUrl(t,e){let r=null;return"homestead"===t.name?r="https://cloudflare-eth.com/":pa.throwArgumentError("unsupported network","network",arguments[0]),r}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return n=this,i=void 0,s=function*(){return"getBlockNumber"===t?(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number:r.perform.call(this,t,e)},new((o=void 0)||(o=Promise))((function(t,e){function r(t){try{u(s.next(t))}catch(t){e(t)}}function a(t){try{u(s.throw(t))}catch(t){e(t)}}function u(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(r,a)}u((s=s.apply(n,i||[])).next())}));var n,i,o,s}}var ga=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 ba=new y(us);function ya(t){const e={};for(let r in t){if(null==t[r])continue;let n=t[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?P(R(n)):"accessList"===r?"["+hn(n).map((t=>`{address:"${t.address}",storageKeys:["${t.storageKeys.join('","')}"]}`)).join(",")+"]":R(n),e[r]=n)}return e}function va(t){if(0==t.status&&("No records found"===t.message||"No transactions found"===t.message))return t.result;if(1!=t.status||"OK"!=t.message){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function wa(t){if(t&&0==t.status&&"NOTOK"==t.message&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if("2.0"!=t.jsonrpc){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function _a(t){if("pending"===t)throw new Error("pending not supported");return"latest"===t?t:parseInt(t.substring(2),16)}const Aa="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function Ea(t,e,r){if("call"===t&&e.code===y.errors.SERVER_ERROR){const t=e.error;if(t&&(t.message.match(/reverted/i)||t.message.match(/VM execution error/i))){let r=t.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),I(r))return r;ba.throwError("missing revert data in call exception",y.errors.CALL_EXCEPTION,{error:e,data:"0x"})}}let n=e.message;throw e.code===y.errors.SERVER_ERROR&&(e.error&&"string"==typeof e.error.message?n=e.error.message:"string"==typeof e.body?n=e.body:"string"==typeof e.responseText&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&ba.throwError("insufficient funds for intrinsic transaction cost",y.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ba.throwError("nonce has already been used",y.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&ba.throwError("replacement fee too low",y.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&ba.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class Sa extends Us{constructor(t,e){ba.checkNew(new.target,Sa),super(t),Q(this,"baseUrl",this.getBaseUrl()),Q(this,"apiKey",e||Aa)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return ba.throwArgumentError("unsupported network","network",name)}getUrl(t,e){const r=Object.keys(e).reduce(((t,r)=>{const n=e[r];return null!=n&&(t+=`&${r}=${n}`),t}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${t}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(t,e){return e.module=t,e.apikey=this.apiKey,e}fetch(t,e,r){return ga(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(t,e),i=r?this.getPostData(t,e):null,o="proxy"===t?wa:va;this.emit("debug",{action:"request",request:n,provider:this});const s={url:n,throttleSlotInterval:1e3,throttleCallback:(t,e)=>(this.isCommunityResource()&&ps(),Promise.resolve(!0))};let a=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map((t=>`${t}=${i[t]}`)).join("&"));const u=yield is(s,a,o||wa);return this.emit("debug",{action:"response",request:n,response:at(u),provider:this}),u}))}detectNetwork(){return ga(this,void 0,void 0,(function*(){return this.network}))}perform(t,e){const r=Object.create(null,{perform:{get:()=>super.perform}});return ga(this,void 0,void 0,(function*(){switch(t){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch((t=>Ea("sendTransaction",t,e.signedTransaction)));case"getBlock":if(e.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.transactionHash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=ya(e.transaction);t.module="proxy",t.action="eth_call";try{return yield this.fetch("proxy",t,!0)}catch(t){return Ea("call",t,e.transaction)}}case"estimateGas":{const t=ya(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return yield this.fetch("proxy",t,!0)}catch(t){return Ea("estimateGas",t,e.transaction)}}case"getLogs":{const t={action:"getLogs"};if(e.filter.fromBlock&&(t.fromBlock=_a(e.filter.fromBlock)),e.filter.toBlock&&(t.toBlock=_a(e.filter.toBlock)),e.filter.address&&(t.address=e.filter.address),e.filter.topics&&e.filter.topics.length>0&&(e.filter.topics.length>1&&ba.throwError("unsupported topic count",y.errors.UNSUPPORTED_OPERATION,{topics:e.filter.topics}),1===e.filter.topics.length)){const r=e.filter.topics[0];"string"==typeof r&&66===r.length||ba.throwError("unsupported topic format",y.errors.UNSUPPORTED_OPERATION,{topic0:r}),t.topic0=r}const r=yield this.fetch("logs",t);let n={};for(let t=0;t<r.length;t++){const e=r[t];if(null==e.blockHash){if(null==n[e.blockNumber]){const t=yield this.getBlock(e.blockNumber);t&&(n[e.blockNumber]=t.hash)}e.blockHash=n[e.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,t,e)}))}getHistory(t,e,r){return ga(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(t),startblock:null==e?0:e,endblock:null==r?99999999:r,sort:"asc"};return(yield this.fetch("account",n)).map((t=>{["contractAddress","to"].forEach((function(e){""==t[e]&&delete t[e]})),null==t.creates&&null!=t.contractAddress&&(t.creates=t.contractAddress);const e=this.formatter.transactionResponse(t);return t.timeStamp&&(e.timestamp=parseInt(t.timeStamp)),e}))}))}isCommunityResource(){return this.apiKey===Aa}}function Ma(t){for(let e=(t=t.slice()).length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}var xa=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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 ka=new y(us);function Ta(){return(new Date).getTime()}function Ia(t){let e=null;for(let r=0;r<t.length;r++){const n=t[r];if(null==n)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||null==e.ensAddress&&null==n.ensAddress)||ka.throwArgumentError("provider mismatch","networks",t):e=n}return e}function Ca(t,e){t=t.slice().sort();const r=Math.floor(t.length/2);if(t.length%2)return t[r];const n=t[r-1],i=t[r];return null!=e&&Math.abs(n-i)>e?null:(n+i)/2}function Ra(t){if(null===t)return"null";if("number"==typeof t||"boolean"==typeof t)return JSON.stringify(t);if("string"==typeof t)return t;if(V.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map((t=>Ra(t))));if("object"==typeof t){const e=Object.keys(t);return e.sort(),"{"+e.map((e=>{let r=t[e];return r="function"==typeof r?"[function]":Ra(r),JSON.stringify(e)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let Ba=1;function Na(t){let e=null,r=null,n=new Promise((n=>{e=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(e,t)}));return{cancel:e,getPromise:function(){return n},wait:t=>(n=n.then(t),n)}}const Oa=[y.errors.CALL_EXCEPTION,y.errors.INSUFFICIENT_FUNDS,y.errors.NONCE_EXPIRED,y.errors.REPLACEMENT_UNDERPRICED,y.errors.UNPREDICTABLE_GAS_LIMIT],Pa=["address","args","errorArgs","errorSignature","method","transaction"];function Da(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function La(t,e){return xa(this,void 0,void 0,(function*(){const r=t.provider;return null!=r.blockNumber&&r.blockNumber>=e||-1===e?r:os((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Ua(t,e,r,n){return xa(this,void 0,void 0,(function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&I(n.blockTag)&&(i=yield La(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&I(n.blockTag)&&(i=yield La(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&I(n.blockTag)&&(i=yield La(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&I(n.blockTag)&&(i=yield La(t,e)),i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&I(r.fromBlock)||r.toBlock&&I(r.toBlock))&&(i=yield La(t,e)),i.getLogs(r)}}return ka.throwError("unknown method error",y.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class ja extends Us{constructor(t,e){ka.checkNew(new.target,ja),0===t.length&&ka.throwArgumentError("missing providers","providers",t);const r=t.map(((t,e)=>{if(rr.isProvider(t)){const e=hs(t)?2e3:750,r=1;return Object.freeze({provider:t,weight:1,stallTimeout:e,priority:r})}const r=nt(t);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=hs(t)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&ka.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${e}].weight`,n),Object.freeze(r)})),n=r.reduce(((t,e)=>t+e.weight),0);null==e?e=n/2:e>n&&ka.throwArgumentError("quorum will always fail; larger than total weight","quorum",e);let i=Ia(r.map((t=>t.provider.network)));null==i&&(i=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then(t,e)}),0)}))),super(i),Q(this,"providerConfigs",Object.freeze(r)),Q(this,"quorum",e),this._highestBlockNumber=-1}detectNetwork(){return xa(this,void 0,void 0,(function*(){return Ia(yield Promise.all(this.providerConfigs.map((t=>t.provider.getNetwork()))))}))}perform(t,e){return xa(this,void 0,void 0,(function*(){if("sendTransaction"===t){const t=yield Promise.all(this.providerConfigs.map((t=>t.provider.sendTransaction(e.signedTransaction).then((t=>t.hash),(t=>t)))));for(let e=0;e<t.length;e++){const r=t[e];if("string"==typeof r)return r}throw t[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==t&&(yield this.getBlockNumber());const r=function(t,e,r){let n=Ra;switch(e){case"getBlockNumber":return function(e){const r=e.map((t=>t.result));let n=Ca(e.map((t=>t.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=t._highestBlockNumber&&(t._highestBlockNumber=n),t._highestBlockNumber};case"getGasPrice":return function(t){const e=t.map((t=>t.result));return e.sort(),e[Math.floor(e.length/2)]};case"getEtherPrice":return function(t){return Ca(t.map((t=>t.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(t){return null==t?null:((t=nt(t)).confirmations=-1,Ra(t))};break;case"getBlock":n=r.includeTransactions?function(t){return null==t?null:((t=nt(t)).transactions=t.transactions.map((t=>((t=nt(t)).confirmations=-1,t))),Ra(t))}:function(t){return null==t?null:Ra(t)};break;default:throw new Error("unknown method: "+e)}return function(t,e){return function(r){const n={};r.forEach((e=>{const r=t(e.result);n[r]||(n[r]={count:0,result:e.result}),n[r].count++}));const i=Object.keys(n);for(let t=0;t<i.length;t++){const r=n[i[t]];if(r.count>=e)return r.result}}}(n,t.quorum)}(this,t,e),n=Ma(this.providerConfigs.map(nt));n.sort(((t,e)=>t.priority-e.priority));const i=this._highestBlockNumber;let o=0,s=!0;for(;;){const a=Ta();let u=n.filter((t=>t.runner&&a-t.start<t.stallTimeout)).reduce(((t,e)=>t+e.weight),0);for(;u<this.quorum&&o<n.length;){const r=n[o++],s=Ba++;r.start=Ta(),r.staller=Na(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=Ua(r,i,t,e).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Da(r,Ta()),request:{method:t,params:at(e)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Da(r,Ta()),request:{method:t,params:at(e)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Da(r,null),request:{method:t,params:at(e)},provider:this}),u+=r.weight}const c=[];n.forEach((t=>{!t.done&&t.runner&&(c.push(t.runner),t.staller&&c.push(t.staller.getPromise()))})),c.length&&(yield Promise.race(c));const f=n.filter((t=>t.done&&null==t.error));if(f.length>=this.quorum){const t=r(f);if(void 0!==t)return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),t;s||(yield Na(100).getPromise()),s=!1}const l=n.reduce(((t,e)=>{if(!e.done||null==e.error)return t;const r=e.error.code;return Oa.indexOf(r)>=0&&(t[r]||(t[r]={error:e.error,weight:0}),t[r].weight+=e.weight),t}),{});if(Object.keys(l).forEach((t=>{const e=l[t];if(e.weight<this.quorum)return;n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0}));const r=e.error,i={};Pa.forEach((t=>{null!=r[t]&&(i[t]=r[t])})),ka.throwError(r.reason||r.message,t,i)})),0===n.filter((t=>!t.done)).length)break}return n.forEach((t=>{t.staller&&t.staller.cancel(),t.cancelled=!0})),ka.throwError("failed to meet quorum",y.errors.SERVER_ERROR,{method:t,params:e,results:n.map((t=>Da(t))),provider:this})}))}}const Fa=null,qa=new y(us),za="84842078b09946638c03157f83405213";class Ha extends ra{constructor(t,e){const r=new Ka(t,e),n=r.connection;n.password&&qa.throwError("INFURA WebSocket project secrets unsupported",y.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"}),super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),t),Q(this,"apiKey",r.projectId),Q(this,"projectId",r.projectId),Q(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===za}}class Ka extends oa{static getWebSocketProvider(t,e){return new Ha(t,e)}static getApiKey(t){const e={apiKey:za,projectId:za,projectSecret:null};return null==t||("string"==typeof t?e.projectId=t:null!=t.projectSecret?(qa.assertArgument("string"==typeof t.projectId,"projectSecret requires a projectId","projectId",t.projectId),qa.assertArgument("string"==typeof t.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-kovan":r="optimism-kovan.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":r="arbitrum-rinkeby.infura.io";break;default:qa.throwError("unsupported network",y.errors.INVALID_ARGUMENT,{argument:"network",value:t})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+e.projectId,throttleCallback:(t,r)=>(e.projectId===za&&ps(),Promise.resolve(!0))};return null!=e.projectSecret&&(n.user="",n.password=e.projectSecret),n}isCommunityResource(){return this.projectId===za}}class Ga extends Js{send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((t,e)=>{n.resolve=t,n.reject=e}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const t=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const e=t.map((t=>t.request));return this.emit("debug",{action:"requestBatch",request:at(e),provider:this}),is(this.connection,JSON.stringify(e)).then((r=>{this.emit("debug",{action:"response",request:e,response:r,provider:this}),t.forEach(((t,e)=>{const n=r[e];if(n.error){const e=new Error(n.error.message);e.code=n.error.code,e.data=n.error.data,t.reject(e)}else t.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:e,provider:this}),t.forEach((t=>{t.reject(r)}))}))}),10)),i}}const Wa=new y(us);class Va extends oa{static getApiKey(t){return t&&"string"!=typeof t&&Wa.throwArgumentError("invalid apiKey","apiKey",t),t||"ETHERS_JS_SHARED"}static getUrl(t,e){Wa.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(t.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Wa.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+e}}const $a=new y(us),Xa={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};class Ya extends oa{constructor(t,e){if(null==e){const r=tt(new.target,"getNetwork")(t);if(r){const t=Xa[r.name];t&&(e={applicationId:t,loadBalancer:!0})}null==e&&$a.throwError("unsupported network",y.errors.INVALID_ARGUMENT,{argument:"network",value:t})}super(t,e)}static getApiKey(t){null==t&&$a.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",t);const e={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return"string"==typeof t?e.applicationId=t:null!=t.applicationSecretKey?($a.assertArgument("string"==typeof t.applicationId,"applicationSecretKey requires an applicationId","applicationId",t.applicationId),$a.assertArgument("string"==typeof t.applicationSecretKey,"invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),e.applicationId=t.applicationId,e.applicationSecretKey=t.applicationSecretKey,e.loadBalancer=!!t.loadBalancer):t.applicationId?($a.assertArgument("string"==typeof t.applicationId,"apiKey.applicationId must be a string","apiKey.applicationId",t.applicationId),e.applicationId=t.applicationId,e.loadBalancer=!!t.loadBalancer):$a.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),e}static getUrl(t,e){let r=null;switch(t?t.name:"unknown"){case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"goerli":r="eth-goerli.gateway.pokt.network";break;default:$a.throwError("unsupported network",y.errors.INVALID_ARGUMENT,{argument:"network",value:t})}let n=null;n=e.loadBalancer?`https://${r}/v1/lb/${e.applicationId}`:`https://${r}/v1/${e.applicationId}`;const i={url:n,headers:{}};return null!=e.applicationSecretKey&&(i.user="",i.password=e.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Xa[this.network.name]}}const Ja=new y(us);let Za=1;function Qa(t,e){const r="Web3LegacyFetcher";return function(t,n){const i={method:t,params:n,id:Za++,jsonrpc:"2.0"};return new Promise(((t,n)=>{this.emit("debug",{action:"request",fetcher:r,request:at(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 tu extends Js{constructor(t,e){Ja.checkNew(new.target,tu),null==t&&Ja.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:at(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=Qa(0,t.sendAsync.bind(t)):t.send?n=Qa(0,t.send.bind(t)):Ja.throwArgumentError("unsupported provider","provider",t),r||(r="unknown:")),super(r,e),Q(this,"jsonRpcFetchFunc",n),Q(this,"provider",i)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const eu=new y(us);function ru(t,e){if(null==t&&(t="homestead"),"string"==typeof t){const e=t.match(/^(ws|http)s?:/i);if(e)switch(e[1]){case"http":return new Js(t);case"ws":return new ra(t);default:eu.throwArgumentError("unsupported URL scheme","network",t)}}const r=No(t);return r&&r._defaultProvider||eu.throwError("unsupported getDefaultProvider network",y.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:ja,AlchemyProvider:ca,AnkrProvider:da,CloudflareProvider:ma,EtherscanProvider:Sa,InfuraProvider:Ka,JsonRpcProvider:Js,NodesmithProvider:Va,PocketProvider:Ya,Web3Provider:tu,IpcProvider:Fa},e)}const nu=new RegExp("^bytes([0-9]+)$"),iu=new RegExp("^(u?int)([0-9]*)$"),ou=new RegExp("^(.*)\\[([0-9]*)\\]$"),su=new y("solidity/5.6.0");function au(t,e,r){switch(t){case"address":return r?T(e,32):M(e);case"string":return Ht(e);case"bytes":return M(e);case"bool":return e=e?"0x01":"0x00",r?T(e,32):M(e)}let n=t.match(iu);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&su.throwArgumentError("invalid number type","type",t),r&&(i=256),T(e=V.from(e).toTwos(i),i/8)}if(n=t.match(nu),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&su.throwArgumentError("invalid bytes type","type",t),M(e).byteLength!==i&&su.throwArgumentError(`invalid value for ${t}`,"value",e),r?M((e+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):e}if(n=t.match(ou),n&&Array.isArray(e)){const r=n[1];parseInt(n[2]||String(e.length))!=e.length&&su.throwArgumentError(`invalid array length for ${t}`,"value",e);const i=[];return e.forEach((function(t){i.push(au(r,t,!0))})),x(i)}return su.throwArgumentError("invalid type","type",t)}function uu(t,e){t.length!=e.length&&su.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach((function(t,n){r.push(au(t,e[n]))})),R(x(r))}function cu(t,e){return bt(uu(t,e))}function fu(t,e){return bi(uu(t,e))}function lu(t){const e=Ht(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return R(x([e,So]).slice(0,32))}function hu(t){const e=M(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===e[r-1];)r--;return Vt(e.slice(0,r))}const du=new y("units/5.6.0"),pu=["wei","kwei","mwei","gwei","szabo","finney","ether"];function mu(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||"."===t||"-."===t)&&du.throwArgumentError("invalid value","value",t);let r=e[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===e.length&&(i="."+(e[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const t=r.length-3;o.unshift(r.substring(t)),r=r.substring(0,t)}}return n+o.join(",")+i}function gu(t,e){if("string"==typeof e){const t=pu.indexOf(e);-1!==t&&(e=3*t)}return Hn(t,null!=e?e:18)}function bu(t,e){if("string"!=typeof t&&du.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=pu.indexOf(e);-1!==t&&(e=3*t)}return Kn(t,null!=e?e:18)}function yu(t){return gu(t,18)}function vu(t){return bu(t,18)}const wu="ethers/5.6.2",_u=new y(wu);try{const t=window;null==t._ethers&&(t._ethers=u)}catch(t){}},5939:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}m(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&m(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,c=f,console&&console.warn&&console.warn(c)}return t}function f(){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 l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=f.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;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function m(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(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,f=p(u,c);for(r=0;r<c;++r)n(f[r],this,e)}return!0},o.prototype.addListener=function(t,e){return c(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return c(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,l(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,l(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=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<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=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):[]}},9366:(t,e,r)=>{var n=r(7512).Buffer,i=r(1141);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),u=n.alloc(o||0),c=n.alloc(0);s>0||o>0;){var f=new i;f.update(c),f.update(t),e&&f.update(e),c=f.digest();var l=0;if(s>0){var h=a.length-s;l=Math.min(s,c.length),c.copy(a,h,0,l),s-=l}if(l<c.length&&o>0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:a,iv:u}}},5799:t=>{t.exports=s,s.default=s,s.stable=f,s.stableStringify=f;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(t){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,f){var l;if(c+=1,"object"==typeof t&&null!==t){for(l=0;l<o.length;l++)if(o[l]===t)return void a(r,t,n,s);if(void 0!==f.depthLimit&&c>f.depthLimit)return void a(e,t,n,s);if(void 0!==f.edgesLimit&&i+1>f.edgesLimit)return void a(e,t,n,s);if(o.push(t),Array.isArray(t))for(l=0;l<t.length;l++)u(t[l],l,l,o,t,c,f);else{var h=Object.keys(t);for(l=0;l<h.length;l++){var d=h[l];u(t[d],d,l,o,t,c,f)}}o.pop()}}function c(t,e){return t<e?-1:t>e?1:0}function f(t,e,r,s){void 0===s&&(s=o());var a,u=l(t,"",0,[],void 0,0,s)||t;try{a=0===i.length?JSON.stringify(u,e,r):JSON.stringify(u,h(e),r)}catch(t){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 l(t,i,o,s,u,f,h){var d;if(f+=1,"object"==typeof t&&null!==t){for(d=0;d<s.length;d++)if(s[d]===t)return void a(r,t,i,u);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==h.depthLimit&&f>h.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;d<t.length;d++)l(t[d],d,d,s,t,f,h);else{var p={},m=Object.keys(t).sort(c);for(d=0;d<m.length;d++){var g=m[d];l(t[g],g,d,s,t,f,h),p[g]=t[g]}if(void 0===u)return p;n.push([u,i,t]),u[i]=p}s.pop()}}function h(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===e&&o[0]===r){r=o[2],i.splice(n,1);break}}return t.call(this,e,r)}}},4634:(t,e,r)=>{"use strict";var n=r(7512).Buffer,i=r(8104).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(8575)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),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;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++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},927:(t,e,r)=>{var n=e;n.utils=r(8369),n.common=r(952),n.sha=r(2710),n.ripemd=r(7872),n.hmac=r(10),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},952:(t,e,r)=>{"use strict";var n=r(8369),i=r(5997);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<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>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;o<this.padLength;o++)n[i++]=0;return n}},10:(t,e,r)=>{"use strict";var n=r(8369),i=r(5997);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},7872:(t,e,r)=>{"use strict";var n=r(8369),i=r(952),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,c),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],f=this.h[4],y=r,v=n,w=i,_=c,A=f,E=0;E<80;E++){var S=s(o(u(r,l(E,n,i,c),t[p[E]+e],h(E)),g[E]),f);r=f,f=c,c=o(i,10),i=n,n=S,S=s(o(u(y,l(79-E,v,w,_),t[m[E]+e],d(E)),b[E]),A),y=A,A=_,_=o(w,10),w=v,v=S}S=a(this.h[1],i,_),this.h[1]=a(this.h[2],c,A),this.h[2]=a(this.h[3],f,y),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=S},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],m=[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],g=[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],b=[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]},2710:(t,e,r)=>{"use strict";e.sha1=r(7792),e.sha224=r(8972),e.sha256=r(8842),e.sha384=r(8303),e.sha512=r(8500)},7792:(t,e,r)=>{"use strict";var n=r(8369),i=r(952),o=r(6988),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],h=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=u(s(i,5),c(p,o,f,h),d,r[n],l[p]);d=h,h=f,f=s(o,30),o=i,i=m}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],f),this.h[3]=a(this.h[3],h),this.h[4]=a(this.h[4],d)},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8972:(t,e,r)=>{"use strict";var n=r(8369),i=r(8842);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8842:(t,e,r)=>{"use strict";var n=r(8369),i=r(952),o=r(6988),s=r(5997),a=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(y,g),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],b=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var A=c(_,d(y),f(y,v,w),this.k[n],r[n]),E=a(h(i),l(i,o,g));_=w,w=v,v=y,y=a(b,A),b=g,g=o,o=i,i=a(A,E)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8303:(t,e,r)=>{"use strict";var n=r(8369),i=r(8500);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},8500:(t,e,r)=>{"use strict";var n=r(8369),i=r(952),o=r(5997),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,h=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,b=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function A(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function S(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=a(t,e,1)^a(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,19)^a(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,b),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=(g=r[n-4],b=r[n-3],y=void 0,(y=s(g,b,19)^s(b,g,29)^u(g,b,6))<0&&(y+=4294967296),y),o=I(r[n-4],r[n-3]),a=r[n-14],c=r[n-13],f=k(r[n-30],r[n-29]),l=T(r[n-30],r[n-29]),h=r[n-32],m=r[n-31];r[n]=d(i,o,a,c,f,l,h,m),r[n+1]=p(i,o,a,c,f,l,h,m)}var g,b,y},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r,n,i,a=this.W,u=this.h[0],c=this.h[1],d=this.h[2],p=this.h[3],b=this.h[4],y=this.h[5],v=this.h[6],k=this.h[7],T=this.h[8],I=this.h[9],C=this.h[10],R=this.h[11],B=this.h[12],N=this.h[13],O=this.h[14],P=this.h[15];o(this.k.length===a.length);for(var D=0;D<a.length;D+=2){var L=O,U=P,j=(i=void 0,(i=s(r=T,n=I,14)^s(r,n,18)^s(n,r,9))<0&&(i+=4294967296),i),F=x(T,I),q=w(T,0,C,0,B),z=_(0,I,0,R,0,N),H=this.k[D],K=this.k[D+1],G=a[D],W=a[D+1],V=m(L,U,j,F,q,z,H,K,G,W),$=g(L,U,j,F,q,z,H,K,G,W);L=S(u,c),U=M(u,c),j=A(u,0,d,0,b),F=E(0,c,0,p,0,y);var X=l(L,U,j,F),Y=h(L,U,j,F);O=B,P=N,B=C,N=R,C=T,R=I,T=l(v,k,V,$),I=h(k,k,V,$),v=b,k=y,b=d,y=p,d=u,p=c,u=l(V,$,X,Y),c=h(V,$,X,Y)}f(this.h,0,u,c),f(this.h,2,d,p),f(this.h,4,b,y),f(this.h,6,v,k),f(this.h,8,T,I),f(this.h,10,C,R),f(this.h,12,B,N),f(this.h,14,O,P)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},6988:(t,e,r)=>{"use strict";var n=r(8369).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},8369:(t,e,r)=>{"use strict";var n=r(5997),i=r(8575);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<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>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<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var c;c="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=c>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>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<<e|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<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>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)<e?1:0,u+=(c=c+o>>>0)<o?1:0,t+r+i+s+(u+=(c=c+a>>>0)<a?1: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 f=0,l=e;return f+=(l=l+n>>>0)<e?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+a>>>0)<a?1:0,t+r+i+s+u+(f+=(l=l+c>>>0)<c?1: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}},5662:(t,e,r)=>{"use strict";var n=r(927),i=r(5526),o=r(5997);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.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=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<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},4525:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=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,f=(1<<c)-1,l=f>>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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*m}},8575: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}}},7811: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)]}},7955:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},4628:(t,e,r)=>{t.exports=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[s]={exports:{}};e[s][0].call(c.exports,(function(t){return i(e[s][1][t]||t)}),c,c.exports,t,e,r,n)}return r[s].exports}for(var o=void 0,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){e.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},{}],2:[function(t,e,r){e.exports=function(t){if(Array.isArray(t))return t}},{}],3:[function(t,e,r){var n=t("./arrayLikeToArray");e.exports=function(t){if(Array.isArray(t))return n(t)}},{"./arrayLikeToArray":1}],4:[function(t,e,r){e.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},{}],5:[function(t,e,r){function n(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}e.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var s=t.apply(e,r);function a(t){n(s,i,o,a,u,"next",t)}function u(t){n(s,i,o,a,u,"throw",t)}a(void 0)}))}}},{}],6:[function(t,e,r){e.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},{}],7:[function(t,e,r){var n=t("./setPrototypeOf"),i=t("./isNativeReflectConstruct");function o(t,r,s){return i()?e.exports=o=Reflect.construct:e.exports=o=function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o},o.apply(null,arguments)}e.exports=o},{"./isNativeReflectConstruct":15,"./setPrototypeOf":23}],8:[function(t,e,r){function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}e.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},{}],9:[function(t,e,r){e.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},{}],10:[function(t,e,r){var n=t("./superPropBase");function i(t,r,o){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(t,e,r){var i=n(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(r):o.value}},i(t,r,o||t)}e.exports=i},{"./superPropBase":25}],11:[function(t,e,r){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n},{}],12:[function(t,e,r){var n=t("./setPrototypeOf");e.exports=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&&n(t,e)}},{"./setPrototypeOf":23}],13:[function(t,e,r){e.exports=function(t){return t&&t.__esModule?t:{default:t}}},{}],14:[function(t,e,r){e.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}},{}],15:[function(t,e,r){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},{}],16:[function(t,e,r){e.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}},{}],17:[function(t,e,r){e.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){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(t){i=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}}},{}],18:[function(t,e,r){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},{}],19:[function(t,e,r){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},{}],20:[function(t,e,r){var n=t("./objectWithoutPropertiesLoose");e.exports=function(t,e){if(null==t)return{};var r,i,o=n(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}},{"./objectWithoutPropertiesLoose":21}],21:[function(t,e,r){e.exports=function(t,e){if(null==t)return{};var r,n,i={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(i[r]=t[r]);return i}},{}],22:[function(t,e,r){var n=t("@babel/runtime/helpers/typeof"),i=t("./assertThisInitialized");e.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(t):e}},{"./assertThisInitialized":4,"@babel/runtime/helpers/typeof":27}],23:[function(t,e,r){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,r)}e.exports=n},{}],24:[function(t,e,r){var n=t("./arrayWithHoles"),i=t("./iterableToArrayLimit"),o=t("./unsupportedIterableToArray"),s=t("./nonIterableRest");e.exports=function(t,e){return n(t)||i(t,e)||o(t,e)||s()}},{"./arrayWithHoles":2,"./iterableToArrayLimit":17,"./nonIterableRest":18,"./unsupportedIterableToArray":28}],25:[function(t,e,r){var n=t("./getPrototypeOf");e.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=n(t)););return t}},{"./getPrototypeOf":11}],26:[function(t,e,r){var n=t("./arrayWithoutHoles"),i=t("./iterableToArray"),o=t("./unsupportedIterableToArray"),s=t("./nonIterableSpread");e.exports=function(t){return n(t)||i(t)||o(t)||s()}},{"./arrayWithoutHoles":3,"./iterableToArray":16,"./nonIterableSpread":19,"./unsupportedIterableToArray":28}],27:[function(t,e,r){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(t){return typeof t}:e.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}e.exports=n},{}],28:[function(t,e,r){var n=t("./arrayLikeToArray");e.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}},{"./arrayLikeToArray":1}],29:[function(t,e,r){var n=t("./getPrototypeOf"),i=t("./setPrototypeOf"),o=t("./isNativeFunction"),s=t("./construct");function a(t){var r="function"==typeof Map?new Map:void 0;return e.exports=a=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return s(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},a(t)}e.exports=a},{"./construct":7,"./getPrototypeOf":11,"./isNativeFunction":14,"./setPrototypeOf":23}],30:[function(t,e,r){e.exports=t("regenerator-runtime")},{"regenerator-runtime":190}],31:[function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}for(var o=t("jsbi"),s="ABCDEFGHJKMNPRSTUVWXYZ0123456789",a={},u=0;u<s.length;u++){var c=s.charAt(u);if(void 0!==a[c])throw new TypeError(c+" is ambiguous");a[c]=u}var f=o.BigInt(0),l=o.BigInt(1),h=o.BigInt(5),d=o.BigInt(35),p=o.BigInt(1),m=o.BigInt(2),g=o.BigInt(4),b=o.BigInt(8),y=o.BigInt(16),v=o.BigInt(34359738367),w=o.BigInt(656907472481),_=o.BigInt(522768456162),A=o.BigInt(0xf33e5fb3c4),E=o.BigInt(748107326120),S=o.BigInt(130178868336);e.exports={convertBit:function(t,e,r,i){var o,s=(1<<r)-1,a=[],u=0,c=0,f=n(t);try{for(f.s();!(o=f.n()).done;){var l=o.value;for(u+=e,c=c<<e|l;u>=r;)u-=r,a.push(c>>>u&s)}}catch(t){f.e(t)}finally{f.f()}if(c=c<<r-u&s,u&&i)a.push(c);else{if(c&&!i)throw new Error("Excess padding");if(u>=e&&!i)throw new Error("Non-zero padding")}return a},polyMod:function(t){var e,r=l,i=n(t);try{for(i.s();!(e=i.n()).done;){var s=e.value,a=o.signedRightShift(r,d);r=o.bitwiseAnd(r,v),r=o.leftShift(r,h),r=s?o.bitwiseXor(r,o.BigInt(s)):r,o.notEqual(o.bitwiseAnd(a,p),f)&&(r=o.bitwiseXor(r,w)),o.notEqual(o.bitwiseAnd(a,m),f)&&(r=o.bitwiseXor(r,_)),o.notEqual(o.bitwiseAnd(a,g),f)&&(r=o.bitwiseXor(r,A)),o.notEqual(o.bitwiseAnd(a,b),f)&&(r=o.bitwiseXor(r,E)),o.notEqual(o.bitwiseAnd(a,y),f)&&(r=o.bitwiseXor(r,S))}}catch(t){i.e(t)}finally{i.f()}return o.bitwiseXor(r,l)},ALPHABET:s,ALPHABET_MAP:a}},{jsbi:142}],32:[function(t,e,r){(function(r){(function(){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(t){if(Array.isArray(t))return t}function o(t){return function(t){if(Array.isArray(t))return c(t)}(t)||s(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=u(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var f=t("./base32"),l=f.ALPHABET,h=f.ALPHABET_MAP,d=f.polyMod,p=f.convertBit,m=t("./const"),g=0;function b(t){if(!Number.isInteger(t))throw new Error("netId should be passed as an integer");if(t<0||t>4294967295)throw new Error("netId should be passed as in range [0, 0xFFFFFFFF]");switch(t){case m.NETID_TEST:return m.PREFIX_CFXTEST;case m.NETID_MAIN:return m.PREFIX_CFX;default:return"".concat(m.PREFIX_NET).concat(t)}}function y(t){switch(t){case m.PREFIX_CFXTEST:return m.NETID_TEST;case m.PREFIX_CFX:return m.NETID_MAIN;default:var e=t.slice(0,3),r=t.slice(3);if(e!==m.PREFIX_NET||!function(t){return/^([1-9]\d*)$/.test(t)&&Number(t)<=4294967295}(r))throw new Error("netId prefix should be passed by 'cfx', 'cfxtest' or 'net[n]' ");if(Number(r)===m.NETID_TEST||Number(r)===m.NETID_MAIN)throw new Error("net1 or net1029 are invalid");return Number(r)}}function v(t){if(t.length<1)throw new Error("Empty payload in address");switch(240&t[0]){case 16:return m.TYPE_USER;case 128:return m.TYPE_CONTRACT;case 0:var e,r=a(t);try{for(r.s();!(e=r.n()).done;)if(0!==e.value)return m.TYPE_BUILTIN}catch(t){r.e(t)}finally{r.f()}return m.TYPE_NULL;default:throw new Error("hexAddress should start with 0x0, 0x1 or 0x8")}}e.exports={encode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"==typeof t&&(t=r.from(t.slice(2),"hex")),!(t instanceof r))throw new Error("hexAddress should be passed as a Buffer");if(t.length<20)throw new Error("hexAddress should be at least 20 bytes");var i=v(t).toUpperCase(),s=b(e).toUpperCase(),a=r.from(s).map((function(t){return 31&t})),u=p([g].concat(o(t)),8,5,!0),c=d([].concat(o(a),[0],o(u),[0,0,0,0,0,0,0,0])),f=r.from(c.toString(16).padStart(10,"0"),"hex"),h=p(f,8,5,!0),m=u.map((function(t){return l[t]})).join(""),y=h.map((function(t){return l[t]})).join("");return n?"".concat(s,":TYPE.").concat(i,":").concat(m).concat(y):"".concat(s,":").concat(m).concat(y).toLowerCase()},decode:function(t){var e=t.toLowerCase(),c=t.toUpperCase();if(t!==e&&t!==c)throw new Error("Mixed-case address "+t);var f,l=function(t,e){return i(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,i,o=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==r.return||r.return()}finally{if(a)throw i}}return o}}(t,e)||u(t,e)||n()}(t.toUpperCase().match(/^([^:]+):(.+:)?(.{34})(.{8})$/),5),m=l[1],b=l[2],w=l[3],_=l[4],A=r.from(m).map((function(t){return 31&t})),E=[],S=a(w);try{for(S.s();!(f=S.n()).done;){var M=f.value;E.push(h[M])}}catch(t){S.e(t)}finally{S.f()}var x,k=[],T=a(_);try{for(T.s();!(x=T.n()).done;){var I=x.value;k.push(h[I])}}catch(t){T.e(t)}finally{T.f()}var C,R=i(C=p(E,5,8))||s(C)||u(C)||n(),B=R[0],N=R.slice(1);if(B!==g)throw new Error("Can not recognize version byte");var O=r.from(N),P=y(m.toLowerCase()),D=v(O);if(b&&"type.".concat(D,":")!==b.toLowerCase())throw new Error("Type of address doesn't match");var L=d([].concat(o(A),[0],E,k));if(Number(L))throw new Error("Invalid checksum for ".concat(t));return{hexAddress:O,netId:P,type:D}}}}).call(this)}).call(this,t("buffer").Buffer)},{"./base32":31,"./const":33,buffer:84}],33:[function(t,e,r){"use strict";e.exports={TYPE_USER:"user",TYPE_CONTRACT:"contract",TYPE_BUILTIN:"builtin",TYPE_NULL:"null",PREFIX_CFX:"cfx",PREFIX_CFXTEST:"cfxtest",PREFIX_NET:"net",NETID_MAIN:1029,NETID_TEST:1}},{}],34:[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=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,i,o=[],s=!0,a=!1;try{for(r=r.call(t);!(s=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);s=!0);}catch(t){a=!0,i=t}finally{try{s||null==r.return||r.return()}finally{if(a)throw i}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o=t("./cip37"),s=o.encode,a=o.decode,u=t("./const");function c(t){if(!l(t))return!1;var e=t.toLowerCase().split(":");if(2!==e.length&&3!==e.length)return!1;var r=e[0];return r===u.PREFIX_CFX||r===u.PREFIX_CFXTEST||r.startsWith(u.PREFIX_NET)&&/^([1-9]\d*)$/.test(r.slice(3))}function f(t){if(!c(t))throw new Error("invalid base32 address");var e=t.toLocaleLowerCase().split(":");return 3!==e.length?t:"".concat(e[0],":").concat(e[2])}function l(t){return"string"==typeof t}e.exports={encode:s,decode:a,isValidCfxAddress:function(t){if(!l(t))return!1;try{return a(t),!0}catch(t){return!1}},verifyCfxAddress:function(t){return a(t),!0},hasNetworkPrefix:c,simplifyCfxAddress:f,shortenCfxAddress:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=n((t=f(t)).split(":"),2),i=r[0],o=r[1],s="cfx"!==i||e?4:8,a=o.slice(0,3),u=o.slice(o.length-s);return"".concat(i,":").concat(a,"...").concat(u)}}},{"./cip37":32,"./const":33}],35:[function(t,e,r){"use strict";const n=r;n.bignum=t("bn.js"),n.define=t("./asn1/api").define,n.base=t("./asn1/base"),n.constants=t("./asn1/constants"),n.decoders=t("./asn1/decoders"),n.encoders=t("./asn1/encoders")},{"./asn1/api":36,"./asn1/base":38,"./asn1/constants":42,"./asn1/decoders":44,"./asn1/encoders":47,"bn.js":52}],36:[function(t,e,r){"use strict";const n=t("./encoders"),i=t("./decoders"),o=t("inherits");function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}r.define=function(t,e){return new s(t,e)},s.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},s.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},s.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},s.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},s.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},{"./decoders":44,"./encoders":47,inherits:139}],37:[function(t,e,r){"use strict";const n=t("inherits"),i=t("../base/reporter").Reporter,o=t("safer-buffer").Buffer;function s(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(s,i),r.DecoderBuffer=s,s.isDecoderBuffer=function(t){return t instanceof s||"object"==typeof t&&o.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(t){const e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},r.EncoderBuffer=a,a.isEncoderBuffer=function(t){return t instanceof a||"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=o.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},{"../base/reporter":40,inherits:139,"safer-buffer":193}],38:[function(t,e,r){"use strict";const n=r;n.Reporter=t("./reporter").Reporter,n.DecoderBuffer=t("./buffer").DecoderBuffer,n.EncoderBuffer=t("./buffer").EncoderBuffer,n.Node=t("./node")},{"./buffer":37,"./node":39,"./reporter":40}],39:[function(t,e,r){"use strict";const n=t("../base/reporter").Reporter,i=t("../base/buffer").EncoderBuffer,o=t("../base/buffer").DecoderBuffer,s=t("minimalistic-assert"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function c(t,e,r){const n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=c;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const t=this._baseState,e={};f.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},c.prototype._wrap=function(){const t=this._baseState;u.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},c.prototype._init=function(t){const e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){c.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){c.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),c.prototype.use=function(t){s(t);const e=this._baseState;return s(null===e.use),e.use=t,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(t){const e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},c.prototype.explicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},c.prototype.implicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},c.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},c.prototype.key=function(t){const e=this._baseState;return s(null===e.key),e.key=t,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(t){const e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},c.prototype.contains=function(t){const e=this._baseState;return s(null===e.use),e.contains=t,this},c.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(t,n,r.any),t.isError(s))return s}else{const n=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(n)}}if(r.obj&&s&&(n=t.enterObject()),s){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const n=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const n=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(n))return n;r.any?i=t.raw(e):t=n}if(e&&e.track&&null!==r.tag&&e.track(t.path(),n,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(n,e)}}return r.obj&&s&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},c.prototype._decodeGeneric=function(t,e,r){const n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},c.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(t,e){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=t.save(),a=r.choice[o];try{const r=a._decode(t,e);if(t.isError(r))return!1;n={type:o,value:r},i=!0}catch(e){return t.restore(s),!1}return!0}),this),i?n:t.error("Choice not matched")},c.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},c.prototype._encode=function(t,e,r){const n=this._baseState;if(null!==n.default&&n.default===t)return;const i=this._encodeValue(t,e,r);return void 0===i||this._skipDefault(i,e,r)?void 0:i},c.prototype._encodeValue=function(t,e,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);let o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}let s=null,a=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)s=this._getUse(i.contains,r)._encode(t,e),a=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){const n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(s=this._encodePrimitive(i.tag,t),a=!0);if(!i.any&&null===i.choice){const t=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===t?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(t,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(t,e){const r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},c.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},c.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},c.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},{"../base/buffer":37,"../base/reporter":40,"minimalistic-assert":152}],40:[function(t,e,r){"use strict";const n=t("inherits");function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}r.Reporter=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){const n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){let e;const r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},{inherits:139}],41:[function(t,e,r){"use strict";function n(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e}r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=n(r.tagClass),r.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},r.tagByName=n(r.tag)},{}],42:[function(t,e,r){"use strict";const n=r;n._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e},n.der=t("./der")},{"./der":41}],43:[function(t,e,r){"use strict";const n=t("inherits"),i=t("bn.js"),o=t("../base/buffer").DecoderBuffer,s=t("../base/node"),a=t("../constants/der");function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new c,this.tree._init(t.body)}function c(t){s.call(this,"der",t)}function f(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=t.readUInt8(e),t.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function l(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(let e=0;e<i;e++){n<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;n|=e}return n}e.exports=u,u.prototype.decode=function(t,e){return o.isDecoderBuffer(t)||(t=new o(t,e)),this.tree._decode(t,e)},n(c,s),c.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;const n=t.save(),i=f(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},c.prototype._decodeTag=function(t,e,r){const n=f(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;let i=l(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');const o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},c.prototype._skipUntilEnd=function(t,e){for(;;){const r=f(t,e);if(t.isError(r))return r;const n=l(t,r.primitive,e);if(t.isError(n))return n;let i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},c.prototype._decodeList=function(t,e,r,n){const i=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=r.decode(t,"der",n);if(t.isError(o)&&e)break;i.push(o)}return i},c.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},c.prototype._decodeObjid=function(t,e,r){let n;const i=[];let o=0,s=0;for(;!t.isEmpty();)s=t.readUInt8(),o<<=7,o|=127&s,0==(128&s)&&(i.push(o),o=0);128&s&&i.push(o);const a=i[0]/40|0,u=i[0]%40;if(n=r?i:[a,u].concat(i.slice(1)),e){let t=e[n.join(" ")];void 0===t&&(t=e[n.join(".")]),void 0!==t&&(n=t)}return n},c.prototype._decodeTime=function(t,e){const r=t.raw().toString();let n,i,o,s,a,u;if("gentime"===e)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,u,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},c.prototype._decodeInt=function(t,e){const r=t.raw();let n=new i(r);return e&&(n=e[n.toString(10)]||n),n},c.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},{"../base/buffer":37,"../base/node":39,"../constants/der":41,"bn.js":52,inherits:139}],44:[function(t,e,r){"use strict";const n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":43,"./pem":45}],45:[function(t,e,r){"use strict";const n=t("inherits"),i=t("safer-buffer").Buffer,o=t("./der");function s(t){o.call(this,t),this.enc="pem"}n(s,o),e.exports=s,s.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,u=-1;for(let t=0;t<r.length;t++){const e=r[t].match(s);if(null!==e&&e[2]===n){if(-1!==a){if("END"!==e[1])break;u=t;break}if("BEGIN"!==e[1])break;a=t}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+n);const c=r.slice(a+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const f=i.from(c,"base64");return o.prototype.decode.call(this,f,e)}},{"./der":43,inherits:139,"safer-buffer":193}],46:[function(t,e,r){"use strict";const n=t("inherits"),i=t("safer-buffer").Buffer,o=t("../base/node"),s=t("../constants/der");function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function c(t){return t<10?"0"+t:t}e.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,o),u.prototype._encodeComposite=function(t,e,r,n){const o=function(t,e,r,n){let i;if("seqof"===t?t="seq":"setof"===t&&(t="set"),s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=s.tagClassByName[r||"universal"]<<6,i)}(t,e,r,this.reporter);if(n.length<128){const t=i.alloc(2);return t[0]=o,t[1]=n.length,this._createEncoderBuffer([t,n])}let a=1;for(let t=n.length;t>=256;t>>=8)a++;const u=i.alloc(2+a);u[0]=o,u[1]=128|a;for(let t=1+a,e=n.length;e>0;t--,e>>=8)u[t]=255&e;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=i.alloc(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let n=0;for(let e=0;e<t.length;e++){let r=t[e];for(n++;r>=128;r>>=7)n++}const o=i.alloc(n);let s=o.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(o[s--]=127&r;(r>>=7)>0;)o[s--]=128|127&r}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(t,e){let r;const n=new Date(t);return"gentime"===e?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=i.from(e)}if(i.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=i.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const n=new Array(r);for(let e=n.length-1;e>=0;e--)n[e]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},{"../base/node":39,"../constants/der":41,inherits:139,"safer-buffer":193}],47:[function(t,e,r){"use strict";const n=r;n.der=t("./der"),n.pem=t("./pem")},{"./der":46,"./pem":48}],48:[function(t,e,r){"use strict";const n=t("inherits"),i=t("./der");function o(t){i.call(this,t),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(t,e){const r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"];for(let t=0;t<r.length;t+=64)n.push(r.slice(t,t+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},{"./der":46,inherits:139}],49:[function(t,e,r){"use strict";r.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=c(t),s=n[0],a=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,l=a>0?s-4:s;for(r=0;r<l;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(f(t,s,s+16383>a?a:s+16383));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function c(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 f(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],50:[function(t,e,r){!function(t){"use strict";var r,n="[big.js] ",i=n+"Invalid ",o=i+"decimal places",s={},a=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function u(t,e,r,n){var i=t.c,o=t.e+e+1;if(o<i.length){if(1===r)n=i[o]>=5;else if(2===r)n=i[o]>5||5==i[o]&&(n||o<0||void 0!==i[o+1]||1&i[o-1]);else if(3===r)n=n||!!i[0];else if(n=!1,0!==r)throw Error("[big.js] Invalid rounding mode");if(o<1)i.length=1,n?(t.e=-e,i[0]=1):i[0]=t.e=0;else{if(i.length=o--,n)for(;++i[o]>9;)i[o]=0,o--||(++t.e,i.unshift(1));for(o=i.length;!i[--o];)i.pop()}}else if(r<0||r>3||r!==~~r)throw Error("[big.js] Invalid rounding mode");return t}function c(t,e,r,n){var s,a,c=t.constructor,f=!t.c[0];if(void 0!==r){if(r!==~~r||r<(3==e)||r>1e6)throw Error(3==e?i+"precision":o);for(r=n-(t=new c(t)).e,t.c.length>++n&&u(t,r,c.RM),2==e&&(n=t.e+r+1);t.c.length<n;)t.c.push(0)}if(s=t.e,r=(a=t.c.join("")).length,2!=e&&(1==e||3==e&&n<=s||s<=c.NE||s>=c.PE))a=a.charAt(0)+(r>1?"."+a.slice(1):"")+(s<0?"e":"e+")+s;else if(s<0){for(;++s;)a="0"+a;a="0."+a}else if(s>0)if(++s>r)for(s-=r;s--;)a+="0";else s<r&&(a=a.slice(0,s)+"."+a.slice(s));else r>1&&(a=a.charAt(0)+"."+a.slice(1));return t.s<0&&(!f||4==e)?"-"+a:a}s.abs=function(){var t=new this.constructor(this);return t.s=1,t},s.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,o=r.s,s=t.s,a=r.e,u=t.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(e=o<0,a!=u)return a>u^e?1:-1;for(s=(a=n.length)<(u=i.length)?a:u,o=-1;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^e?1:-1;return a==u?0:a>u^e?1:-1},s.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,s=e.s==t.s?1:-1,a=r.DP;if(a!==~~a||a<0||a>1e6)throw Error(o);if(!i[0])throw Error("[big.js] Division by zero");if(!n[0])return new r(0*s);var c,f,l,h,d,p=i.slice(),m=c=i.length,g=n.length,b=n.slice(0,c),y=b.length,v=t,w=v.c=[],_=0,A=a+(v.e=e.e-t.e)+1;for(v.s=s,s=A<0?0:A,p.unshift(0);y++<c;)b.push(0);do{for(l=0;l<10;l++){if(c!=(y=b.length))h=c>y?1:-1;else for(d=-1,h=0;++d<c;)if(i[d]!=b[d]){h=i[d]>b[d]?1:-1;break}if(!(h<0))break;for(f=y==c?i:p;y;){if(b[--y]<f[y]){for(d=y;d&&!b[--d];)b[d]=9;--b[d],b[y]+=10}b[y]-=f[y]}for(;!b[0];)b.shift()}w[_++]=h?l:++l,b[0]&&h?b[y]=n[m]||0:b=[n[m]]}while((m++<g||void 0!==b[0])&&s--);return w[0]||1==_||(w.shift(),v.e--),_>A&&u(v,a,r.RM,void 0!==b[0]),v},s.eq=function(t){return!this.cmp(t)},s.gt=function(t){return this.cmp(t)>0},s.gte=function(t){return this.cmp(t)>-1},s.lt=function(t){return this.cmp(t)<0},s.lte=function(t){return this.cmp(t)<1},s.minus=s.sub=function(t){var e,r,n,i,o=this,s=o.constructor,a=o.s,u=(t=new s(t)).s;if(a!=u)return t.s=-u,o.plus(t);var c=o.c.slice(),f=o.e,l=t.c,h=t.e;if(!c[0]||!l[0])return l[0]?(t.s=-u,t):new s(c[0]?o:0);if(a=f-h){for((i=a<0)?(a=-a,n=c):(h=f,n=l),n.reverse(),u=a;u--;)n.push(0);n.reverse()}else for(r=((i=c.length<l.length)?c:l).length,a=u=0;u<r;u++)if(c[u]!=l[u]){i=c[u]<l[u];break}if(i&&(n=c,c=l,l=n,t.s=-t.s),(u=(r=l.length)-(e=c.length))>0)for(;u--;)c[e++]=0;for(u=e;r>a;){if(c[--r]<l[r]){for(e=r;e&&!c[--e];)c[e]=9;--c[e],c[r]+=10}c[r]-=l[r]}for(;0===c[--u];)c.pop();for(;0===c[0];)c.shift(),--h;return c[0]||(t.s=1,c=[h=0]),t.c=c,t.e=h,t},s.mod=function(t){var e,r=this,n=r.constructor,i=r.s,o=(t=new n(t)).s;if(!t.c[0])throw Error("[big.js] Division by zero");return r.s=t.s=1,e=1==t.cmp(r),r.s=i,t.s=o,e?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=o,this.minus(r.times(t)))},s.plus=s.add=function(t){var e,r=this,n=r.constructor,i=r.s,o=(t=new n(t)).s;if(i!=o)return t.s=-o,r.minus(t);var s=r.e,a=r.c,u=t.e,c=t.c;if(!a[0]||!c[0])return c[0]?t:new n(a[0]?r:0*i);if(a=a.slice(),i=s-u){for(i>0?(u=s,e=c):(i=-i,e=a),e.reverse();i--;)e.push(0);e.reverse()}for(a.length-c.length<0&&(e=c,c=a,a=e),i=c.length,o=0;i;a[i]%=10)o=(a[--i]=a[i]+c[i]+o)/10|0;for(o&&(a.unshift(o),++u),i=a.length;0===a[--i];)a.pop();return t.c=a,t.e=u,t},s.pow=function(t){var e=this,r=new e.constructor(1),n=r,o=t<0;if(t!==~~t||t<-1e6||t>1e6)throw Error(i+"exponent");for(o&&(t=-t);1&t&&(n=n.times(e)),t>>=1;)e=e.times(e);return o?r.div(n):n},s.round=function(t,e){var r=this.constructor;if(void 0===t)t=0;else if(t!==~~t||t<-1e6||t>1e6)throw Error(o);return u(new r(this),t,void 0===e?r.RM:e)},s.sqrt=function(){var t,e,r,i=this,o=i.constructor,s=i.s,a=i.e,c=new o(.5);if(!i.c[0])return new o(i);if(s<0)throw Error(n+"No square root");0===(s=Math.sqrt(i+""))||s===1/0?((e=i.c.join("")).length+a&1||(e+="0"),a=((a+1)/2|0)-(a<0||1&a),t=new o(((s=Math.sqrt(e))==1/0?"1e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+a)):t=new o(s),a=t.e+(o.DP+=4);do{r=t,t=c.times(r.plus(i.div(r)))}while(r.c.slice(0,a).join("")!==t.c.slice(0,a).join(""));return u(t,o.DP-=4,o.RM)},s.times=s.mul=function(t){var e,r=this,n=r.constructor,i=r.c,o=(t=new n(t)).c,s=i.length,a=o.length,u=r.e,c=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!o[0])return new n(0*t.s);for(t.e=u+c,s<a&&(e=i,i=o,o=e,c=s,s=a,a=c),e=new Array(c=s+a);c--;)e[c]=0;for(u=a;u--;){for(a=0,c=s+u;c>u;)a=e[c]+o[u]*i[c-u-1]+a,e[c--]=a%10,a=a/10|0;e[c]=(e[c]+a)%10}for(a?++t.e:e.shift(),u=e.length;!e[--u];)e.pop();return t.c=e,t},s.toExponential=function(t){return c(this,1,t,t)},s.toFixed=function(t){return c(this,2,t,this.e+t)},s.toPrecision=function(t){return c(this,3,t,t-1)},s.toString=function(){return c(this)},s.valueOf=s.toJSON=function(){return c(this,4)},(r=function t(){function e(r){var n=this;if(!(n instanceof e))return void 0===r?t():new e(r);r instanceof e?(n.s=r.s,n.e=r.e,n.c=r.c.slice()):function(t,e){var r,n,o;if(0===e&&1/e<0)e="-0";else if(!a.test(e+=""))throw Error(i+"number");for(t.s="-"==e.charAt(0)?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),o=e.length,n=0;n<o&&"0"==e.charAt(n);)++n;if(n==o)t.c=[t.e=0];else{for(;o>0&&"0"==e.charAt(--o););for(t.e=r-n-1,t.c=[],r=0;n<=o;)t.c[r++]=+e.charAt(n++)}}(n,r),n.constructor=e}return e.prototype=s,e.DP=20,e.RM=1,e.NE=-7,e.PE=21,e.version="5.2.2",e}()).default=r.Big=r,void 0!==e&&e.exports?e.exports=r:t.Big=r}(this)},{}],51:[function(t,e,r){var n=t("safe-buffer").Buffer;e.exports={check:function(t){if(t.length<8)return!1;if(t.length>72)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-2)return!1;if(2!==t[2])return!1;var e=t[3];if(0===e)return!1;if(5+e>=t.length)return!1;if(2!==t[4+e])return!1;var r=t[5+e];return!(0===r||6+e+r!==t.length||128&t[4]||e>1&&0===t[4]&&!(128&t[5])||128&t[e+6]||r>1&&0===t[e+6]&&!(128&t[e+7]))},decode:function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},encode:function(t,e){var r=t.length,i=e.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(i>1&&0===e[0]&&!(128&e[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=t.length,t.copy(o,4),o[4+r]=2,o[5+r]=e.length,e.copy(o,6+r),o}}},{"safe-buffer":192}],52:[function(t,e,r){!function(e,r){"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 e?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s=t("buffer").Buffer}catch(t){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=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<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=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,f=r;f<a;f+=n)c=u(t,f,f+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var l=1;for(c=u(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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"],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],l=[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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>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=f[t],d=l[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),f=this.clone();if(u){for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!f.isZero();a++)s=f.andln(255),f.iushrn(8),c[o-a-1]=s}return c},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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,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=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<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<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},m.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},m.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},m.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},m.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},m.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},m.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 g={k256:null,p224:null,p192:null,p25519:null};function b(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 y(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.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)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(y,b),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,b),i(w,b),i(_,b),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=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 y;else if("p224"===t)e=new v;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(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)}}(void 0===e||e,this)},{buffer:54}],53:[function(t,e,r){var n;function i(t){this.rand=t}if(e.exports=function(t){return n||(n=new i(null)),n.generate(t)},e.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;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=t("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},{crypto:54}],54:[function(t,e,r){},{}],55:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,u,c=r[0],f=r[1],l=r[2],h=r[3],d=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],b=4,y=1;y<i;y++)o=c[d>>>24]^f[p>>>16&255]^l[m>>>8&255]^h[255&g]^e[b++],s=c[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^h[255&d]^e[b++],a=c[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^h[255&p]^e[b++],u=c[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&m]^e[b++],d=o,p=s,m=a,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^e[b++],s=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^e[b++],a=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[b++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[b++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var c=a^a<<1^a<<2^a<<3^a<<4;c=c>>>8^255&c^99,r[s]=c,n[c]=s;var f=t[s],l=t[f],h=t[l],d=257*t[c]^16843008*c;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*h^65537*l^257*f^16843008*s,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===s?s=a=1:(s=f^t[t[t[h^f]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(t){this._key=i(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-e]^s}for(var c=[],f=0;f<n;f++){var l=n-f,h=i[l-(f%4?0:4)];c[f]=f<4||l<=4?h:u.INV_SUB_MIX[0][u.SBOX[h>>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},c.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},{"safe-buffer":192}],56:[function(t,e,r){var n=t("./aes"),i=t("safe-buffer").Buffer,o=t("cipher-base"),s=t("inherits"),a=t("./ghash"),u=t("buffer-xor"),c=t("./incr32");function f(t,e,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var f=this._cipher.encryptBlock(u);this._ghash=new a(f),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,f=i.alloc(8);f.writeUIntBE(u,0,8),n.update(f),t._finID=n.state;var l=i.from(t._finID);return c(l),l}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},f.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},e.exports=f},{"./aes":55,"./ghash":60,"./incr32":61,"buffer-xor":83,"cipher-base":85,inherits:139,"safe-buffer":192}],57:[function(t,e,r){var n=t("./encrypter"),i=t("./decrypter"),o=t("./modes/list.json");r.createCipher=r.Cipher=n.createCipher,r.createCipheriv=r.Cipheriv=n.createCipheriv,r.createDecipher=r.Decipher=i.createDecipher,r.createDecipheriv=r.Decipheriv=i.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(o)}},{"./decrypter":58,"./encrypter":59,"./modes/list.json":69}],58:[function(t,e,r){var n=t("./authCipher"),i=t("safe-buffer").Buffer,o=t("./modes"),s=t("./streamCipher"),a=t("cipher-base"),u=t("./aes"),c=t("evp_bytestokey");function f(t,e,r){a.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function h(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new f(a.module,e,r)}t("inherits")(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16!==e)return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=i.concat([this.cache,t])},l.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(e,!1,r.key,r.iv);return h(t,n.key,n.iv)},r.createDecipheriv=h},{"./aes":55,"./authCipher":56,"./modes":68,"./streamCipher":71,"cipher-base":85,evp_bytestokey:122,inherits:139,"safe-buffer":192}],59:[function(t,e,r){var n=t("./modes"),i=t("./authCipher"),o=t("safe-buffer").Buffer,s=t("./streamCipher"),a=t("cipher-base"),u=t("./aes"),c=t("evp_bytestokey");function f(t,e,r){a.call(this),this._cache=new h,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}t("inherits")(f,a),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new f(a.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=o.concat([this.cache,t])},h.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},h.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},r.createCipheriv=d,r.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},{"./aes":55,"./authCipher":56,"./modes":68,"./streamCipher":71,"cipher-base":85,evp_bytestokey:122,inherits:139,"safe-buffer":192}],60:[function(t,e,r){var n=t("safe-buffer").Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},e.exports=s},{"safe-buffer":192}],61:[function(t,e,r){e.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},{}],62:[function(t,e,r){var n=t("buffer-xor");r.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},r.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},{"buffer-xor":83}],63:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("buffer-xor");function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}r.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},{"buffer-xor":83,"safe-buffer":192}],64:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}r.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},{"safe-buffer":192}],65:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}r.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},{"safe-buffer":192}],66:[function(t,e,r){var n=t("buffer-xor"),i=t("safe-buffer").Buffer,o=t("../incr32");function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}r.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(t),c=o+16*a;t._cache.writeUInt32BE(u[0],c+0),t._cache.writeUInt32BE(u[1],c+4),t._cache.writeUInt32BE(u[2],c+8),t._cache.writeUInt32BE(u[3],c+12)}var f=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,f)}},{"../incr32":61,"buffer-xor":83,"safe-buffer":192}],67:[function(t,e,r){r.encrypt=function(t,e){return t._cipher.encryptBlock(e)},r.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},{}],68:[function(t,e,r){var n={ECB:t("./ecb"),CBC:t("./cbc"),CFB:t("./cfb"),CFB8:t("./cfb8"),CFB1:t("./cfb1"),OFB:t("./ofb"),CTR:t("./ctr"),GCM:t("./ctr")},i=t("./list.json");for(var o in i)i[o].module=n[i[o].mode];e.exports=i},{"./cbc":62,"./cfb":63,"./cfb1":64,"./cfb8":65,"./ctr":66,"./ecb":67,"./list.json":69,"./ofb":70}],69:[function(t,e,r){e.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],70:[function(t,e,r){(function(e){(function(){var n=t("buffer-xor");function i(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}r.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,o)}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:84,"buffer-xor":83}],71:[function(t,e,r){var n=t("./aes"),i=t("safe-buffer").Buffer,o=t("cipher-base");function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}t("inherits")(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},e.exports=s},{"./aes":55,"cipher-base":85,inherits:139,"safe-buffer":192}],72:[function(t,e,r){var n=t("browserify-des"),i=t("browserify-aes/browser"),o=t("browserify-aes/modes"),s=t("browserify-des/modes"),a=t("evp_bytestokey");function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function c(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},r.createCipheriv=r.Cipheriv=u,r.createDecipher=r.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return c(t,i.key,i.iv)},r.createDecipheriv=r.Decipheriv=c,r.listCiphers=r.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},{"browserify-aes/browser":57,"browserify-aes/modes":68,"browserify-des":73,"browserify-des/modes":74,evp_bytestokey:122}],73:[function(t,e,r){var n=t("cipher-base"),i=t("des.js"),o=t("inherits"),s=t("safe-buffer").Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],e.exports=u,o(u,n),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},{"cipher-base":85,"des.js":94,inherits:139,"safe-buffer":192}],74:[function(t,e,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],75:[function(t,e,r){(function(r){(function(){var n=t("bn.js"),i=t("randombytes");function o(t,e){var i=function(t){var e=s(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=(n.mont(e.modulus),new n(t).mul(i.blinder).umod(e.modulus)),u=a.toRed(n.mont(e.prime1)),c=a.toRed(n.mont(e.prime2)),f=e.coefficient,l=e.prime1,h=e.prime2,d=u.redPow(e.exponent1),p=c.redPow(e.exponent2);d=d.fromRed(),p=p.fromRed();var m=d.isub(p).imul(f).umod(l);return m.imul(h),p.iadd(m),new r(p.imul(i.unblinder).umod(e.modulus).toArray(!1,o))}function s(t){for(var e=t.modulus.byteLength(),r=new n(i(e));r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new n(i(e));return r}e.exports=o,o.getr=s}).call(this)}).call(this,t("buffer").Buffer)},{"bn.js":52,buffer:84,randombytes:173}],76:[function(t,e,r){e.exports=t("./browser/algorithms.json")},{"./browser/algorithms.json":77}],77:[function(t,e,r){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],78:[function(t,e,r){e.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],79:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("create-hash"),o=t("readable-stream"),s=t("inherits"),a=t("./sign"),u=t("./verify"),c=t("./algorithms.json");function f(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){o.Writable.call(this);var e=c[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function d(t){return new l(t)}Object.keys(c).forEach((function(t){c[t].id=n.from(c[t].id,"hex"),c[t.toLowerCase()]=c[t]})),s(f,o.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},s(l,o.Writable),l.prototype._write=function(t,e,r){this._hash.update(t),r()},l.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},l.prototype.verify=function(t,e,r){"string"==typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return u(e,i,t,this._signType,this._tag)},e.exports={Sign:h,Verify:d,createSign:h,createVerify:d}},{"./algorithms.json":77,"./sign":80,"./verify":81,"create-hash":89,inherits:139,"readable-stream":189,"safe-buffer":192}],80:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("create-hmac"),o=t("browserify-rsa"),s=t("elliptic").ec,a=t("bn.js"),u=t("parse-asn1"),c=t("./curves.json");function f(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var s=n.alloc(e.byteLength()-t.length);t=n.concat([s,t])}var a=r.length,u=function(t,e){t=(t=l(t,e)).mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),c=n.alloc(a);c.fill(1);var f=n.alloc(a);return f=i(o,f).update(c).update(n.from([0])).update(t).update(u).digest(),c=i(o,f).update(c).digest(),{k:f=i(o,f).update(c).update(n.from([1])).update(t).update(u).digest(),v:c=i(o,f).update(c).digest()}}function l(t,e){var r=new a(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function h(t,e,r){var o,s;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);s=l(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,n){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(n)}e.exports=function(t,e,r,i,p){var m=u(e);if(m.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=c[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new s(r).keyFromPrivate(e.privateKey).sign(t);return n.from(i.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){for(var i,o=e.params.priv_key,s=e.params.p,u=e.params.q,c=e.params.g,p=new a(0),m=l(t,u).mod(u),g=!1,b=f(o,u,t,r);!1===g;)p=d(c,i=h(u,b,r),s,u),0===(g=i.invm(u).imul(m.add(o.mul(p))).mod(u)).cmpn(0)&&(g=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t)),128&e[0]&&(e=[0].concat(e));var r=[48,t.length+e.length+4,2,t.length];return r=r.concat(t,[2,e.length],e),n.from(r)}(p,g)}(t,m,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");t=n.concat([p,t]);for(var g=m.modulus.byteLength(),b=[0,1];t.length+b.length+1<g;)b.push(255);b.push(0);for(var y=-1;++y<t.length;)b.push(t[y]);return o(b,m)},e.exports.getKey=f,e.exports.makeKey=h},{"./curves.json":78,"bn.js":82,"browserify-rsa":75,"create-hmac":91,elliptic:104,"parse-asn1":158,"safe-buffer":192}],81:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("bn.js"),o=t("elliptic").ec,s=t("parse-asn1"),a=t("./curves.json");function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}e.exports=function(t,e,r,c,f){var l=s(r);if("ec"===l.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}(t,e,l)}if("dsa"===l.type){if("dsa"!==c)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,a=r.data.g,c=r.data.pub_key,f=s.signature.decode(t,"der"),l=f.s,h=f.r;u(l,o),u(h,o);var d=i.mont(n),p=l.invm(o);return 0===a.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(c.toRed(d).redPow(h.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(t,e,l)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");e=n.concat([f,e]);for(var h=l.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<h;)d.push(255),p++;d.push(0);for(var m=-1;++m<e.length;)d.push(e[m]);d=n.from(d);var g=i.mont(l.modulus);t=(t=new i(t).toRed(g)).redPow(new i(l.publicExponent)),t=n.from(t.fromRed().toArray());var b=p<8?1:0;for(h=Math.min(t.length,d.length),t.length!==d.length&&(b=1),m=-1;++m<h;)b|=t[m]^d[m];return 0===b}},{"./curves.json":78,"bn.js":82,elliptic:104,"parse-asn1":158,"safe-buffer":192}],82:[function(t,e,r){!function(e,r){"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 e?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s=t("buffer").Buffer}catch(t){}function a(t,e,r){for(var i=0,o=Math.min(t.length,r),s=0,a=e;a<o;a++){var u,c=t.charCodeAt(a)-48;i<<=4,i|=u=c>=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:c,s|=u}return n(!(240&s),"Invalid character in "+t),i}function u(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var c=t.charCodeAt(u)-48;o*=i,s=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s<i,"Invalid character"),o+=s}return o}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(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<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>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<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=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,f=r;f<a;f+=n)c=u(t,f,f+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var l=1;for(c=u(t,f,t.length,e),f=0;f<s;f++)l*=e;this.imuln(l),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){c(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&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(t){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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"],h=[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],d=[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 p(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<n;c++){for(var f=u>>>26,l=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;f+=(s=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[c]=0|l,u=0|f}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<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>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=h[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).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,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)},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<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,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;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.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;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.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;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.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;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(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<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.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<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var m=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,c=0,f=0|s[0],l=8191&f,h=f>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,A=0|s[4],E=8191&A,S=A>>>13,M=0|s[5],x=8191&M,k=M>>>13,T=0|s[6],I=8191&T,C=T>>>13,R=0|s[7],B=8191&R,N=R>>>13,O=0|s[8],P=8191&O,D=O>>>13,L=0|s[9],U=8191&L,j=L>>>13,F=0|a[0],q=8191&F,z=F>>>13,H=0|a[1],K=8191&H,G=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,X=0|a[3],Y=8191&X,J=X>>>13,Z=0|a[4],Q=8191&Z,tt=Z>>>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,ft=0|a[8],lt=8191&ft,ht=ft>>>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(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(h,q)|0))<<13)|0;c=((o=Math.imul(h,z))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,z))+Math.imul(m,q)|0,o=Math.imul(m,z);var bt=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(y,q)|0,o=Math.imul(y,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 yt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,o=Math.imul(_,z),n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,$)|0;var vt=(c+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,z))+Math.imul(S,q)|0,o=Math.imul(S,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(b,V)|0,i=(i=i+Math.imul(b,$)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,J)|0;var wt=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(k,q)|0,o=Math.imul(k,z),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,J)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,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,q),i=(i=Math.imul(I,z))+Math.imul(C,q)|0,o=Math.imul(C,z),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,$)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,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 At=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(N,q)|0,o=Math.imul(N,z),n=n+Math.imul(I,K)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,G)|0,n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,J)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,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 Et=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,z))+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,K)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,$)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,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(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,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 St=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,z))+Math.imul(j,q)|0,o=Math.imul(j,z),n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,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(b,ut)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var Mt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,G))+Math.imul(j,K)|0,o=Math.imul(j,G),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,J)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,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(b,lt)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var xt=(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)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,$))+Math.imul(j,V)|0,o=Math.imul(j,$),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ct)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var kt=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(U,Y),i=(i=Math.imul(U,J))+Math.imul(j,Y)|0,o=Math.imul(j,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(E,lt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,ht)|0;var Tt=(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)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(j,Q)|0,o=Math.imul(j,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(I,ut)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var It=(c+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(j,rt)|0,o=Math.imul(j,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ct)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(j,ot)|0,o=Math.imul(j,st),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(B,lt)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,ut),i=(i=Math.imul(U,ct))+Math.imul(j,ut)|0,o=Math.imul(j,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(D,lt)|0,o=o+Math.imul(D,ht)|0;var Bt=(c+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(U,lt),i=(i=Math.imul(U,ht))+Math.imul(j,lt)|0,o=Math.imul(j,ht);var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Ot=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((o=Math.imul(j,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=_t,u[6]=At,u[7]=Et,u[8]=St,u[9]=Mt,u[10]=xt,u[11]=kt,u[12]=Tt,u[13]=It,u[14]=Ct,u[15]=Rt,u[16]=Bt,u[17]=Nt,u[18]=Ot,0!==c&&(u[19]=c,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),c=Math.max(0,o-t.length+1);c<=u;c++){var f=o-c,l=(0|t.words[f])*(0|e.words[c]),h=67108863&l;a=67108863&(h=h+a|0),i+=(s=(s=s+(l/67108864|0)|0)+(h>>>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 b(t,e,r){return g(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):b(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},y.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},y.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),f=0;f<i;f+=a)for(var l=u,h=c,d=0;d<s;d++){var p=r[f+d],m=n[f+d],g=r[f+d+s],b=n[f+d+s],y=l*g-h*b;b=l*b+h*g,g=y,r[f+d]=p+g,n[f+d]=m+b,r[f+d+s]=p-g,n[f+d+s]=m-b,d!==a&&(y=u*l-c*h,h=u*h+c*l,l=y)}},y.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},y.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},y.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},y.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},y.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=a[d]*f[d]-u[d]*l[d];u[d]=a[d]*l[d]+u[d]*f[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=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<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=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<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>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<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&a}return u&&0!==f&&(u.words[u.length++]=f),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<<e;return!(this.length<=r||!(this.words[r]&i))},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=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<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[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<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>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<a.length;c++)a.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,a&&(a.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);a&&(a.words[l]=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 f=r.clone(),l=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(f),s.isub(l)),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(f),u.isub(l)),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,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,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >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<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>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:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(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 v={k256:null,p224:null,p192:null,p25519:null};function w(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 _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.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 x(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)}w.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.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=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},i(_,w),_.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},_.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<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(A,w),i(E,w),i(S,w),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new _;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 S}return v[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):(c(t,t.umod(this.m)._forceRed(this)),t)},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),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,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<p);var b=this.pow(l,new o(1).iushln(p-g-1));h=h.redMul(b),l=b.redSqr(),d=d.redMul(l),p=g}return h},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4==++a||0===n&&0===f)&&(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 x(t)},i(x,M),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.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)},x.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)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:54}],83:[function(t,e,r){(function(t){(function(){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;o<n;++o)i[o]=e[o]^r[o];return i}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:84}],84:[function(t,e,r){(function(e){(function(){"use strict";var e=t("base64-js"),n=t("ieee754");function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=o.prototype,e}function o(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 u(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|l(t,e),n=i(r),s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(U(t,ArrayBuffer)||t&&U(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r)).__proto__=o.prototype,n}(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 o.from(n,e,r);var s=function(t){if(o.isBuffer(t)){var e=0|f(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||j(t.length)?i(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.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 a(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 u(t){return a(t),i(t<0?0:0|f(t))}function c(t){for(var e=t.length<0?0:0|f(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function l(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||U(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 P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(i)return n?-1:P(t).length;e=(""+e).toLowerCase(),i=!0}}function h(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 x(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(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),j(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=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:m(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):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(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 f=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(t,o+h)!==c(e,h)){l=!1;break}if(l)return o}return-1}function g(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(j(a))return s;t[r+s]=a}return s}function b(t,e,r,n){return L(P(e,t.length-r),t,r,n)}function y(t,e,r,n){return L(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return y(t,e,r,n)}function w(t,e,r,n){return L(D(e),t,r,n)}function _(t,e,r,n){return L(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function A(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=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)&&(f=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&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=O(t[o]);return i}function k(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function I(t,e,r,n,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function C(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 R(t,e,r,i,o){return e=+e,r>>>=0,o||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function B(t,e,r,i,o){return e=+e,r>>>=0,o||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}r.Buffer=o,r.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=2147483647,o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192,o.from=function(t,e,r){return s(t,e,r)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(t,e,r){return function(t,e,r){return a(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},o.allocUnsafe=function(t){return u(t)},o.allocUnsafeSlow=function(t){return u(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(U(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),U(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=o.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(U(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=l,o.prototype._isBuffer=!0,o.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;e<t;e+=2)d(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},o.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):h.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},o.prototype.compare=function(t,e,r,n,i){if(U(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.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 s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(s,a),c=this.slice(n,i),f=t.slice(e,r),l=0;l<u;++l)if(c[l]!==f[l]){s=c[l],a=f[l];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=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 g(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.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<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=o.prototype,n},o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},o.prototype.readUIntBE=function(t,e,r){t>>>=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},o.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},o.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]},o.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])},o.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<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},o.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},o.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.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},o.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},o.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},o.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]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),n.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),n.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),n.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),n.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||I(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||I(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},o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||I(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},o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||I(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},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);I(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);I(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},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||I(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||I(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},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||I(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},o.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.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<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var s=i-1;s>=0;--s)t[s+e]=this[s+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var a=o.isBuffer(t)?t:o.from(t,n),u=a.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=a[s%u]}return this};var N=/[^+/0-9A-Za-z-_]/g;function O(t){return t<16?"0"+t.toString(16):t.toString(16)}function P(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&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 D(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function U(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function j(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":49,buffer:84,ieee754:138}],85:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("string_decoder").StringDecoder;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}t("inherits")(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(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}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},e.exports=s},{inherits:139,"safe-buffer":192,stream:209,string_decoder:225}],86:[function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}void 0!==e&&(e.exports=n),n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<n.length;i++)if((r=n[i])===e||r.fn===e){n.splice(i,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var i=(r=r.slice(0)).length;n<i;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],87:[function(t,e,r){(function(t){(function(){function e(t){return Object.prototype.toString.call(t)}r.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},r.isBoolean=function(t){return"boolean"==typeof t},r.isNull=function(t){return null===t},r.isNullOrUndefined=function(t){return null==t},r.isNumber=function(t){return"number"==typeof t},r.isString=function(t){return"string"==typeof t},r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=function(t){return void 0===t},r.isRegExp=function(t){return"[object RegExp]"===e(t)},r.isObject=function(t){return"object"==typeof t&&null!==t},r.isDate=function(t){return"[object Date]"===e(t)},r.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},r.isFunction=function(t){return"function"==typeof t},r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t.isBuffer}).call(this)}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":140}],88:[function(t,e,r){(function(r){(function(){var n=t("elliptic"),i=t("bn.js");e.exports=function(t){return new s(t)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(t){this.curveType=o[t],this.curveType||(this.curveType={name:t}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(t,e,n){Array.isArray(t)||(t=t.toArray());var i=new r(t);if(n&&i.length<n){var o=new r(n-i.length);o.fill(0),i=r.concat([o,i])}return e?i.toString(e):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,s.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},s.prototype.computeSecret=function(t,e,n){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),a(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},s.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),a(r,t)},s.prototype.getPrivateKey=function(t){return a(this.keys.getPrivate(),t)},s.prototype.setPublicKey=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.keys._importPublic(t),this},s.prototype.setPrivateKey=function(t,e){e=e||"utf8",r.isBuffer(t)||(t=new r(t,e));var n=new i(t);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this)}).call(this,t("buffer").Buffer)},{"bn.js":52,buffer:84,elliptic:104}],89:[function(t,e,r){"use strict";var n=t("inherits"),i=t("md5.js"),o=t("ripemd160"),s=t("sha.js"),a=t("cipher-base");function u(t){a.call(this,"digest"),this._hash=t}n(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},{"cipher-base":85,inherits:139,"md5.js":150,ripemd160:191,"sha.js":202}],90:[function(t,e,r){var n=t("md5.js");e.exports=function(t){return(new n).update(t).digest()}},{"md5.js":150}],91:[function(t,e,r){"use strict";var n=t("inherits"),i=t("./legacy"),o=t("cipher-base"),s=t("safe-buffer").Buffer,a=t("create-hash/md5"),u=t("ripemd160"),c=t("sha.js"),f=s.alloc(128);function l(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new u:c(t)).update(e).digest():e.length<r&&(e=s.concat([e,f],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new u:c(t),this._hash.update(n)}n(l,o),l.prototype._update=function(t){this._hash.update(t)},l.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(t).digest()},e.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new l("rmd160",e):"md5"===t?new i(a,e):new l(t,e)}},{"./legacy":92,"cipher-base":85,"create-hash/md5":90,inherits:139,ripemd160:191,"safe-buffer":192,"sha.js":202}],92:[function(t,e,r){"use strict";var n=t("inherits"),i=t("safe-buffer").Buffer,o=t("cipher-base"),s=i.alloc(128);function a(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>64?e=t(e):e.length<64&&(e=i.concat([e,s],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),a=0;a<64;a++)r[a]=54^e[a],n[a]=92^e[a];this._hash=[r]}n(a,o),a.prototype._update=function(t){this._hash.push(t)},a.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},e.exports=a},{"cipher-base":85,inherits:139,"safe-buffer":192}],93:[function(t,e,r){"use strict";r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=t("randombytes"),r.createHash=r.Hash=t("create-hash"),r.createHmac=r.Hmac=t("create-hmac");var n=t("browserify-sign/algos"),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);r.getHashes=function(){return o};var s=t("pbkdf2");r.pbkdf2=s.pbkdf2,r.pbkdf2Sync=s.pbkdf2Sync;var a=t("browserify-cipher");r.Cipher=a.Cipher,r.createCipher=a.createCipher,r.Cipheriv=a.Cipheriv,r.createCipheriv=a.createCipheriv,r.Decipher=a.Decipher,r.createDecipher=a.createDecipher,r.Decipheriv=a.Decipheriv,r.createDecipheriv=a.createDecipheriv,r.getCiphers=a.getCiphers,r.listCiphers=a.listCiphers;var u=t("diffie-hellman");r.DiffieHellmanGroup=u.DiffieHellmanGroup,r.createDiffieHellmanGroup=u.createDiffieHellmanGroup,r.getDiffieHellman=u.getDiffieHellman,r.createDiffieHellman=u.createDiffieHellman,r.DiffieHellman=u.DiffieHellman;var c=t("browserify-sign");r.createSign=c.createSign,r.Sign=c.Sign,r.createVerify=c.createVerify,r.Verify=c.Verify,r.createECDH=t("create-ecdh");var f=t("public-encrypt");r.publicEncrypt=f.publicEncrypt,r.privateEncrypt=f.privateEncrypt,r.publicDecrypt=f.publicDecrypt,r.privateDecrypt=f.privateDecrypt;var l=t("randomfill");r.randomFill=l.randomFill,r.randomFillSync=l.randomFillSync,r.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},r.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":72,"browserify-sign":79,"browserify-sign/algos":76,"create-ecdh":88,"create-hash":89,"create-hmac":91,"diffie-hellman":100,pbkdf2:159,"public-encrypt":167,randombytes:173,randomfill:174}],94:[function(t,e,r){"use strict";r.utils=t("./des/utils"),r.Cipher=t("./des/cipher"),r.DES=t("./des/des"),r.CBC=t("./des/cbc"),r.EDE=t("./des/ede")},{"./des/cbc":95,"./des/cipher":96,"./des/des":97,"./des/ede":98,"./des/utils":99}],95:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}r.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];for(o._update.call(this,s,0,r,n),a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{for(o._update.call(this,t,e,r,n),a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},{inherits:139,"minimalistic-assert":152}],96:[function(t,e,r){"use strict";var n=t("minimalistic-assert");function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},{"minimalistic-assert":152}],97:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),o=t("./utils"),s=t("./cipher");function a(){this.tmp=new Array(2),this.keys=null}function u(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(u,s),e.exports=u,u.create=function(t){return new u(t)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=c[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},u.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},u.prototype._unpad=function(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},u.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,u=0;u<t.keys.length;u+=2){var c=t.keys[u],f=t.keys[u+1];o.expand(a,t.tmp,0),c^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(c,f),h=a;a=(s^o.permute(l))>>>0,s=h}o.rip(a,s,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],f=t.keys[u+1];o.expand(s,t.tmp,0),c^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(c,f),h=s;s=(a^o.permute(l))>>>0,a=h}o.rip(s,a,n,i)}},{"./cipher":96,"./utils":99,inherits:139,"minimalistic-assert":152}],98:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits"),o=t("./cipher"),s=t("./des");function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(u,o),e.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},{"./cipher":96,"./des":97,inherits:139,"minimalistic-assert":152}],99:[function(t,e,r){"use strict";r.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},r.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},r.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},r.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},r.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(t,e,r,i){for(var o=0,s=0,a=n.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>n[u]&1;for(u=a;u<n.length;u++)s<<=1,s|=e>>>n[u]&1;r[i+0]=o>>>0,r[i+1]=s>>>0},r.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(t,e){for(var r=0,n=0;n<4;n++)r<<=4,r|=i[64*n+(t>>>18-6*n&63)];for(n=0;n<4;n++)r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)];return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(t){for(var e=0,r=0;r<o.length;r++)e<<=1,e|=t>>>o[r]&1;return e>>>0},r.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},{}],100:[function(t,e,r){(function(e){(function(){var n=t("./lib/generatePrime"),i=t("./lib/primes.json"),o=t("./lib/dh"),s={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},r.createDiffieHellman=r.DiffieHellman=function t(r,i,a,u){return e.isBuffer(i)||void 0===s[i]?t(r,"binary",i,a):(i=i||"binary",u=u||"binary",a=a||new e([2]),e.isBuffer(a)||(a=new e(a,u)),"number"==typeof r?new o(n(r,a),a,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,a,!0)))}}).call(this)}).call(this,t("buffer").Buffer)},{"./lib/dh":101,"./lib/generatePrime":102,"./lib/primes.json":103,buffer:84}],101:[function(t,e,r){(function(r){(function(){var n=t("bn.js"),i=new(t("miller-rabin")),o=new n(24),s=new n(11),a=new n(10),u=new n(3),c=new n(7),f=t("./generatePrime"),l=t("randombytes");function h(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._pub=new n(t),this}function d(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this._priv=new n(t),this}e.exports=m;var p={};function m(t,e,r){this.setGenerator(e),this.__prime=new n(t),this._prime=n.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=d):this._primeCode=8}function g(t,e){var n=new r(t.toArray());return e?n.toString(e):n}Object.defineProperty(m.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in p)return p[n];var l,h=0;if(t.isEven()||!f.simpleSieve||!f.fermatTest(t)||!i.test(t))return h+=1,h+="02"===r||"05"===r?8:4,p[n]=h,h;switch(i.test(t.shrn(1))||(h+=2),r){case"02":t.mod(o).cmp(s)&&(h+=8);break;case"05":(l=t.mod(a)).cmp(u)&&l.cmp(c)&&(h+=8);break;default:h+=4}return p[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),m.prototype.generateKeys=function(){return this._priv||(this._priv=new n(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},m.prototype.computeSecret=function(t){var e=(t=(t=new n(t)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new r(e.toArray()),o=this.getPrime();if(i.length<o.length){var s=new r(o.length-i.length);s.fill(0),i=r.concat([s,i])}return i},m.prototype.getPublicKey=function(t){return g(this._pub,t)},m.prototype.getPrivateKey=function(t){return g(this._priv,t)},m.prototype.getPrime=function(t){return g(this.__prime,t)},m.prototype.getGenerator=function(t){return g(this._gen,t)},m.prototype.setGenerator=function(t,e){return e=e||"utf8",r.isBuffer(t)||(t=new r(t,e)),this.__gen=t,this._gen=new n(t),this}}).call(this)}).call(this,t("buffer").Buffer)},{"./generatePrime":102,"bn.js":52,buffer:84,"miller-rabin":151,randombytes:173}],102:[function(t,e,r){var n=t("randombytes");e.exports=b,b.simpleSieve=m,b.fermatTest=g;var i=t("bn.js"),o=new i(24),s=new(t("miller-rabin")),a=new i(1),u=new i(2),c=new i(5),f=(new i(16),new i(8),new i(10)),l=new i(3),h=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function m(t){for(var e=function(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function g(t){var e=i.mont(t);return 0===u.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function b(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(h);)r.iadd(d);if(m(p=r.shrn(1))&&m(r)&&g(p)&&g(r)&&s.test(p)&&s.test(r))return r}}},{"bn.js":52,"miller-rabin":151,randombytes:173}],103:[function(t,e,r){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],104:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":119,"./elliptic/curve":107,"./elliptic/curves":110,"./elliptic/ec":111,"./elliptic/eddsa":114,"./elliptic/utils":118,brorand:53}],105:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),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}e.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<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var s=[],u=0;u<n.length;u+=r.step){var c=0;for(e=u+r.step-1;e>=u;e--)c=(c<<1)+n[e];s.push(c)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=i;h>0;h--){for(u=0;u<s.length;u++)(c=s[u])===h?l=l.mixedAdd(r.points[u]):c===-h&&(l=l.mixedAdd(r.points[u].neg()));f=f.add(l)}return f.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(e=0;c>=0&&0===s[c];c--)e++;if(c>=0&&e++,u=u.dblp(e),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){for(var a=this._wnafT1,u=this._wnafT2,c=this._wnafT3,f=0,l=0;l<n;l++){var h=(M=e[l])._getNAFPoints(t);a[l]=h.wnd,u[l]=h.points}for(l=n-1;l>=1;l-=2){var d=l-1,p=l;if(1===a[d]&&1===a[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],b=s(r[d],r[p]);f=Math.max(b[0].length,f),c[d]=new Array(f),c[p]=new Array(f);for(var y=0;y<f;y++){var v=0|b[0][y],w=0|b[1][y];c[d][y]=g[3*(v+1)+(w+1)],c[p][y]=0,u[d]=m}}else c[d]=o(r[d],a[d],this._bitLength),c[p]=o(r[p],a[p],this._bitLength),f=Math.max(c[d].length,f),f=Math.max(c[p].length,f)}var _=this.jpoint(null,null,null),A=this._wnafT4;for(l=f;l>=0;l--){for(var E=0;l>=0;){var S=!0;for(y=0;y<n;y++)A[y]=0|c[y][l],0!==A[y]&&(S=!1);if(!S)break;E++,l--}if(l>=0&&E++,_=_.dblp(E),l<0)break;for(y=0;y<n;y++){var M,x=A[y];0!==x&&(x>0?M=u[y][x-1>>1]:x<0&&(M=u[y][-x-1>>1].neg()),_="affine"===M.type?_.mixedAdd(M):_.add(M))}}for(l=0;l<n;l++)u[l]=null;return i?_:_.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=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<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../utils":118,"bn.js":52}],106:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),o=t("inherits"),s=t("./base"),a=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function c(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),e.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(c,s.BasePoint),u.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new c(this,t,e,r,n)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},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),f=i.redMul(a),l=s.redMul(o);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var s=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(c.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),u=s.redSub(a).redISub(a);t=n.redSub(i).redISub(o).redMul(u),e=s.redMul(c.redSub(o)),r=s.redMul(u)}}else{var c=i.redAdd(o);a=this.curve._mulC(this.z).redSqr(),u=c.redSub(a).redSub(a),t=this.curve._mulC(n.redISub(c)).redMul(u),e=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}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),f=a.redMul(u),l=o.redMul(u),h=s.redMul(a);return this.curve.point(c,f,h,l)},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),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),l=n.redMul(u).redMul(f);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(l,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},{"../utils":118,"./base":105,"bn.js":52,inherits:139}],107:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":105,"./edwards":106,"./mont":108,"./short":109}],108:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("inherits"),o=t("./base"),s=t("../utils");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),e.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()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},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()}},{"../utils":118,"./base":105,"bn.js":52,inherits:139}],109:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),o=t("inherits"),s=t("./base"),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 f(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),e.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,f,l=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),b=new i(1),y=0;0!==h.cmpn(0);){var v=d.div(h);c=d.sub(v.mul(h)),f=g.sub(v.mul(p));var w=b.sub(v.mul(m));if(!n&&c.cmp(l)<0)e=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++y)break;u=c,d=h,h=c,g=p,p=f,b=m,m=w}s=c.neg(),a=f;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<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},o(c,s.BasePoint),u.prototype.point=function(t,e,r){return new c(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return c.fromJSON(this,t,e)},c.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},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(f,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.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)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.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(),f=c.redMul(a),l=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,d,p)},f.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),f=r.redMul(u),l=a.redSqr().redIAdd(c).redISub(f).redISub(f),h=a.redMul(f.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(l,h,d)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(r=0;r<t;r++){var f=o.redSqr(),l=c.redSqr(),h=l.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(l),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),b=d.redMul(g);b=b.redIAdd(b).redISub(h);var y=c.redMul(a);r+1<t&&(u=u.redMul(h)),o=m,a=y,c=b}return this.curve.jpoint(o,c.redMul(i),a)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=u,e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(f).redISub(h);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},f.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),h=this.x.redMul(l),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var g=l.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},f.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),c=(u=u.redIAdd(u)).redMul(s),f=a.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=a.redMul(l).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,d,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),f=e.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(a).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(l,h,d)},f.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},f.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":118,"./base":105,"bn.js":52,inherits:139}],110:[function(t,e,r){"use strict";var n,i=r,o=t("hash.js"),s=t("./curve"),a=t("./utils").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=t("./precomputed/secp256k1")}catch(t){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]})},{"./curve":107,"./precomputed/secp256k1":117,"./utils":118,"hash.js":125}],111:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("hmac-drbg"),o=t("../utils"),s=t("../curves"),a=t("brorand"),u=o.assert,c=t("./key"),f=t("./signature");function l(t){if(!(this instanceof l))return new l(t);"string"==typeof t&&(u(s.hasOwnProperty(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}e.exports=l,l.prototype.keyPair=function(t){return new c(this,t)},l.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},l.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},l.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)}},l.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},l.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"}),l=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(l)>=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 b=d.invm(this.n).mul(g.mul(e.getPrivate()).iadd(t));if(0!==(b=b.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),y^=1),new f({r:g,s:b,recoveryParam:y})}}}}}},l.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new f(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),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new f(e,i);var o=this.n,s=new n(t),a=e.r,c=e.s,l=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),l):this.curve.pointFromX(a,l);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)},l.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new f(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")}},{"../curves":110,"../utils":118,"./key":112,"./signature":113,"bn.js":52,brorand:53,"hmac-drbg":137}],112:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils").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)}e.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.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"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":118,"bn.js":52}],113:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),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<n;o++,s++)i<<=8,i|=t[s],i>>>=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<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}e.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 f=u(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var l=t.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(c),this.s=new n(l),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];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),s=[48];return f(s,o.length),s=s.concat(o),i.encode(s,t)}},{"../utils":118,"bn.js":52}],114:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("../curves"),o=t("../utils"),s=o.assert,a=o.parseBytes,u=t("./key"),c=t("./signature");function f(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(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}e.exports=f,f.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})},f.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)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},f.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},f.prototype.makeSignature=function(t){return t instanceof c?t:new c(this,t)},f.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},f.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(t){return o.intFromLE(t)},f.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../curves":110,"../utils":118,"./key":115,"./signature":116,"hash.js":125}],115:[function(t,e,r){"use strict";var n=t("../utils"),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},e.exports=a},{"../utils":118}],116:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},{"../utils":118,"bn.js":52}],117:[function(t,e,r){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],118:[function(t,e,r){"use strict";var n=r,i=t("bn.js"),o=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(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=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var o,s,a,u=t.andln(3)+n&3,c=e.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),o=0==(1&u)?0:3!=(a=t.andln(7)+n&7)&&5!==a||2!==c?u:-u,r[0].push(o),s=0==(1&c)?0:3!=(a=e.andln(7)+i&7)&&5!==a||2!==u?c:-c,r[1].push(s),2*n===o+1&&(n=1-n),2*i===s+1&&(i=1-i),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")}},{"bn.js":52,"minimalistic-assert":152,"minimalistic-crypto-utils":153}],119:[function(t,e,r){e.exports={_args:[["elliptic@6.5.3","/Volumes/Extreme_SSD/github.com/conflux-chain/js-conflux-sdk"]],_from:"elliptic@6.5.3",_id:"elliptic@6.5.3",_inBundle:!1,_integrity:"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.5.3",name:"elliptic",escapedName:"elliptic",rawSpec:"6.5.3",saveSpec:null,fetchSpec:"6.5.3"},_requiredBy:["/browserify-sign","/create-ecdh","/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",_spec:"6.5.3",_where:"/Volumes/Extreme_SSD/github.com/conflux-chain/js-conflux-sdk",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.3"}},{}],120:[function(t,e,r){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],121:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},o=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function s(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0;var a,u=10;try{var c={};Object.defineProperty&&Object.defineProperty(c,"x",{value:0}),a=0===c.x}catch(t){a=!1}function f(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function l(t,e,r){if(e)t.call(r);else for(var n=t.length,i=_(t,n),o=0;o<n;++o)i[o].call(r)}function h(t,e,r,n){if(e)t.call(r,n);else for(var i=t.length,o=_(t,i),s=0;s<i;++s)o[s].call(r,n)}function d(t,e,r,n,i){if(e)t.call(r,n,i);else for(var o=t.length,s=_(t,o),a=0;a<o;++a)s[a].call(r,n,i)}function p(t,e,r,n,i,o){if(e)t.call(r,n,i,o);else for(var s=t.length,a=_(t,s),u=0;u<s;++u)a[u].call(r,n,i,o)}function m(t,e,r,n){if(e)t.apply(r,n);else for(var i=t.length,o=_(t,i),s=0;s<i;++s)o[s].apply(r,n)}function g(t,e,r,i){var o,s,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((s=t._events)?(s.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),a=s[e]):(s=t._events=n(null),t._eventsCount=0),a){if("function"==typeof a?a=s[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),!a.warned&&(o=f(t))&&o>0&&a.length>o){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else a=s[e]=r,++t._eventsCount;return t}function b(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function y(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=o.call(b,n);return i.listener=r,n.wrapFn=i,i}function v(t,e,r){var n=t._events;if(!n)return[];var i=n[e];return i?"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):_(i,i.length):[]}function w(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function _(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}a?Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');u=t}}):s.defaultMaxListeners=u,s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(t){var e,r,n,i,o,s,a="error"===t;if(s=this._events)a=a&&null==s.error;else if(!a)return!1;if(a){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var u=new Error('Unhandled "error" event. ('+e+")");throw u.context=e,u}if(!(r=s[t]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:l(r,c,this);break;case 2:h(r,c,this,arguments[1]);break;case 3:d(r,c,this,arguments[1],arguments[2]);break;case 4:p(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o<n;o++)i[o-1]=arguments[o];m(r,c,this,i)}return!0},s.prototype.addListener=function(t,e){return g(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return g(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,y(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,y(this,t,e)),this},s.prototype.removeListener=function(t,e){var r,i,o,s,a;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=n(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===e||r[s].listener===e){a=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n<i;r+=1,n+=1)t[r]=t[n];t.pop()}(r,o),1===r.length&&(i[t]=r[0]),i.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.removeAllListeners=function(t){var e,r,o;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var s,a=i(r);for(o=0;o<a.length;++o)"removeListener"!==(s=a[o])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)for(o=e.length-1;o>=0;o--)this.removeListener(t,e[o]);return this},s.prototype.listeners=function(t){return v(this,t,!0)},s.prototype.rawListeners=function(t){return v(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):w.call(t,e)},s.prototype.listenerCount=w,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],122:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("md5.js");e.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),u=n.alloc(o||0),c=n.alloc(0);s>0||o>0;){var f=new i;f.update(c),f.update(t),e&&f.update(e),c=f.digest();var l=0;if(s>0){var h=a.length-s;l=Math.min(s,c.length),c.copy(a,h,0,l),s-=l}if(l<c.length&&o>0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:a,iv:u}}},{"md5.js":150,"safe-buffer":192}],123:[function(t,e,r){e.exports=o,o.default=o,o.stable=a,o.stableStringify=a;var n=[],i=[];function o(t,e,r){var o;for(function t(e,r,o,s){var a;if("object"==typeof e&&null!==e){for(a=0;a<o.length;a++)if(o[a]===e){var u=Object.getOwnPropertyDescriptor(s,r);return void(void 0!==u.get?u.configurable?(Object.defineProperty(s,r,{value:"[Circular]"}),n.push([s,r,e,u])):i.push([e,r]):(s[r]="[Circular]",n.push([s,r,e])))}if(o.push(e),Array.isArray(e))for(a=0;a<e.length;a++)t(e[a],a,o,e);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var f=c[a];t(e[f],f,o,e)}}o.pop()}}(t,"",[],void 0),o=0===i.length?JSON.stringify(t,e,r):JSON.stringify(t,u(e),r);0!==n.length;){var s=n.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}return o}function s(t,e){return t<e?-1:t>e?1:0}function a(t,e,r){var o,a=function t(e,r,o,a){var u;if("object"==typeof e&&null!==e){for(u=0;u<o.length;u++)if(o[u]===e){var c=Object.getOwnPropertyDescriptor(a,r);return void(void 0!==c.get?c.configurable?(Object.defineProperty(a,r,{value:"[Circular]"}),n.push([a,r,e,c])):i.push([e,r]):(a[r]="[Circular]",n.push([a,r,e])))}if("function"==typeof e.toJSON)return;if(o.push(e),Array.isArray(e))for(u=0;u<e.length;u++)t(e[u],u,o,e);else{var f={},l=Object.keys(e).sort(s);for(u=0;u<l.length;u++){var h=l[u];t(e[h],h,o,e),f[h]=e[h]}if(void 0===a)return f;n.push([a,r,e]),a[r]=f}o.pop()}}(t,"",[],void 0)||t;for(o=0===i.length?JSON.stringify(a,e,r):JSON.stringify(a,u(e),r);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 o}function u(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(i.length>0)for(var n=0;n<i.length;n++){var o=i[n];if(o[1]===e&&o[0]===r){r="[Circular]",i.splice(n,1);break}}return t.call(this,e,r)}}},{}],124:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("readable-stream").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}t("inherits")(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),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;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++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")},e.exports=o},{inherits:139,"readable-stream":189,"safe-buffer":192}],125:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),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},{"./hash/common":126,"./hash/hmac":127,"./hash/ripemd":128,"./hash/sha":129,"./hash/utils":136}],126:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");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}r.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<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>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;o<this.padLength;o++)n[i++]=0;return n}},{"./utils":136,"minimalistic-assert":152}],127:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}e.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":136,"minimalistic-assert":152}],128:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./common"),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,c),r.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],f=this.h[4],y=r,v=n,w=i,_=c,A=f,E=0;E<80;E++){var S=s(o(u(r,l(E,n,i,c),t[p[E]+e],h(E)),g[E]),f);r=f,f=c,c=o(i,10),i=n,n=S,S=s(o(u(y,l(79-E,v,w,_),t[m[E]+e],d(E)),b[E]),A),y=A,A=_,_=o(w,10),w=v,v=S}S=a(this.h[1],i,_),this.h[1]=a(this.h[2],c,A),this.h[2]=a(this.h[3],f,y),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=S},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],m=[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],g=[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],b=[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]},{"./common":126,"./utils":136}],129:[function(t,e,r){"use strict";r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":130,"./sha/224":131,"./sha/256":132,"./sha/384":133,"./sha/512":134}],130:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],h=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=u(s(i,5),c(p,o,f,h),d,r[n],l[p]);d=h,h=f,f=s(o,30),o=i,i=m}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],f),this.h[3]=a(this.h[3],h),this.h[4]=a(this.h[4],d)},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":126,"../utils":136,"./common":135}],131:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./256");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},{"../utils":136,"./256":132}],132:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),s=t("minimalistic-assert"),a=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(y,g),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],b=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var A=c(_,d(y),f(y,v,w),this.k[n],r[n]),E=a(h(i),l(i,o,g));_=w,w=v,v=y,y=a(b,A),b=g,g=o,o=i,i=a(A,E)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":126,"../utils":136,"./common":135,"minimalistic-assert":152}],133:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./512");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},{"../utils":136,"./512":134}],134:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("minimalistic-assert"),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,h=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,b=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function A(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function S(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function M(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,1)^a(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function R(t,e){var r=a(t,e,19)^a(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,b),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=C(r[n-4],r[n-3]),o=R(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=T(r[n-30],r[n-29]),c=I(r[n-30],r[n-29]),f=r[n-32],l=r[n-31];r[n]=d(i,o,s,a,u,c,f,l),r[n+1]=p(i,o,s,a,u,c,f,l)}},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],d=this.h[6],p=this.h[7],b=this.h[8],y=this.h[9],v=this.h[10],T=this.h[11],I=this.h[12],C=this.h[13],R=this.h[14],B=this.h[15];o(this.k.length===r.length);for(var N=0;N<r.length;N+=2){var O=R,P=B,D=x(b,y),L=k(b,y),U=w(b,0,v,0,I),j=_(0,y,0,T,0,C),F=this.k[N],q=this.k[N+1],z=r[N],H=r[N+1],K=m(O,P,D,L,U,j,F,q,z,H),G=g(O,P,D,L,U,j,F,q,z,H);O=S(n,i),P=M(n,i),D=A(n,0,s,0,u),L=E(0,i,0,a,0,c);var W=l(O,P,D,L),V=h(O,P,D,L);R=I,B=C,I=v,C=T,v=b,T=y,b=l(d,p,K,G),y=h(p,p,K,G),d=u,p=c,u=s,c=a,s=n,a=i,n=l(K,G,W,V),i=h(K,G,W,V)}f(this.h,0,n,i),f(this.h,2,s,a),f(this.h,4,u,c),f(this.h,6,d,p),f(this.h,8,b,y),f(this.h,10,v,T),f(this.h,12,I,C),f(this.h,14,R,B)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":126,"../utils":136,"minimalistic-assert":152}],135:[function(t,e,r){"use strict";var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},r.ch32=i,r.maj32=o,r.p32=s,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":136}],136:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits");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}r.inherits=i,r.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<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>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<t.length;i++)r[i]=0|t[i];return r},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},r.htonl=s,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},r.zero2=a,r.zero8=u,r.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var c;c="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=c>>>0}return s},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>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},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,c=e;return u+=(c=c+n>>>0)<e?1:0,u+=(c=c+o>>>0)<o?1:0,t+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,c){var f=0,l=e;return f+=(l=l+n>>>0)<e?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+a>>>0)<a?1:0,t+r+i+s+u+(f+=(l=l+c>>>0)<c?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,c){return e+n+o+a+c>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:139,"minimalistic-assert":152}],137:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");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)}e.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.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=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<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},{"hash.js":125,"minimalistic-assert":152,"minimalistic-crypto-utils":153}],138:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,d=t[e+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+t[e+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=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)},r.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>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=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,i),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[r+d]=255&s,d+=p,s/=256,c-=8);t[r+d-p]|=128*m}},{}],139:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],140:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],141:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],142:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():(t=t||self).JSBI=n()}(this,(function(){"use strict";var t=Math.imul,e=Math.clz32;function r(t){return(r="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})(t)}function n(t,e){for(var r,n=0;n<e.length;n++)(r=e[n]).enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function o(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&&a(t,e)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function c(){return(c=u()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&a(i,r.prototype),i}).apply(null,arguments)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=function(t){function r(){return c(t,arguments,s(this).constructor)}if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a(r,t)})(t)}function l(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){var e=u();return function(){var r,n=s(t);if(e){var i=s(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return l(this,r)}}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var p=function(t){var e=Math.abs,n=Math.max;function s(t,e){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),t>s.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return(r=a.call(this,t)).sign=e,r}o(s,t);var a=h(s);return i(s,[{key:"toDebugString",value:function(){var t,e=["BigInt["],r=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}(this);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push((n?(n>>>0).toString(16):n)+", ")}}catch(t){r.e(t)}finally{r.f()}return e.push("]"),e.join("")}},{key:"toString",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10;if(2>t||36<t)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":0==(t&t-1)?s.__toStringBasePowerOfTwo(this,t):s.__toStringGeneric(this,t,!1)}},{key:"__copy",value:function(){for(var t=new s(this.length,this.sign),e=0;e<this.length;e++)t[e]=this[e];return t}},{key:"__trim",value:function(){for(var t=this.length,e=this[t-1];0===e;)e=this[--t-1],this.pop();return 0===t&&(this.sign=!1),this}},{key:"__initializeDigits",value:function(){for(var t=0;t<this.length;t++)this[t]=0}},{key:"__clzmsd",value:function(){return s.__clz32(this[this.length-1])}},{key:"__inplaceMultiplyAdd",value:function(t,e,r){r>this.length&&(r=this.length);for(var n=65535&t,i=t>>>16,o=0,a=65535&e,u=e>>>16,c=0;c<r;c++){var f=this.__digit(c),l=65535&f,h=f>>>16,d=s.__imul(l,n),p=s.__imul(l,i),m=s.__imul(h,n),g=s.__imul(h,i),b=a+(65535&d),y=u+o+(b>>>16)+(d>>>16)+(65535&p)+(65535&m);o=(a=(p>>>16)+(m>>>16)+(65535&g)+(y>>>16))>>>16,a&=65535,u=g>>>16,this.__setDigit(c,65535&b|y<<16)}if(0!==o||0!==a||0!==u)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function(t,e,r){for(var n,i=0,o=0;o<r;o++)i=(n=this.__halfDigit(e+o)+t.__halfDigit(o)+i)>>>16,this.__setHalfDigit(e+o,n);return i}},{key:"__inplaceSub",value:function(t,e,r){var n=0;if(1&e){e>>=1;for(var i=this.__digit(e),o=65535&i,s=0;s<r-1>>>1;s++){var a=t.__digit(s),u=(i>>>16)-(65535&a)-n;n=1&u>>>16,this.__setDigit(e+s,u<<16|65535&o),n=1&(o=(65535&(i=this.__digit(e+s+1)))-(a>>>16)-n)>>>16}var c=t.__digit(s),f=(i>>>16)-(65535&c)-n;if(n=1&f>>>16,this.__setDigit(e+s,f<<16|65535&o),e+s+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(n=1&(o=(65535&(i=this.__digit(e+s+1)))-(c>>>16)-n)>>>16,this.__setDigit(e+t.length,4294901760&i|65535&o))}else{e>>=1;for(var l=0;l<t.length-1;l++){var h=this.__digit(e+l),d=t.__digit(l),p=(65535&h)-(65535&d)-n,m=(h>>>16)-(d>>>16)-(n=1&p>>>16);n=1&m>>>16,this.__setDigit(e+l,m<<16|65535&p)}var g=this.__digit(e+l),b=t.__digit(l),y=(65535&g)-(65535&b)-n;n=1&y>>>16;var v=0;0==(1&r)&&(n=1&(v=(g>>>16)-(b>>>16)-n)>>>16),this.__setDigit(e+l,v<<16|65535&y)}return n}},{key:"__inplaceRightShift",value:function(t){if(0!==t){for(var e,r=this.__digit(0)>>>t,n=this.length-1,i=0;i<n;i++)e=this.__digit(i+1),this.__setDigit(i,e<<32-t|r),r=e>>>t;this.__setDigit(n,r)}}},{key:"__digit",value:function(t){return this[t]}},{key:"__unsignedDigit",value:function(t){return this[t]>>>0}},{key:"__setDigit",value:function(t,e){this[t]=0|e}},{key:"__setDigitGrow",value:function(t,e){this[t]=0|e}},{key:"__halfDigitLength",value:function(){var t=this.length;return 65535>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function(t){return 65535&this[t>>>1]>>>((1&t)<<4)}},{key:"__setHalfDigit",value:function(t,e){var r=t>>>1,n=this.__digit(r),i=1&t?65535&n|e<<16:4294901760&n|65535&e;this.__setDigit(r,i)}}],[{key:"BigInt",value:function(t){var e=Math.floor,n=Number.isFinite;if("number"==typeof t){if(0===t)return s.__zero();if((0|t)===t)return 0>t?s.__oneDigit(-t,!0):s.__oneDigit(t,!1);if(!n(t)||e(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return s.__fromDouble(t)}if("string"==typeof t){var i=s.__fromString(t);if(null===i)throw new SyntaxError("Cannot convert "+t+" to a BigInt");return i}if("boolean"==typeof t)return!0===t?s.__oneDigit(1,!1):s.__zero();if("object"===r(t)){if(t.constructor===s)return t;var o=s.__toPrimitive(t);return s.BigInt(o)}throw new TypeError("Cannot convert "+t+" to a BigInt")}},{key:"toNumber",value:function(t){var e=t.length;if(0===e)return 0;if(1===e){var r=t.__unsignedDigit(0);return t.sign?-r:r}var n=t.__digit(e-1),i=s.__clz32(n),o=32*e-i;if(1024<o)return t.sign?-1/0:1/0;var a=o-1,u=n,c=e-1,f=i+1,l=32===f?0:u<<f;l>>>=12;var h=f-12,d=12<=f?0:u<<20+f,p=20+f;0<h&&0<c&&(c--,l|=(u=t.__digit(c))>>>32-h,d=u<<h,p=h),0<p&&0<c&&(c--,d|=(u=t.__digit(c))>>>32-p,p-=32);var m=s.__decideRounding(t,p,c,u);if((1===m||0===m&&1==(1&d))&&0==(d=d+1>>>0)&&0!=++l>>>20&&(l=0,1023<++a))return t.sign?-1/0:1/0;var g=t.sign?-2147483648:0;return a=a+1023<<20,s.__kBitConversionInts[1]=g|a|l,s.__kBitConversionInts[0]=d,s.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function(t){if(0===t.length)return t;var e=t.__copy();return e.sign=!t.sign,e}},{key:"bitwiseNot",value:function(t){return t.sign?s.__absoluteSubOne(t).__trim():s.__absoluteAddOne(t,!0)}},{key:"exponentiate",value:function(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return s.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?s.unaryMinus(t):t;if(1<e.length)throw new RangeError("BigInt too big");var r=e.__unsignedDigit(0);if(1===r)return t;if(r>=s.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){var n=1+(r>>>5),i=new s(n,t.sign&&0!=(1&r));i.__initializeDigits();var o=1<<(31&r);return i.__setDigit(n-1,o),i}var a=null,u=t;for(0!=(1&r)&&(a=t),r>>=1;0!==r;r>>=1)u=s.multiply(u,u),0!=(1&r)&&(a=null===a?u:s.multiply(a,u));return a}},{key:"multiply",value:function(t,e){if(0===t.length)return t;if(0===e.length)return e;var r=t.length+e.length;32<=t.__clzmsd()+e.__clzmsd()&&r--;var n=new s(r,t.sign!==e.sign);n.__initializeDigits();for(var i=0;i<t.length;i++)s.__multiplyAccumulate(e,t.__digit(i),n,i);return n.__trim()}},{key:"divide",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>s.__absoluteCompare(t,e))return s.__zero();var r,n=t.sign!==e.sign,i=e.__unsignedDigit(0);if(1===e.length&&65535>=i){if(1===i)return n===t.sign?t:s.unaryMinus(t);r=s.__absoluteDivSmall(t,i,null)}else r=s.__absoluteDivLarge(t,e,!0,!1);return r.sign=n,r.__trim()}},{key:"remainder",value:function(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>s.__absoluteCompare(t,e))return t;var r=e.__unsignedDigit(0);if(1===e.length&&65535>=r){if(1===r)return s.__zero();var n=s.__absoluteModSmall(t,r);return 0===n?s.__zero():s.__oneDigit(n,t.sign)}var i=s.__absoluteDivLarge(t,e,!1,!0);return i.sign=t.sign,i.__trim()}},{key:"add",value:function(t,e){var r=t.sign;return r===e.sign?s.__absoluteAdd(t,e,r):0<=s.__absoluteCompare(t,e)?s.__absoluteSub(t,e,r):s.__absoluteSub(e,t,!r)}},{key:"subtract",value:function(t,e){var r=t.sign;return r===e.sign?0<=s.__absoluteCompare(t,e)?s.__absoluteSub(t,e,r):s.__absoluteSub(e,t,!r):s.__absoluteAdd(t,e,r)}},{key:"leftShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?s.__rightShiftByAbsolute(t,e):s.__leftShiftByAbsolute(t,e)}},{key:"signedRightShift",value:function(t,e){return 0===e.length||0===t.length?t:e.sign?s.__leftShiftByAbsolute(t,e):s.__rightShiftByAbsolute(t,e)}},{key:"unsignedRightShift",value:function(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function(t,e){return 0>s.__compareToBigInt(t,e)}},{key:"lessThanOrEqual",value:function(t,e){return 0>=s.__compareToBigInt(t,e)}},{key:"greaterThan",value:function(t,e){return 0<s.__compareToBigInt(t,e)}},{key:"greaterThanOrEqual",value:function(t,e){return 0<=s.__compareToBigInt(t,e)}},{key:"equal",value:function(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t.__digit(r)!==e.__digit(r))return!1;return!0}},{key:"notEqual",value:function(t,e){return!s.equal(t,e)}},{key:"bitwiseAnd",value:function(t,e){if(!t.sign&&!e.sign)return s.__absoluteAnd(t,e).__trim();if(t.sign&&e.sign){var r=n(t.length,e.length)+1,i=s.__absoluteSubOne(t,r),o=s.__absoluteSubOne(e);return i=s.__absoluteOr(i,o,i),s.__absoluteAddOne(i,!0,i).__trim()}if(t.sign){var a=[e,t];t=a[0],e=a[1]}return s.__absoluteAndNot(t,s.__absoluteSubOne(e)).__trim()}},{key:"bitwiseXor",value:function(t,e){if(!t.sign&&!e.sign)return s.__absoluteXor(t,e).__trim();if(t.sign&&e.sign){var r=n(t.length,e.length),i=s.__absoluteSubOne(t,r),o=s.__absoluteSubOne(e);return s.__absoluteXor(i,o,i).__trim()}var a=n(t.length,e.length)+1;if(t.sign){var u=[e,t];t=u[0],e=u[1]}var c=s.__absoluteSubOne(e,a);return c=s.__absoluteXor(c,t,c),s.__absoluteAddOne(c,!0,c).__trim()}},{key:"bitwiseOr",value:function(t,e){var r=n(t.length,e.length);if(!t.sign&&!e.sign)return s.__absoluteOr(t,e).__trim();if(t.sign&&e.sign){var i=s.__absoluteSubOne(t,r),o=s.__absoluteSubOne(e);return i=s.__absoluteAnd(i,o,i),s.__absoluteAddOne(i,!0,i).__trim()}if(t.sign){var a=[e,t];t=a[0],e=a[1]}var u=s.__absoluteSubOne(e,r);return u=s.__absoluteAndNot(u,t,u),s.__absoluteAddOne(u,!0,u).__trim()}},{key:"asIntN",value:function(t,e){if(0===e.length)return e;if(0===t)return s.__zero();if(t>=s.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length<r)return e;var n=e.__unsignedDigit(r-1),i=1<<(31&t-1);if(e.length===r&&n<i)return e;if((n&i)!==i)return s.__truncateToNBits(t,e);if(!e.sign)return s.__truncateAndSubFromPowerOfTwo(t,e,!0);if(0==(n&i-1)){for(var o=r-2;0<=o;o--)if(0!==e.__digit(o))return s.__truncateAndSubFromPowerOfTwo(t,e,!1);return e.length===r&&n===i?e:s.__truncateToNBits(t,e)}return s.__truncateAndSubFromPowerOfTwo(t,e,!1)}},{key:"asUintN",value:function(t,e){if(0===e.length)return e;if(0===t)return s.__zero();if(e.sign){if(t>s.__kMaxLengthBits)throw new RangeError("BigInt too big");return s.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=s.__kMaxLengthBits)return e;var r=t+31>>>5;if(e.length<r)return e;var n=31&t;if(e.length==r){if(0===n)return e;if(0==e.__digit(r-1)>>>n)return e}return s.__truncateToNBits(t,e)}},{key:"ADD",value:function(t,e){if(t=s.__toPrimitive(t),e=s.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=s.__toNumeric(t),e=s.__toNumeric(e),s.__isBigInt(t)&&s.__isBigInt(e))return s.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function(t,e){return s.__compare(t,e,0)}},{key:"LE",value:function(t,e){return s.__compare(t,e,1)}},{key:"GT",value:function(t,e){return s.__compare(t,e,2)}},{key:"GE",value:function(t,e){return s.__compare(t,e,3)}},{key:"EQ",value:function(t,e){for(;;){if(s.__isBigInt(t))return s.__isBigInt(e)?s.equal(t,e):s.EQ(e,t);if("number"==typeof t){if(s.__isBigInt(e))return s.__equalToNumber(e,t);if("object"!==r(e))return t==e;e=s.__toPrimitive(e)}else if("string"==typeof t){if(s.__isBigInt(e))return null!==(t=s.__fromString(t))&&s.equal(t,e);if("object"!==r(e))return t==e;e=s.__toPrimitive(e)}else if("boolean"==typeof t){if(s.__isBigInt(e))return s.__equalToNumber(e,+t);if("object"!==r(e))return t==e;e=s.__toPrimitive(e)}else if("symbol"===r(t)){if(s.__isBigInt(e))return!1;if("object"!==r(e))return t==e;e=s.__toPrimitive(e)}else{if("object"!==r(t))return t==e;if("object"===r(e)&&e.constructor!==s)return t==e;t=s.__toPrimitive(t)}}}},{key:"NE",value:function(t,e){return!s.EQ(t,e)}},{key:"__zero",value:function(){return new s(0,!1)}},{key:"__oneDigit",value:function(t,e){var r=new s(1,e);return r.__setDigit(0,t),r}},{key:"__decideRounding",value:function(t,e,r,n){if(0<e)return-1;var i;if(0>e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=31}var o=1<<i;if(0==(n&o))return-1;if(0!=(n&(o-=1)))return 1;for(;0<r;)if(r--,0!==t.__digit(r))return 1;return 0}},{key:"__fromDouble",value:function(t){s.__kBitConversionDouble[0]=t;var e,r=(2047&s.__kBitConversionInts[1]>>>20)-1023,n=1+(r>>>5),i=new s(n,0>t),o=1048575&s.__kBitConversionInts[1]|1048576,a=s.__kBitConversionInts[0],u=31&r,c=0;if(u<20){var f=20-u;c=f+32,e=o>>>f,o=o<<32-f|a>>>f,a<<=32-f}else if(20===u)c=32,e=o,o=a;else{var l=u-20;c=32-l,e=o<<l|a>>>32-l,o=a<<l}i.__setDigit(n-1,e);for(var h=n-2;0<=h;h--)0<c?(c-=32,e=o,o=a):e=0,i.__setDigit(h,e);return i.__trim()}},{key:"__isWhitespace",value:function(t){return!!(13>=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}},{key:"__fromString",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=0,n=t.length,i=0;if(i===n)return s.__zero();for(var o=t.charCodeAt(i);s.__isWhitespace(o);){if(++i===n)return s.__zero();o=t.charCodeAt(i)}if(43===o){if(++i===n)return null;o=t.charCodeAt(i),r=1}else if(45===o){if(++i===n)return null;o=t.charCodeAt(i),r=-1}if(0===e){if(e=10,48===o){if(++i===n)return s.__zero();if(88===(o=t.charCodeAt(i))||120===o){if(e=16,++i===n)return null;o=t.charCodeAt(i)}else if(79===o||111===o){if(e=8,++i===n)return null;o=t.charCodeAt(i)}else if(66===o||98===o){if(e=2,++i===n)return null;o=t.charCodeAt(i)}}}else if(16===e&&48===o){if(++i===n)return s.__zero();if(88===(o=t.charCodeAt(i))||120===o){if(++i===n)return null;o=t.charCodeAt(i)}}for(;48===o;){if(++i===n)return s.__zero();o=t.charCodeAt(i)}var a=n-i,u=s.__kMaxBitsPerChar[e],c=s.__kBitsPerCharTableMultiplier-1;if(a>1073741824/u)return null;var f=new s(31+(u*a+c>>>s.__kBitsPerCharTableShift)>>>5,!1),l=10>e?e:10,h=10<e?e-10:0;if(0==(e&e-1)){u>>=s.__kBitsPerCharTableShift;var d=[],p=[],m=!1;do{for(var g,b=0,y=0;;){if(g=void 0,o-48>>>0<l)g=o-48;else{if(!((32|o)-97>>>0<h)){m=!0;break}g=(32|o)-87}if(y+=u,b=b<<u|g,++i===n){m=!0;break}if(o=t.charCodeAt(i),32<y+u)break}d.push(b),p.push(y)}while(!m);s.__fillFromParts(f,d,p)}else{f.__initializeDigits();var v=!1,w=0;do{for(var _,A=0,E=1;;){if(_=void 0,o-48>>>0<l)_=o-48;else{if(!((32|o)-97>>>0<h)){v=!0;break}_=(32|o)-87}var S=E*e;if(4294967295<S)break;if(E=S,A=A*e+_,w++,++i===n){v=!0;break}o=t.charCodeAt(i)}var M=u*w+(c=32*s.__kBitsPerCharTableMultiplier-1)>>>s.__kBitsPerCharTableShift+5;f.__inplaceMultiplyAdd(E,A,M)}while(!v)}if(i!==n){if(!s.__isWhitespace(o))return null;for(i++;i<n;i++)if(o=t.charCodeAt(i),!s.__isWhitespace(o))return null}return 0!==r&&10!==e?null:(f.sign=-1===r,f.__trim())}},{key:"__fillFromParts",value:function(t,e,r){for(var n=0,i=0,o=0,s=e.length-1;0<=s;s--){var a=e[s],u=r[s];i|=a<<o,32===(o+=u)?(t.__setDigit(n++,i),o=0,i=0):32<o&&(t.__setDigit(n++,i),i=a>>>u-(o-=32))}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n<t.length;n++)t.__setDigit(n,0)}},{key:"__toStringBasePowerOfTwo",value:function(t,e){var r=t.length,n=e-1,i=n=(15&(n=(51&(n=(85&n>>>1)+(85&n))>>>2)+(51&n))>>>4)+(15&n),o=e-1,a=t.__digit(r-1),u=0|(32*r-s.__clz32(a)+i-1)/i;if(t.sign&&u++,268435456<u)throw new Error("string too long");for(var c=Array(u),f=u-1,l=0,h=0,d=0;d<r-1;d++){var p=t.__digit(d),m=(l|p<<h)&o;c[f--]=s.__kConversionChars[m];var g=i-h;for(l=p>>>g,h=32-g;h>=i;)c[f--]=s.__kConversionChars[l&o],l>>>=i,h-=i}var b=(l|a<<h)&o;for(c[f--]=s.__kConversionChars[b],l=a>>>i-h;0!==l;)c[f--]=s.__kConversionChars[l&o],l>>>=i;if(t.sign&&(c[f--]="-"),-1!==f)throw new Error("implementation bug");return c.join("")}},{key:"__toStringGeneric",value:function(t,e,r){var n=t.length;if(0===n)return"";if(1===n){var i=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(i="-"+i),i}var o,a,u=32*n-s.__clz32(t.__digit(n-1)),c=s.__kMaxBitsPerChar[e]-1,f=u*s.__kBitsPerCharTableMultiplier,l=1+(f=0|(f+=c-1)/c)>>1,h=s.exponentiate(s.__oneDigit(e,!1),s.__oneDigit(l,!1)),d=h.__unsignedDigit(0);if(1===h.length&&65535>=d){(o=new s(t.length,!1)).__initializeDigits();for(var p,m=0,g=2*t.length-1;0<=g;g--)p=m<<16|t.__halfDigit(g),o.__setHalfDigit(g,0|p/d),m=0|p%d;a=m.toString(e)}else{var b=s.__absoluteDivLarge(t,h,!0,!0);o=b.quotient;var y=b.remainder.__trim();a=s.__toStringGeneric(y,e,!0)}o.__trim();for(var v=s.__toStringGeneric(o,e,!0);a.length<l;)a="0"+a;return!1===r&&t.sign&&(v="-"+v),v+a}},{key:"__unequalSign",value:function(t){return t?-1:1}},{key:"__absoluteGreater",value:function(t){return t?-1:1}},{key:"__absoluteLess",value:function(t){return t?1:-1}},{key:"__compareToBigInt",value:function(t,e){var r=t.sign;if(r!==e.sign)return s.__unequalSign(r);var n=s.__absoluteCompare(t,e);return 0<n?s.__absoluteGreater(r):0>n?s.__absoluteLess(r):0}},{key:"__compareToNumber",value:function(t,r){if(!0|r){var n=t.sign,i=0>r;if(n!==i)return s.__unequalSign(n);if(0===t.length){if(i)throw new Error("implementation bug");return 0===r?0:-1}if(1<t.length)return s.__absoluteGreater(n);var o=e(r),a=t.__unsignedDigit(0);return a>o?s.__absoluteGreater(n):a<o?s.__absoluteLess(n):0}return s.__compareToDouble(t,r)}},{key:"__compareToDouble",value:function(t,e){if(e!=e)return e;if(e===1/0)return-1;if(e===-1/0)return 1;var r=t.sign;if(r!==0>e)return s.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;s.__kBitConversionDouble[0]=e;var n=2047&s.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");var i=n-1023;if(0>i)return s.__absoluteGreater(r);var o=t.length,a=t.__digit(o-1),u=s.__clz32(a),c=32*o-u,f=i+1;if(c<f)return s.__absoluteLess(r);if(c>f)return s.__absoluteGreater(r);var l=1048576|1048575&s.__kBitConversionInts[1],h=s.__kBitConversionInts[0],d=31-u;if(d!==(c-1)%31)throw new Error("implementation bug");var p,m=0;if(d<20){var g=20-d;m=g+32,p=l>>>g,l=l<<32-g|h>>>g,h<<=32-g}else if(20===d)m=32,p=l,l=h;else{var b=d-20;m=32-b,p=l<<b|h>>>32-b,l=h<<b}if((a>>>=0)>(p>>>=0))return s.__absoluteGreater(r);if(a<p)return s.__absoluteLess(r);for(var y=o-2;0<=y;y--){0<m?(m-=32,p=l>>>0,l=h,h=0):p=0;var v=t.__unsignedDigit(y);if(v>p)return s.__absoluteGreater(r);if(v<p)return s.__absoluteLess(r)}if(0!==l||0!==h){if(0===m)throw new Error("implementation bug");return s.__absoluteLess(r)}return 0}},{key:"__equalToNumber",value:function(t,r){return r|0===r?0===r?0===t.length:1===t.length&&t.sign===0>r&&t.__unsignedDigit(0)===e(r):0===s.__compareToDouble(t,r)}},{key:"__comparisonResultToBool",value:function(t,e){switch(e){case 0:return 0>t;case 1:return 0>=t;case 2:return 0<t;case 3:return 0<=t}throw new Error("unreachable")}},{key:"__compare",value:function(t,e,r){if(t=s.__toPrimitive(t),e=s.__toPrimitive(e),"string"==typeof t&&"string"==typeof e)switch(r){case 0:return t<e;case 1:return t<=e;case 2:return t>e;case 3:return t>=e}if(s.__isBigInt(t)&&"string"==typeof e)return null!==(e=s.__fromString(e))&&s.__comparisonResultToBool(s.__compareToBigInt(t,e),r);if("string"==typeof t&&s.__isBigInt(e))return null!==(t=s.__fromString(t))&&s.__comparisonResultToBool(s.__compareToBigInt(t,e),r);if(t=s.__toNumeric(t),e=s.__toNumeric(e),s.__isBigInt(t)){if(s.__isBigInt(e))return s.__comparisonResultToBool(s.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return s.__comparisonResultToBool(s.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(s.__isBigInt(e))return s.__comparisonResultToBool(s.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?t<e:1===r?t<=e:2===r?t>e:3===r?t>=e:void 0}},{key:"__absoluteAdd",value:function(t,e,r){if(t.length<e.length)return s.__absoluteAdd(e,t,r);if(0===t.length)return t;if(0===e.length)return t.sign===r?t:s.unaryMinus(t);var n=t.length;(0===t.__clzmsd()||e.length===t.length&&0===e.__clzmsd())&&n++;for(var i=new s(n,r),o=0,a=0;a<e.length;a++){var u=e.__digit(a),c=t.__digit(a),f=(65535&c)+(65535&u)+o,l=(c>>>16)+(u>>>16)+(f>>>16);o=l>>>16,i.__setDigit(a,65535&f|l<<16)}for(;a<t.length;a++){var h=t.__digit(a),d=(65535&h)+o,p=(h>>>16)+(d>>>16);o=p>>>16,i.__setDigit(a,65535&d|p<<16)}return a<i.length&&i.__setDigit(a,o),i.__trim()}},{key:"__absoluteSub",value:function(t,e,r){if(0===t.length)return t;if(0===e.length)return t.sign===r?t:s.unaryMinus(t);for(var n=new s(t.length,r),i=0,o=0;o<e.length;o++){var a=t.__digit(o),u=e.__digit(o),c=(65535&a)-(65535&u)-i,f=(a>>>16)-(u>>>16)-(i=1&c>>>16);i=1&f>>>16,n.__setDigit(o,65535&c|f<<16)}for(;o<t.length;o++){var l=t.__digit(o),h=(65535&l)-i,d=(l>>>16)-(i=1&h>>>16);i=1&d>>>16,n.__setDigit(o,65535&h|d<<16)}return n.__trim()}},{key:"__absoluteAddOne",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length;null===r?r=new s(n,e):r.sign=e;for(var i,o=!0,a=0;a<n;a++){if(i=t.__digit(a),o){var u=-1===i;i=0|i+1,o=u}r.__setDigit(a,i)}return o&&r.__setDigitGrow(n,1),r}},{key:"__absoluteSubOne",value:function(t,e){for(var r,n=t.length,i=new s(e=e||n,!1),o=!0,a=0;a<n;a++){if(r=t.__digit(a),o){var u=0===r;r=0|r-1,o=u}i.__setDigit(a,r)}if(o)throw new Error("implementation bug");for(var c=n;c<e;c++)i.__setDigit(c,0);return i}},{key:"__absoluteAnd",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,o=i;if(n<i){o=n;var a=t,u=n;t=e,n=i,e=a,i=u}var c=o;null===r?r=new s(c,!1):c=r.length;for(var f=0;f<o;f++)r.__setDigit(f,t.__digit(f)&e.__digit(f));for(;f<c;f++)r.__setDigit(f,0);return r}},{key:"__absoluteAndNot",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,o=i;n<i&&(o=n);var a=n;null===r?r=new s(a,!1):a=r.length;for(var u=0;u<o;u++)r.__setDigit(u,t.__digit(u)&~e.__digit(u));for(;u<n;u++)r.__setDigit(u,t.__digit(u));for(;u<a;u++)r.__setDigit(u,0);return r}},{key:"__absoluteOr",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,o=i;if(n<i){o=n;var a=t,u=n;t=e,n=i,e=a,i=u}var c=n;null===r?r=new s(c,!1):c=r.length;for(var f=0;f<o;f++)r.__setDigit(f,t.__digit(f)|e.__digit(f));for(;f<n;f++)r.__setDigit(f,t.__digit(f));for(;f<c;f++)r.__setDigit(f,0);return r}},{key:"__absoluteXor",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=t.length,i=e.length,o=i;if(n<i){o=n;var a=t,u=n;t=e,n=i,e=a,i=u}var c=n;null===r?r=new s(c,!1):c=r.length;for(var f=0;f<o;f++)r.__setDigit(f,t.__digit(f)^e.__digit(f));for(;f<n;f++)r.__setDigit(f,t.__digit(f));for(;f<c;f++)r.__setDigit(f,0);return r}},{key:"__absoluteCompare",value:function(t,e){var r=t.length-e.length;if(0!=r)return r;for(var n=t.length-1;0<=n&&t.__digit(n)===e.__digit(n);)n--;return 0>n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}},{key:"__multiplyAccumulate",value:function(t,e,r,n){if(0!==e){for(var i=65535&e,o=e>>>16,a=0,u=0,c=0,f=0;f<t.length;f++,n++){var l=r.__digit(n),h=65535&l,d=l>>>16,p=t.__digit(f),m=65535&p,g=p>>>16,b=s.__imul(m,i),y=s.__imul(m,o),v=s.__imul(g,i),w=s.__imul(g,o);a=(u=(y>>>16)+(v>>>16)+(65535&w)+(a=(d+=c+a+((h+=u+(65535&b))>>>16)+(b>>>16)+(65535&y)+(65535&v))>>>16))>>>16,u&=65535,c=w>>>16,l=65535&h|d<<16,r.__setDigit(n,l)}for(;0!==a||0!==u||0!==c;n++){var _=r.__digit(n),A=(65535&_)+u,E=(_>>>16)+(A>>>16)+c+a;u=0,c=0,a=E>>>16,_=65535&A|E<<16,r.__setDigit(n,_)}}}},{key:"__internalMultiplyAdd",value:function(t,e,r,n,i){for(var o=r,a=0,u=0;u<n;u++){var c=t.__digit(u),f=s.__imul(65535&c,e),l=(65535&f)+a+o;o=l>>>16;var h=s.__imul(c>>>16,e),d=(65535&h)+(f>>>16)+o;o=d>>>16,a=h>>>16,i.__setDigit(u,d<<16|65535&l)}if(i.length>n)for(i.__setDigit(n++,o+a);n<i.length;)i.__setDigit(n++,0);else if(0!==o+a)throw new Error("implementation bug")}},{key:"__absoluteDivSmall",value:function(t,e,r){null===r&&(r=new s(t.length,!1));for(var n=0,i=2*t.length-1;0<=i;i-=2){var o=(n<<16|t.__halfDigit(i))>>>0,a=0|o/e,u=0|(o=((n=0|o%e)<<16|t.__halfDigit(i-1))>>>0)/e;n=0|o%e,r.__setDigit(i>>>1,a<<16|u)}return r}},{key:"__absoluteModSmall",value:function(t,e){for(var r=0,n=2*t.length-1;0<=n;n--)r=0|((r<<16|t.__halfDigit(n))>>>0)%e;return r}},{key:"__absoluteDivLarge",value:function(t,e,r,n){var i=e.__halfDigitLength(),o=e.length,a=t.__halfDigitLength()-i,u=null;r&&(u=new s(a+2>>>1,!1)).__initializeDigits();var c=new s(i+2>>>1,!1);c.__initializeDigits();var f=s.__clz16(e.__halfDigit(i-1));0<f&&(e=s.__specialLeftShift(e,f,0));for(var l=s.__specialLeftShift(t,f,1),h=e.__halfDigit(i-1),d=0,p=a;0<=p;p--){var m=65535,g=l.__halfDigit(p+i);if(g!==h){var b=(g<<16|l.__halfDigit(p+i-1))>>>0;m=0|b/h;for(var y=0|b%h,v=e.__halfDigit(i-2),w=l.__halfDigit(p+i-2);s.__imul(m,v)>>>0>(y<<16|w)>>>0&&(m--,!(65535<(y+=h))););}s.__internalMultiplyAdd(e,m,0,o,c);var _=l.__inplaceSub(c,p,i+1);0!==_&&(_=l.__inplaceAdd(e,p,i),l.__setHalfDigit(p+i,l.__halfDigit(p+i)+_),m--),r&&(1&p?d=m<<16:u.__setDigit(p>>>1,d|m))}return n?(l.__inplaceRightShift(f),r?{quotient:u,remainder:l}:l):r?u:void 0}},{key:"__clz16",value:function(t){return s.__clz32(t)-16}},{key:"__specialLeftShift",value:function(t,e,r){var n=t.length,i=new s(n+r,!1);if(0===e){for(var o=0;o<n;o++)i.__setDigit(o,t.__digit(o));return 0<r&&i.__setDigit(n,0),i}for(var a,u=0,c=0;c<n;c++)a=t.__digit(c),i.__setDigit(c,a<<e|u),u=a>>>32-e;return 0<r&&i.__setDigit(n,u),i}},{key:"__leftShiftByAbsolute",value:function(t,e){var r=s.__toShiftAmount(e);if(0>r)throw new RangeError("BigInt too big");var n=r>>>5,i=31&r,o=t.length,a=0!==i&&0!=t.__digit(o-1)>>>32-i,u=o+n+(a?1:0),c=new s(u,t.sign);if(0===i){for(var f=0;f<n;f++)c.__setDigit(f,0);for(;f<u;f++)c.__setDigit(f,t.__digit(f-n))}else{for(var l=0,h=0;h<n;h++)c.__setDigit(h,0);for(var d,p=0;p<o;p++)d=t.__digit(p),c.__setDigit(p+n,d<<i|l),l=d>>>32-i;if(a)c.__setDigit(o+n,l);else if(0!==l)throw new Error("implementation bug")}return c.__trim()}},{key:"__rightShiftByAbsolute",value:function(t,e){var r=t.length,n=t.sign,i=s.__toShiftAmount(e);if(0>i)return s.__rightShiftByMaximum(n);var o=i>>>5,a=31&i,u=r-o;if(0>=u)return s.__rightShiftByMaximum(n);var c=!1;if(n)if(0!=(t.__digit(o)&(1<<a)-1))c=!0;else for(var f=0;f<o;f++)if(0!==t.__digit(f)){c=!0;break}c&&0===a&&0==~t.__digit(r-1)&&u++;var l=new s(u,n);if(0===a)for(var h=o;h<r;h++)l.__setDigit(h-o,t.__digit(h));else{for(var d,p=t.__digit(o)>>>a,m=r-o-1,g=0;g<m;g++)d=t.__digit(g+o+1),l.__setDigit(g,d<<32-a|p),p=d>>>a;l.__setDigit(m,p)}return c&&(l=s.__absoluteAddOne(l,!0,l)),l.__trim()}},{key:"__rightShiftByMaximum",value:function(t){return t?s.__oneDigit(1,!0):s.__zero()}},{key:"__toShiftAmount",value:function(t){if(1<t.length)return-1;var e=t.__unsignedDigit(0);return e>s.__kMaxLengthBits?-1:e}},{key:"__toPrimitive",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"default";if("object"!==r(t))return t;if(t.constructor===s)return t;var n=t[Symbol.toPrimitive];if(n){var i=n(e);if("object"!==r(i))return i;throw new TypeError("Cannot convert object to primitive value")}var o=t.valueOf;if(o){var a=o.call(t);if("object"!==r(a))return a}var u=t.toString;if(u){var c=u.call(t);if("object"!==r(c))return c}throw new TypeError("Cannot convert object to primitive value")}},{key:"__toNumeric",value:function(t){return s.__isBigInt(t)?t:+t}},{key:"__isBigInt",value:function(t){return"object"===r(t)&&t.constructor===s}},{key:"__truncateToNBits",value:function(t,e){for(var r=t+31>>>5,n=new s(r,e.sign),i=r-1,o=0;o<i;o++)n.__setDigit(o,e.__digit(o));var a=e.__digit(i);if(0!=(31&t)){var u=32-(31&t);a=a<<u>>>u}return n.__setDigit(i,a),n.__trim()}},{key:"__truncateAndSubFromPowerOfTwo",value:function(t,e,r){for(var n=Math.min,i=t+31>>>5,o=new s(i,r),a=0,u=i-1,c=0,f=n(u,e.length);a<f;a++){var l=e.__digit(a),h=0-(65535&l)-c,d=0-(l>>>16)-(c=1&h>>>16);c=1&d>>>16,o.__setDigit(a,65535&h|d<<16)}for(;a<u;a++)o.__setDigit(a,0|-c);var p,m=u<e.length?e.__digit(u):0,g=31&t;if(0===g){var b=0-(65535&m)-c;p=65535&b|0-(m>>>16)-(c=1&b>>>16)<<16}else{var y=32-g,v=1<<32-y,w=(65535&v)-(65535&(m=m<<y>>>y))-c;p=65535&w|(v>>>16)-(m>>>16)-(c=1&w>>>16)<<16,p&=v-1}return o.__setDigit(u,p),o.__trim()}},{key:"__digitPow",value:function(t,e){for(var r=1;0<e;)1&e&&(r*=t),e>>>=1,t*=t;return r}}]),s}(f(Array));return p.__kMaxLength=33554432,p.__kMaxLengthBits=p.__kMaxLength<<5,p.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],p.__kBitsPerCharTableShift=5,p.__kBitsPerCharTableMultiplier=1<<p.__kBitsPerCharTableShift,p.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],p.__kBitConversionBuffer=new ArrayBuffer(8),p.__kBitConversionDouble=new Float64Array(p.__kBitConversionBuffer),p.__kBitConversionInts=new Int32Array(p.__kBitConversionBuffer),p.__clz32=e||function(t){var e=Math.LN2,r=Math.log;return 0===t?32:0|31-(0|r(t>>>0)/e)},p.__imul=t||function(t,e){return 0|t*e},p}))},{}],143:[function(t,e,r){"use strict";e.exports=t("./lib/api")(t("./lib/keccak"))},{"./lib/api":144,"./lib/keccak":148}],144:[function(t,e,r){"use strict";const n=t("./keccak"),i=t("./shake");e.exports=function(t){const e=n(t),r=i(t);return function(t,n){switch("string"==typeof t?t.toLowerCase():t){case"keccak224":return new e(1152,448,null,224,n);case"keccak256":return new e(1088,512,null,256,n);case"keccak384":return new e(832,768,null,384,n);case"keccak512":return new e(576,1024,null,512,n);case"sha3-224":return new e(1152,448,6,224,n);case"sha3-256":return new e(1088,512,6,256,n);case"sha3-384":return new e(832,768,6,384,n);case"sha3-512":return new e(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+t)}}}},{"./keccak":145,"./shake":146}],145:[function(t,e,r){"use strict";const n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("inherits");e.exports=function(t){function e(e,r,n,o,s){i.call(this,s),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=o,this._options=s,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return o(e,i),e.prototype._transform=function(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(t){let e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},e.prototype.update=function(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},e.prototype.digest=function(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},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){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},e}},{inherits:139,"safe-buffer":192,stream:209}],146:[function(t,e,r){"use strict";const n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("inherits");e.exports=function(t){function e(e,r,n,o){i.call(this,o),this._rate=e,this._capacity=r,this._delimitedSuffix=n,this._options=o,this._state=new t,this._state.initialize(e,r),this._finalized=!1}return o(e,i),e.prototype._transform=function(t,e,r){let n=null;try{this.update(t,e)}catch(t){n=t}r(n)},e.prototype._flush=function(){},e.prototype._read=function(t){this.push(this.squeeze(t))},e.prototype.update=function(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},e.prototype.squeeze=function(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},e.prototype._resetState=function(){return this._state.initialize(this._rate,this._capacity),this},e.prototype._clone=function(){const t=new e(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(t._state),t._finalized=this._finalized,t},e}},{inherits:139,"safe-buffer":192,stream:209}],147:[function(t,e,r){"use strict";const n=[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];r.p1600=function(t){for(let e=0;e<24;++e){const r=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],f=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],h=t[9]^t[19]^t[29]^t[39]^t[49];let d=l^(o<<1|s>>>31),p=h^(s<<1|o>>>31);const m=t[0]^d,g=t[1]^p,b=t[10]^d,y=t[11]^p,v=t[20]^d,w=t[21]^p,_=t[30]^d,A=t[31]^p,E=t[40]^d,S=t[41]^p;d=r^(a<<1|u>>>31),p=i^(u<<1|a>>>31);const M=t[2]^d,x=t[3]^p,k=t[12]^d,T=t[13]^p,I=t[22]^d,C=t[23]^p,R=t[32]^d,B=t[33]^p,N=t[42]^d,O=t[43]^p;d=o^(c<<1|f>>>31),p=s^(f<<1|c>>>31);const P=t[4]^d,D=t[5]^p,L=t[14]^d,U=t[15]^p,j=t[24]^d,F=t[25]^p,q=t[34]^d,z=t[35]^p,H=t[44]^d,K=t[45]^p;d=a^(l<<1|h>>>31),p=u^(h<<1|l>>>31);const G=t[6]^d,W=t[7]^p,V=t[16]^d,$=t[17]^p,X=t[26]^d,Y=t[27]^p,J=t[36]^d,Z=t[37]^p,Q=t[46]^d,tt=t[47]^p;d=c^(r<<1|i>>>31),p=f^(i<<1|r>>>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,ft=t[49]^p,lt=m,ht=g,dt=y<<4|b>>>28,pt=b<<4|y>>>28,mt=v<<3|w>>>29,gt=w<<3|v>>>29,bt=A<<9|_>>>23,yt=_<<9|A>>>23,vt=E<<18|S>>>14,wt=S<<18|E>>>14,_t=M<<1|x>>>31,At=x<<1|M>>>31,Et=T<<12|k>>>20,St=k<<12|T>>>20,Mt=I<<10|C>>>22,xt=C<<10|I>>>22,kt=B<<13|R>>>19,Tt=R<<13|B>>>19,It=N<<2|O>>>30,Ct=O<<2|N>>>30,Rt=D<<30|P>>>2,Bt=P<<30|D>>>2,Nt=L<<6|U>>>26,Ot=U<<6|L>>>26,Pt=F<<11|j>>>21,Dt=j<<11|F>>>21,Lt=q<<15|z>>>17,Ut=z<<15|q>>>17,jt=K<<29|H>>>3,Ft=H<<29|K>>>3,qt=G<<28|W>>>4,zt=W<<28|G>>>4,Ht=$<<23|V>>>9,Kt=V<<23|$>>>9,Gt=X<<25|Y>>>7,Wt=Y<<25|X>>>7,Vt=J<<21|Z>>>11,$t=Z<<21|J>>>11,Xt=tt<<24|Q>>>8,Yt=Q<<24|tt>>>8,Jt=et<<27|rt>>>5,Zt=rt<<27|et>>>5,Qt=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|ft>>>18,se=ft<<14|ct>>>18;t[0]=lt^~Et&Pt,t[1]=ht^~St&Dt,t[10]=qt^~Qt&mt,t[11]=zt^~te&gt,t[20]=_t^~Nt&Gt,t[21]=At^~Ot&Wt,t[30]=Jt^~dt&Mt,t[31]=Zt^~pt&xt,t[40]=Rt^~Ht&ee,t[41]=Bt^~Kt&re,t[2]=Et^~Pt&Vt,t[3]=St^~Dt&$t,t[12]=Qt^~mt&kt,t[13]=te^~gt&Tt,t[22]=Nt^~Gt&ne,t[23]=Ot^~Wt&ie,t[32]=dt^~Mt&Lt,t[33]=pt^~xt&Ut,t[42]=Ht^~ee&bt,t[43]=Kt^~re&yt,t[4]=Pt^~Vt&oe,t[5]=Dt^~$t&se,t[14]=mt^~kt&jt,t[15]=gt^~Tt&Ft,t[24]=Gt^~ne&vt,t[25]=Wt^~ie&wt,t[34]=Mt^~Lt&Xt,t[35]=xt^~Ut&Yt,t[44]=ee^~bt&It,t[45]=re^~yt&Ct,t[6]=Vt^~oe&lt,t[7]=$t^~se&ht,t[16]=kt^~jt&qt,t[17]=Tt^~Ft&zt,t[26]=ne^~vt&_t,t[27]=ie^~wt&At,t[36]=Lt^~Xt&Jt,t[37]=Ut^~Yt&Zt,t[46]=bt^~It&Rt,t[47]=yt^~Ct&Bt,t[8]=oe^~lt&Et,t[9]=se^~ht&St,t[18]=jt^~qt&Qt,t[19]=Ft^~zt&te,t[28]=vt^~_t&Nt,t[29]=wt^~At&Ot,t[38]=Xt^~Jt&dt,t[39]=Yt^~Zt&pt,t[48]=It^~Rt&Ht,t[49]=Ct^~Bt&Kt,t[0]^=n[2*e],t[1]^=n[2*e+1]}}},{}],148:[function(t,e,r){"use strict";const n=t("safe-buffer").Buffer,i=t("./keccak-state-unroll");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 t=0;t<50;++t)this.state[t]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1},o.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<this.count%4*8,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0)},o.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<this.count%4*8,0!=(128&t)&&this.count===this.blockSize-1&&i.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<(this.blockSize-1)%4*8,i.p1600(this.state),this.count=0,this.squeezing=!0},o.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=n.alloc(t);for(var r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>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},e.exports=o},{"./keccak-state-unroll":147,"safe-buffer":192}],149:[function(t,e,n){(function(t){(function(){(function(){var r="Expected a function",i="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s="[object Arguments]",a="[object Array]",u="[object Boolean]",c="[object Date]",f="[object Error]",l="[object Function]",h="[object GeneratorFunction]",d="[object Map]",p="[object Number]",m="[object Object]",g="[object RegExp]",b="[object Set]",y="[object String]",v="[object Symbol]",w="[object WeakMap]",_="[object ArrayBuffer]",A="[object DataView]",E="[object Float32Array]",S="[object Float64Array]",M="[object Int8Array]",x="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",I="[object Uint16Array]",C="[object Uint32Array]",R=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,O=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,D=RegExp(O.source),L=RegExp(P.source),U=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,F=/<%=([\s\S]+?)%>/g,q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,G=RegExp(K.source),W=/^\s+|\s+$/g,V=/^\s+/,$=/\s+$/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Y=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Q=/\\(\\)?/g,tt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,et=/\w*$/,rt=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,it=/^\[object .+?Constructor\]$/,ot=/^0o[0-7]+$/i,st=/^(?:0|[1-9]\d*)$/,at=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ut=/($^)/,ct=/['\n\r\u2028\u2029\\]/g,ft="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",lt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ht="["+lt+"]",dt="["+ft+"]",pt="\\d+",mt="[a-z\\xdf-\\xf6\\xf8-\\xff]",gt="[^\\ud800-\\udfff"+lt+pt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",bt="\\ud83c[\\udffb-\\udfff]",yt="[^\\ud800-\\udfff]",vt="(?:\\ud83c[\\udde6-\\uddff]){2}",wt="[\\ud800-\\udbff][\\udc00-\\udfff]",_t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",At="(?:"+mt+"|"+gt+")",Et="(?:"+_t+"|"+gt+")",St="(?:"+dt+"|"+bt+")?",Mt="[\\ufe0e\\ufe0f]?"+St+"(?:\\u200d(?:"+[yt,vt,wt].join("|")+")[\\ufe0e\\ufe0f]?"+St+")*",xt="(?:"+["[\\u2700-\\u27bf]",vt,wt].join("|")+")"+Mt,kt="(?:"+[yt+dt+"?",dt,vt,wt,"[\\ud800-\\udfff]"].join("|")+")",Tt=RegExp("['’]","g"),It=RegExp(dt,"g"),Ct=RegExp(bt+"(?="+bt+")|"+kt+Mt,"g"),Rt=RegExp([_t+"?"+mt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ht,_t,"$"].join("|")+")",Et+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ht,_t+At,"$"].join("|")+")",_t+"?"+At+"+(?:['’](?:d|ll|m|re|s|t|ve))?",_t+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pt,xt].join("|"),"g"),Bt=RegExp("[\\u200d\\ud800-\\udfff"+ft+"\\ufe0e\\ufe0f]"),Nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Pt=-1,Dt={};Dt[E]=Dt[S]=Dt[M]=Dt[x]=Dt[k]=Dt[T]=Dt["[object Uint8ClampedArray]"]=Dt[I]=Dt[C]=!0,Dt[s]=Dt[a]=Dt[_]=Dt[u]=Dt[A]=Dt[c]=Dt[f]=Dt[l]=Dt[d]=Dt[p]=Dt[m]=Dt[g]=Dt[b]=Dt[y]=Dt[w]=!1;var Lt={};Lt[s]=Lt[a]=Lt[_]=Lt[A]=Lt[u]=Lt[c]=Lt[E]=Lt[S]=Lt[M]=Lt[x]=Lt[k]=Lt[d]=Lt[p]=Lt[m]=Lt[g]=Lt[b]=Lt[y]=Lt[v]=Lt[T]=Lt["[object Uint8ClampedArray]"]=Lt[I]=Lt[C]=!0,Lt[f]=Lt[l]=Lt[w]=!1;var Ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jt=parseFloat,Ft=parseInt,qt="object"==typeof t&&t&&t.Object===Object&&t,zt="object"==typeof self&&self&&self.Object===Object&&self,Ht=qt||zt||Function("return this")(),Kt="object"==typeof n&&n&&!n.nodeType&&n,Gt=Kt&&"object"==typeof e&&e&&!e.nodeType&&e,Wt=Gt&&Gt.exports===Kt,Vt=Wt&&qt.process,$t=function(){try{return Gt&&Gt.require&&Gt.require("util").types||Vt&&Vt.binding&&Vt.binding("util")}catch(t){}}(),Xt=$t&&$t.isArrayBuffer,Yt=$t&&$t.isDate,Jt=$t&&$t.isMap,Zt=$t&&$t.isRegExp,Qt=$t&&$t.isSet,te=$t&&$t.isTypedArray;function ee(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function re(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}function ne(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}function ie(t,e){for(var r=null==t?0:t.length;r--&&!1!==e(t[r],r,t););return t}function oe(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function se(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}function ae(t,e){return!(null==t||!t.length)&&be(t,e,0)>-1}function ue(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function ce(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function fe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function le(t,e,r,n){var i=-1,o=null==t?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}function he(t,e,r,n){var i=null==t?0:t.length;for(n&&i&&(r=t[--i]);i--;)r=e(r,t[i],i,t);return r}function de(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var pe=_e("length");function me(t,e,r){var n;return r(t,(function(t,r,i){if(e(t,r,i))return n=r,!1})),n}function ge(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function be(t,e,r){return e==e?function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}(t,e,r):ge(t,ve,r)}function ye(t,e,r,n){for(var i=r-1,o=t.length;++i<o;)if(n(t[i],e))return i;return-1}function ve(t){return t!=t}function we(t,e){var r=null==t?0:t.length;return r?Se(t,e)/r:NaN}function _e(t){return function(e){return null==e?void 0:e[t]}}function Ae(t){return function(e){return null==t?void 0:t[e]}}function Ee(t,e,r,n,i){return i(t,(function(t,i,o){r=n?(n=!1,t):e(r,t,i,o)})),r}function Se(t,e){for(var r,n=-1,i=t.length;++n<i;){var o=e(t[n]);void 0!==o&&(r=void 0===r?o:r+o)}return r}function Me(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function xe(t){return function(e){return t(e)}}function ke(t,e){return ce(e,(function(e){return t[e]}))}function Te(t,e){return t.has(e)}function Ie(t,e){for(var r=-1,n=t.length;++r<n&&be(e,t[r],0)>-1;);return r}function Ce(t,e){for(var r=t.length;r--&&be(e,t[r],0)>-1;);return r}function Re(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}var Be=Ae({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"}),Ne=Ae({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Oe(t){return"\\"+Ut[t]}function Pe(t){return Bt.test(t)}function De(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Le(t,e){return function(r){return t(e(r))}}function Ue(t,e){for(var r=-1,n=t.length,o=0,s=[];++r<n;){var a=t[r];a!==e&&a!==i||(t[r]=i,s[o++]=r)}return s}function je(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}function Fe(t){return Pe(t)?function(t){for(var e=Ct.lastIndex=0;Ct.test(t);)++e;return e}(t):pe(t)}function qe(t){return Pe(t)?function(t){return t.match(Ct)||[]}(t):function(t){return t.split("")}(t)}var ze=Ae({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),He=function t(e){var n,ft=(e=null==e?Ht:He.defaults(Ht.Object(),e,He.pick(Ht,Ot))).Array,lt=e.Date,ht=e.Error,dt=e.Function,pt=e.Math,mt=e.Object,gt=e.RegExp,bt=e.String,yt=e.TypeError,vt=ft.prototype,wt=dt.prototype,_t=mt.prototype,At=e["__core-js_shared__"],Et=wt.toString,St=_t.hasOwnProperty,Mt=0,xt=(n=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",kt=_t.toString,Ct=Et.call(mt),Bt=Ht._,Ut=gt("^"+Et.call(St).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=Wt?e.Buffer:void 0,zt=e.Symbol,Kt=e.Uint8Array,Gt=qt?qt.allocUnsafe:void 0,Vt=Le(mt.getPrototypeOf,mt),$t=mt.create,pe=_t.propertyIsEnumerable,Ae=vt.splice,Ke=zt?zt.isConcatSpreadable:void 0,Ge=zt?zt.iterator:void 0,We=zt?zt.toStringTag:void 0,Ve=function(){try{var t=Ji(mt,"defineProperty");return t({},"",{}),t}catch(t){}}(),$e=e.clearTimeout!==Ht.clearTimeout&&e.clearTimeout,Xe=lt&&lt.now!==Ht.Date.now&&lt.now,Ye=e.setTimeout!==Ht.setTimeout&&e.setTimeout,Je=pt.ceil,Ze=pt.floor,Qe=mt.getOwnPropertySymbols,tr=qt?qt.isBuffer:void 0,er=e.isFinite,rr=vt.join,nr=Le(mt.keys,mt),ir=pt.max,or=pt.min,sr=lt.now,ar=e.parseInt,ur=pt.random,cr=vt.reverse,fr=Ji(e,"DataView"),lr=Ji(e,"Map"),hr=Ji(e,"Promise"),dr=Ji(e,"Set"),pr=Ji(e,"WeakMap"),mr=Ji(mt,"create"),gr=pr&&new pr,br={},yr=Mo(fr),vr=Mo(lr),wr=Mo(hr),_r=Mo(dr),Ar=Mo(pr),Er=zt?zt.prototype:void 0,Sr=Er?Er.valueOf:void 0,Mr=Er?Er.toString:void 0;function xr(t){if(zs(t)&&!Rs(t)&&!(t instanceof Cr)){if(t instanceof Ir)return t;if(St.call(t,"__wrapped__"))return xo(t)}return new Ir(t)}var kr=function(){function t(){}return function(e){if(!qs(e))return{};if($t)return $t(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function Tr(){}function Ir(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Cr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Rr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Br(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Nr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Or(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Nr;++e<r;)this.add(t[e])}function Pr(t){var e=this.__data__=new Br(t);this.size=e.size}function Dr(t,e){var r=Rs(t),n=!r&&Cs(t),i=!r&&!n&&Ps(t),o=!r&&!n&&!i&&Ys(t),s=r||n||i||o,a=s?Me(t.length,bt):[],u=a.length;for(var c in t)!e&&!St.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||io(c,u))||a.push(c);return a}function Lr(t){var e=t.length;return e?t[On(0,e-1)]:void 0}function Ur(t,e){return Ao(mi(t),Vr(e,0,t.length))}function jr(t){return Ao(mi(t))}function Fr(t,e,r){(void 0!==r&&!ks(t[e],r)||void 0===r&&!(e in t))&&Gr(t,e,r)}function qr(t,e,r){var n=t[e];St.call(t,e)&&ks(n,r)&&(void 0!==r||e in t)||Gr(t,e,r)}function zr(t,e){for(var r=t.length;r--;)if(ks(t[r][0],e))return r;return-1}function Hr(t,e,r,n){return Zr(t,(function(t,i,o){e(n,t,r(t),o)})),n}function Kr(t,e){return t&&gi(e,ya(e),t)}function Gr(t,e,r){"__proto__"==e&&Ve?Ve(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Wr(t,e){for(var r=-1,n=e.length,i=ft(n),o=null==t;++r<n;)i[r]=o?void 0:da(t,e[r]);return i}function Vr(t,e,r){return t==t&&(void 0!==r&&(t=t<=r?t:r),void 0!==e&&(t=t>=e?t:e)),t}function $r(t,e,r,n,i,o){var a,f=1&e,w=2&e,R=4&e;if(r&&(a=i?r(t,n,i,o):r(t)),void 0!==a)return a;if(!qs(t))return t;var B=Rs(t);if(B){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&St.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!f)return mi(t,a)}else{var N=to(t),O=N==l||N==h;if(Ps(t))return ci(t,f);if(N==m||N==s||O&&!i){if(a=w||O?{}:ro(t),!f)return w?function(t,e){return gi(t,Qi(t),e)}(t,function(t,e){return t&&gi(e,va(e),t)}(a,t)):function(t,e){return gi(t,Zi(t),e)}(t,Kr(a,t))}else{if(!Lt[N])return i?t:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case _:return fi(t);case u:case c:return new i(+t);case A:return function(t,e){var r=e?fi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case E:case S:case M:case x:case k:case T:case"[object Uint8ClampedArray]":case I:case C:return li(t,r);case d:return new i;case p:case y:return new i(t);case g:return function(t){var e=new t.constructor(t.source,et.exec(t));return e.lastIndex=t.lastIndex,e}(t);case b:return new i;case v:return n=t,Sr?mt(Sr.call(n)):{}}}(t,N,f)}}o||(o=new Pr);var P=o.get(t);if(P)return P;o.set(t,a),Vs(t)?t.forEach((function(n){a.add($r(n,e,r,n,t,o))})):Hs(t)&&t.forEach((function(n,i){a.set(i,$r(n,e,r,i,t,o))}));var D=B?void 0:(R?w?Ki:Hi:w?va:ya)(t);return ne(D||t,(function(n,i){D&&(n=t[i=n]),qr(a,i,$r(n,e,r,i,t,o))})),a}function Xr(t,e,r){var n=r.length;if(null==t)return!n;for(t=mt(t);n--;){var i=r[n],o=e[i],s=t[i];if(void 0===s&&!(i in t)||!o(s))return!1}return!0}function Yr(t,e,n){if("function"!=typeof t)throw new yt(r);return yo((function(){t.apply(void 0,n)}),e)}function Jr(t,e,r,n){var i=-1,o=ae,s=!0,a=t.length,u=[],c=e.length;if(!a)return u;r&&(e=ce(e,xe(r))),n?(o=ue,s=!1):e.length>=200&&(o=Te,s=!1,e=new Or(e));t:for(;++i<a;){var f=t[i],l=null==r?f:r(f);if(f=n||0!==f?f:0,s&&l==l){for(var h=c;h--;)if(e[h]===l)continue t;u.push(f)}else o(e,l,n)||u.push(f)}return u}xr.templateSettings={escape:U,evaluate:j,interpolate:F,variable:"",imports:{_:xr}},xr.prototype=Tr.prototype,xr.prototype.constructor=xr,Ir.prototype=kr(Tr.prototype),Ir.prototype.constructor=Ir,Cr.prototype=kr(Tr.prototype),Cr.prototype.constructor=Cr,Rr.prototype.clear=function(){this.__data__=mr?mr(null):{},this.size=0},Rr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Rr.prototype.get=function(t){var e=this.__data__;if(mr){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return St.call(e,t)?e[t]:void 0},Rr.prototype.has=function(t){var e=this.__data__;return mr?void 0!==e[t]:St.call(e,t)},Rr.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=mr&&void 0===e?"__lodash_hash_undefined__":e,this},Br.prototype.clear=function(){this.__data__=[],this.size=0},Br.prototype.delete=function(t){var e=this.__data__,r=zr(e,t);return!(r<0||(r==e.length-1?e.pop():Ae.call(e,r,1),--this.size,0))},Br.prototype.get=function(t){var e=this.__data__,r=zr(e,t);return r<0?void 0:e[r][1]},Br.prototype.has=function(t){return zr(this.__data__,t)>-1},Br.prototype.set=function(t,e){var r=this.__data__,n=zr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Nr.prototype.clear=function(){this.size=0,this.__data__={hash:new Rr,map:new(lr||Br),string:new Rr}},Nr.prototype.delete=function(t){var e=Xi(this,t).delete(t);return this.size-=e?1:0,e},Nr.prototype.get=function(t){return Xi(this,t).get(t)},Nr.prototype.has=function(t){return Xi(this,t).has(t)},Nr.prototype.set=function(t,e){var r=Xi(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Or.prototype.add=Or.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Or.prototype.has=function(t){return this.__data__.has(t)},Pr.prototype.clear=function(){this.__data__=new Br,this.size=0},Pr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Pr.prototype.get=function(t){return this.__data__.get(t)},Pr.prototype.has=function(t){return this.__data__.has(t)},Pr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Br){var n=r.__data__;if(!lr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Nr(n)}return r.set(t,e),this.size=r.size,this};var Zr=vi(an),Qr=vi(un,!0);function tn(t,e){var r=!0;return Zr(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function en(t,e,r){for(var n=-1,i=t.length;++n<i;){var o=t[n],s=e(o);if(null!=s&&(void 0===a?s==s&&!Xs(s):r(s,a)))var a=s,u=o}return u}function rn(t,e){var r=[];return Zr(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function nn(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=no),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?nn(a,e-1,r,n,i):fe(i,a):n||(i[i.length]=a)}return i}var on=wi(),sn=wi(!0);function an(t,e){return t&&on(t,e,ya)}function un(t,e){return t&&sn(t,e,ya)}function cn(t,e){return se(e,(function(e){return Us(t[e])}))}function fn(t,e){for(var r=0,n=(e=oi(e,t)).length;null!=t&&r<n;)t=t[So(e[r++])];return r&&r==n?t:void 0}function ln(t,e,r){var n=e(t);return Rs(t)?n:fe(n,r(t))}function hn(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":We&&We in mt(t)?function(t){var e=St.call(t,We),r=t[We];try{t[We]=void 0;var n=!0}catch(t){}var i=kt.call(t);return n&&(e?t[We]=r:delete t[We]),i}(t):function(t){return kt.call(t)}(t)}function dn(t,e){return t>e}function pn(t,e){return null!=t&&St.call(t,e)}function mn(t,e){return null!=t&&e in mt(t)}function gn(t,e,r){for(var n=r?ue:ae,i=t[0].length,o=t.length,s=o,a=ft(o),u=1/0,c=[];s--;){var f=t[s];s&&e&&(f=ce(f,xe(e))),u=or(f.length,u),a[s]=!r&&(e||i>=120&&f.length>=120)?new Or(s&&f):void 0}f=t[0];var l=-1,h=a[0];t:for(;++l<i&&c.length<u;){var d=f[l],p=e?e(d):d;if(d=r||0!==d?d:0,!(h?Te(h,p):n(c,p,r))){for(s=o;--s;){var m=a[s];if(!(m?Te(m,p):n(t[s],p,r)))continue t}h&&h.push(p),c.push(d)}}return c}function bn(t,e,r){var n=null==(t=po(t,e=oi(e,t)))?t:t[So(Lo(e))];return null==n?void 0:ee(n,t,r)}function yn(t){return zs(t)&&hn(t)==s}function vn(t,e,r,n,i){return t===e||(null==t||null==e||!zs(t)&&!zs(e)?t!=t&&e!=e:function(t,e,r,n,i,o){var l=Rs(t),h=Rs(e),w=l?a:to(t),E=h?a:to(e),S=(w=w==s?m:w)==m,M=(E=E==s?m:E)==m,x=w==E;if(x&&Ps(t)){if(!Ps(e))return!1;l=!0,S=!1}if(x&&!S)return o||(o=new Pr),l||Ys(t)?qi(t,e,r,n,i,o):function(t,e,r,n,i,o,s){switch(r){case A:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case _:return!(t.byteLength!=e.byteLength||!o(new Kt(t),new Kt(e)));case u:case c:case p:return ks(+t,+e);case f:return t.name==e.name&&t.message==e.message;case g:case y:return t==e+"";case d:var a=De;case b:var l=1&n;if(a||(a=je),t.size!=e.size&&!l)return!1;var h=s.get(t);if(h)return h==e;n|=2,s.set(t,e);var m=qi(a(t),a(e),n,i,o,s);return s.delete(t),m;case v:if(Sr)return Sr.call(t)==Sr.call(e)}return!1}(t,e,w,r,n,i,o);if(!(1&r)){var k=S&&St.call(t,"__wrapped__"),T=M&&St.call(e,"__wrapped__");if(k||T){var I=k?t.value():t,C=T?e.value():e;return o||(o=new Pr),i(I,C,r,n,o)}}return!!x&&(o||(o=new Pr),function(t,e,r,n,i,o){var s=1&r,a=Hi(t),u=a.length;if(u!=Hi(e).length&&!s)return!1;for(var c=u;c--;){var f=a[c];if(!(s?f in e:St.call(e,f)))return!1}var l=o.get(t),h=o.get(e);if(l&&h)return l==e&&h==t;var d=!0;o.set(t,e),o.set(e,t);for(var p=s;++c<u;){var m=t[f=a[c]],g=e[f];if(n)var b=s?n(g,m,f,e,t,o):n(m,g,f,t,e,o);if(!(void 0===b?m===g||i(m,g,r,n,o):b)){d=!1;break}p||(p="constructor"==f)}if(d&&!p){var y=t.constructor,v=e.constructor;y==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof v&&v instanceof v||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,r,n,i,o))}(t,e,r,n,vn,i))}function wn(t,e,r,n){var i=r.length,o=i,s=!n;if(null==t)return!o;for(t=mt(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var u=(a=r[i])[0],c=t[u],f=a[1];if(s&&a[2]){if(void 0===c&&!(u in t))return!1}else{var l=new Pr;if(n)var h=n(c,f,u,t,e,l);if(!(void 0===h?vn(f,c,3,n,l):h))return!1}}return!0}function _n(t){return!(!qs(t)||(e=t,xt&&xt in e))&&(Us(t)?Ut:it).test(Mo(t));var e}function An(t){return"function"==typeof t?t:null==t?Ka:"object"==typeof t?Rs(t)?kn(t[0],t[1]):xn(t):Qa(t)}function En(t){if(!co(t))return nr(t);var e=[];for(var r in mt(t))St.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Sn(t,e){return t<e}function Mn(t,e){var r=-1,n=Ns(t)?ft(t.length):[];return Zr(t,(function(t,i,o){n[++r]=e(t,i,o)})),n}function xn(t){var e=Yi(t);return 1==e.length&&e[0][2]?lo(e[0][0],e[0][1]):function(r){return r===t||wn(r,t,e)}}function kn(t,e){return so(t)&&fo(e)?lo(So(t),e):function(r){var n=da(r,t);return void 0===n&&n===e?pa(r,t):vn(e,n,3)}}function Tn(t,e,r,n,i){t!==e&&on(e,(function(o,s){if(i||(i=new Pr),qs(o))!function(t,e,r,n,i,o,s){var a=go(t,r),u=go(e,r),c=s.get(u);if(c)Fr(t,r,c);else{var f=o?o(a,u,r+"",t,e,s):void 0,l=void 0===f;if(l){var h=Rs(u),d=!h&&Ps(u),p=!h&&!d&&Ys(u);f=u,h||d||p?Rs(a)?f=a:Os(a)?f=mi(a):d?(l=!1,f=ci(u,!0)):p?(l=!1,f=li(u,!0)):f=[]:Gs(u)||Cs(u)?(f=a,Cs(a)?f=ia(a):qs(a)&&!Us(a)||(f=ro(u))):l=!1}l&&(s.set(u,f),i(f,u,n,o,s),s.delete(u)),Fr(t,r,f)}}(t,e,s,r,Tn,n,i);else{var a=n?n(go(t,s),o,s+"",t,e,i):void 0;void 0===a&&(a=o),Fr(t,s,a)}}),va)}function In(t,e){var r=t.length;if(r)return io(e+=e<0?r:0,r)?t[e]:void 0}function Cn(t,e,r){e=e.length?ce(e,(function(t){return Rs(t)?function(e){return fn(e,1===t.length?t[0]:t)}:t})):[Ka];var n=-1;return e=ce(e,xe($i())),function(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}(Mn(t,(function(t,r,i){return{criteria:ce(e,(function(e){return e(t)})),index:++n,value:t}})),(function(t,e){return function(t,e,r){for(var n=-1,i=t.criteria,o=e.criteria,s=i.length,a=r.length;++n<s;){var u=hi(i[n],o[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Rn(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=fn(t,s);r(a,s)&&jn(o,oi(s,t),a)}return o}function Bn(t,e,r,n){var i=n?ye:be,o=-1,s=e.length,a=t;for(t===e&&(e=mi(e)),r&&(a=ce(t,xe(r)));++o<s;)for(var u=0,c=e[o],f=r?r(c):c;(u=i(a,f,u,n))>-1;)a!==t&&Ae.call(a,u,1),Ae.call(t,u,1);return t}function Nn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;io(i)?Ae.call(t,i,1):Jn(t,i)}}return t}function On(t,e){return t+Ze(ur()*(e-t+1))}function Pn(t,e){var r="";if(!t||e<1||e>9007199254740991)return r;do{e%2&&(r+=t),(e=Ze(e/2))&&(t+=t)}while(e);return r}function Dn(t,e){return vo(ho(t,e,Ka),t+"")}function Ln(t){return Lr(ka(t))}function Un(t,e){var r=ka(t);return Ao(r,Vr(e,0,r.length))}function jn(t,e,r,n){if(!qs(t))return t;for(var i=-1,o=(e=oi(e,t)).length,s=o-1,a=t;null!=a&&++i<o;){var u=So(e[i]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=s){var f=a[u];void 0===(c=n?n(f,u,a):void 0)&&(c=qs(f)?f:io(e[i+1])?[]:{})}qr(a,u,c),a=a[u]}return t}var Fn=gr?function(t,e){return gr.set(t,e),t}:Ka,qn=Ve?function(t,e){return Ve(t,"toString",{configurable:!0,enumerable:!1,value:qa(e),writable:!0})}:Ka;function zn(t){return Ao(ka(t))}function Hn(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=ft(i);++n<i;)o[n]=t[n+e];return o}function Kn(t,e){var r;return Zr(t,(function(t,n,i){return!(r=e(t,n,i))})),!!r}function Gn(t,e,r){var n=0,i=null==t?n:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;n<i;){var o=n+i>>>1,s=t[o];null!==s&&!Xs(s)&&(r?s<=e:s<e)?n=o+1:i=o}return i}return Wn(t,e,Ka,r)}function Wn(t,e,r,n){var i=0,o=null==t?0:t.length;if(0===o)return 0;for(var s=(e=r(e))!=e,a=null===e,u=Xs(e),c=void 0===e;i<o;){var f=Ze((i+o)/2),l=r(t[f]),h=void 0!==l,d=null===l,p=l==l,m=Xs(l);if(s)var g=n||p;else g=c?p&&(n||h):a?p&&h&&(n||!d):u?p&&h&&!d&&(n||!m):!d&&!m&&(n?l<=e:l<e);g?i=f+1:o=f}return or(o,4294967294)}function Vn(t,e){for(var r=-1,n=t.length,i=0,o=[];++r<n;){var s=t[r],a=e?e(s):s;if(!r||!ks(a,u)){var u=a;o[i++]=0===s?0:s}}return o}function $n(t){return"number"==typeof t?t:Xs(t)?NaN:+t}function Xn(t){if("string"==typeof t)return t;if(Rs(t))return ce(t,Xn)+"";if(Xs(t))return Mr?Mr.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Yn(t,e,r){var n=-1,i=ae,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=ue;else if(o>=200){var c=e?null:Pi(t);if(c)return je(c);s=!1,i=Te,u=new Or}else u=e?[]:a;t:for(;++n<o;){var f=t[n],l=e?e(f):f;if(f=r||0!==f?f:0,s&&l==l){for(var h=u.length;h--;)if(u[h]===l)continue t;e&&u.push(l),a.push(f)}else i(u,l,r)||(u!==a&&u.push(l),a.push(f))}return a}function Jn(t,e){return null==(t=po(t,e=oi(e,t)))||delete t[So(Lo(e))]}function Zn(t,e,r,n){return jn(t,e,r(fn(t,e)),n)}function Qn(t,e,r,n){for(var i=t.length,o=n?i:-1;(n?o--:++o<i)&&e(t[o],o,t););return r?Hn(t,n?0:o,n?o+1:i):Hn(t,n?o+1:0,n?i:o)}function ti(t,e){var r=t;return r instanceof Cr&&(r=r.value()),le(e,(function(t,e){return e.func.apply(e.thisArg,fe([t],e.args))}),r)}function ei(t,e,r){var n=t.length;if(n<2)return n?Yn(t[0]):[];for(var i=-1,o=ft(n);++i<n;)for(var s=t[i],a=-1;++a<n;)a!=i&&(o[i]=Jr(o[i]||s,t[a],e,r));return Yn(nn(o,1),e,r)}function ri(t,e,r){for(var n=-1,i=t.length,o=e.length,s={};++n<i;){var a=n<o?e[n]:void 0;r(s,t[n],a)}return s}function ni(t){return Os(t)?t:[]}function ii(t){return"function"==typeof t?t:Ka}function oi(t,e){return Rs(t)?t:so(t,e)?[t]:Eo(oa(t))}var si=Dn;function ai(t,e,r){var n=t.length;return r=void 0===r?n:r,!e&&r>=n?t:Hn(t,e,r)}var ui=$e||function(t){return Ht.clearTimeout(t)};function ci(t,e){if(e)return t.slice();var r=t.length,n=Gt?Gt(r):new t.constructor(r);return t.copy(n),n}function fi(t){var e=new t.constructor(t.byteLength);return new Kt(e).set(new Kt(t)),e}function li(t,e){var r=e?fi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function hi(t,e){if(t!==e){var r=void 0!==t,n=null===t,i=t==t,o=Xs(t),s=void 0!==e,a=null===e,u=e==e,c=Xs(e);if(!a&&!c&&!o&&t>e||o&&s&&u&&!a&&!c||n&&s&&u||!r&&u||!i)return 1;if(!n&&!o&&!c&&t<e||c&&r&&i&&!n&&!o||a&&r&&i||!s&&i||!u)return-1}return 0}function di(t,e,r,n){for(var i=-1,o=t.length,s=r.length,a=-1,u=e.length,c=ir(o-s,0),f=ft(u+c),l=!n;++a<u;)f[a]=e[a];for(;++i<s;)(l||i<o)&&(f[r[i]]=t[i]);for(;c--;)f[a++]=t[i++];return f}function pi(t,e,r,n){for(var i=-1,o=t.length,s=-1,a=r.length,u=-1,c=e.length,f=ir(o-a,0),l=ft(f+c),h=!n;++i<f;)l[i]=t[i];for(var d=i;++u<c;)l[d+u]=e[u];for(;++s<a;)(h||i<o)&&(l[d+r[s]]=t[i++]);return l}function mi(t,e){var r=-1,n=t.length;for(e||(e=ft(n));++r<n;)e[r]=t[r];return e}function gi(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;void 0===u&&(u=t[a]),i?Gr(r,a,u):qr(r,a,u)}return r}function bi(t,e){return function(r,n){var i=Rs(r)?re:Hr,o=e?e():{};return i(r,t,$i(n,2),o)}}function yi(t){return Dn((function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&oo(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=mt(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e}))}function vi(t,e){return function(r,n){if(null==r)return r;if(!Ns(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=mt(r);(e?o--:++o<i)&&!1!==n(s[o],o,s););return r}}function wi(t){return function(e,r,n){for(var i=-1,o=mt(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(!1===r(o[u],u,o))break}return e}}function _i(t){return function(e){var r=Pe(e=oa(e))?qe(e):void 0,n=r?r[0]:e.charAt(0),i=r?ai(r,1).join(""):e.slice(1);return n[t]()+i}}function Ai(t){return function(e){return le(Ua(Ca(e).replace(Tt,"")),t,"")}}function Ei(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=kr(t.prototype),n=t.apply(r,e);return qs(n)?n:r}}function Si(t){return function(e,r,n){var i=mt(e);if(!Ns(e)){var o=$i(r,3);e=ya(e),r=function(t){return o(i[t],t,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}function Mi(t){return zi((function(e){var n=e.length,i=n,o=Ir.prototype.thru;for(t&&e.reverse();i--;){var s=e[i];if("function"!=typeof s)throw new yt(r);if(o&&!a&&"wrapper"==Wi(s))var a=new Ir([],!0)}for(i=a?i:n;++i<n;){var u=Wi(s=e[i]),c="wrapper"==u?Gi(s):void 0;a=c&&ao(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Wi(c[0])].apply(a,c[3]):1==s.length&&ao(s)?a[u]():a.thru(s)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&Rs(r))return a.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}function xi(t,e,r,n,i,o,s,a,u,c){var f=128&e,l=1&e,h=2&e,d=24&e,p=512&e,m=h?void 0:Ei(t);return function g(){for(var b=arguments.length,y=ft(b),v=b;v--;)y[v]=arguments[v];if(d)var w=Vi(g),_=Re(y,w);if(n&&(y=di(y,n,i,d)),o&&(y=pi(y,o,s,d)),b-=_,d&&b<c){var A=Ue(y,w);return Ni(t,e,xi,g.placeholder,r,y,A,a,u,c-b)}var E=l?r:this,S=h?E[t]:t;return b=y.length,a?y=mo(y,a):p&&b>1&&y.reverse(),f&&u<b&&(y.length=u),this&&this!==Ht&&this instanceof g&&(S=m||Ei(S)),S.apply(E,y)}}function ki(t,e){return function(r,n){return function(t,e,r,n){return an(t,(function(t,i,o){e(n,r(t),i,o)})),n}(r,t,e(n),{})}}function Ti(t,e){return function(r,n){var i;if(void 0===r&&void 0===n)return e;if(void 0!==r&&(i=r),void 0!==n){if(void 0===i)return n;"string"==typeof r||"string"==typeof n?(r=Xn(r),n=Xn(n)):(r=$n(r),n=$n(n)),i=t(r,n)}return i}}function Ii(t){return zi((function(e){return e=ce(e,xe($i())),Dn((function(r){var n=this;return t(e,(function(t){return ee(t,n,r)}))}))}))}function Ci(t,e){var r=(e=void 0===e?" ":Xn(e)).length;if(r<2)return r?Pn(e,t):e;var n=Pn(e,Je(t/Fe(e)));return Pe(e)?ai(qe(n),0,t).join(""):n.slice(0,t)}function Ri(t){return function(e,r,n){return n&&"number"!=typeof n&&oo(e,r,n)&&(r=n=void 0),e=ta(e),void 0===r?(r=e,e=0):r=ta(r),function(t,e,r,n){for(var i=-1,o=ir(Je((e-t)/(r||1)),0),s=ft(o);o--;)s[n?o:++i]=t,t+=r;return s}(e,r,n=void 0===n?e<r?1:-1:ta(n),t)}}function Bi(t){return function(e,r){return"string"==typeof e&&"string"==typeof r||(e=na(e),r=na(r)),t(e,r)}}function Ni(t,e,r,n,i,o,s,a,u,c){var f=8&e;e|=f?32:64,4&(e&=~(f?64:32))||(e&=-4);var l=[t,e,i,f?o:void 0,f?s:void 0,f?void 0:o,f?void 0:s,a,u,c],h=r.apply(void 0,l);return ao(t)&&bo(h,l),h.placeholder=n,wo(h,t,e)}function Oi(t){var e=pt[t];return function(t,r){if(t=na(t),(r=null==r?0:or(ea(r),292))&&er(t)){var n=(oa(t)+"e").split("e");return+((n=(oa(e(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return e(t)}}var Pi=dr&&1/je(new dr([,-0]))[1]==1/0?function(t){return new dr(t)}:Xa;function Di(t){return function(e){var r=to(e);return r==d?De(e):r==b?function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=[t,t]})),r}(e):function(t,e){return ce(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Li(t,e,n,o,s,a,u,c){var f=2&e;if(!f&&"function"!=typeof t)throw new yt(r);var l=o?o.length:0;if(l||(e&=-97,o=s=void 0),u=void 0===u?u:ir(ea(u),0),c=void 0===c?c:ea(c),l-=s?s.length:0,64&e){var h=o,d=s;o=s=void 0}var p=f?void 0:Gi(t),m=[t,e,n,o,s,h,d,a,u,c];if(p&&function(t,e){var r=t[1],n=e[1],o=r|n,s=o<131,a=128==n&&8==r||128==n&&256==r&&t[7].length<=e[8]||384==n&&e[7].length<=e[8]&&8==r;if(!s&&!a)return t;1&n&&(t[2]=e[2],o|=1&r?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?di(c,u,e[4]):u,t[4]=c?Ue(t[3],i):e[4]}(u=e[5])&&(c=t[5],t[5]=c?pi(c,u,e[6]):u,t[6]=c?Ue(t[5],i):e[6]),(u=e[7])&&(t[7]=u),128&n&&(t[8]=null==t[8]?e[8]:or(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(m,p),t=m[0],e=m[1],n=m[2],o=m[3],s=m[4],!(c=m[9]=void 0===m[9]?f?0:t.length:ir(m[9]-l,0))&&24&e&&(e&=-25),e&&1!=e)g=8==e||16==e?function(t,e,r){var n=Ei(t);return function i(){for(var o=arguments.length,s=ft(o),a=o,u=Vi(i);a--;)s[a]=arguments[a];var c=o<3&&s[0]!==u&&s[o-1]!==u?[]:Ue(s,u);return(o-=c.length)<r?Ni(t,e,xi,i.placeholder,void 0,s,c,void 0,void 0,r-o):ee(this&&this!==Ht&&this instanceof i?n:t,this,s)}}(t,e,c):32!=e&&33!=e||s.length?xi.apply(void 0,m):function(t,e,r,n){var i=1&e,o=Ei(t);return function e(){for(var s=-1,a=arguments.length,u=-1,c=n.length,f=ft(c+a),l=this&&this!==Ht&&this instanceof e?o:t;++u<c;)f[u]=n[u];for(;a--;)f[u++]=arguments[++s];return ee(l,i?r:this,f)}}(t,e,n,o);else var g=function(t,e,r){var n=1&e,i=Ei(t);return function e(){return(this&&this!==Ht&&this instanceof e?i:t).apply(n?r:this,arguments)}}(t,e,n);return wo((p?Fn:bo)(g,m),t,e)}function Ui(t,e,r,n){return void 0===t||ks(t,_t[r])&&!St.call(n,r)?e:t}function ji(t,e,r,n,i,o){return qs(t)&&qs(e)&&(o.set(e,t),Tn(t,e,void 0,ji,o),o.delete(e)),t}function Fi(t){return Gs(t)?void 0:t}function qi(t,e,r,n,i,o){var s=1&r,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t),f=o.get(e);if(c&&f)return c==e&&f==t;var l=-1,h=!0,d=2&r?new Or:void 0;for(o.set(t,e),o.set(e,t);++l<a;){var p=t[l],m=e[l];if(n)var g=s?n(m,p,l,e,t,o):n(p,m,l,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!de(e,(function(t,e){if(!Te(d,e)&&(p===t||i(p,t,r,n,o)))return d.push(e)}))){h=!1;break}}else if(p!==m&&!i(p,m,r,n,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function zi(t){return vo(ho(t,void 0,Bo),t+"")}function Hi(t){return ln(t,ya,Zi)}function Ki(t){return ln(t,va,Qi)}var Gi=gr?function(t){return gr.get(t)}:Xa;function Wi(t){for(var e=t.name+"",r=br[e],n=St.call(br,e)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==t)return i.name}return e}function Vi(t){return(St.call(xr,"placeholder")?xr:t).placeholder}function $i(){var t=xr.iteratee||Ga;return t=t===Ga?An:t,arguments.length?t(arguments[0],arguments[1]):t}function Xi(t,e){var r,n,i=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof e?"string":"hash"]:i.map}function Yi(t){for(var e=ya(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,fo(i)]}return e}function Ji(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return _n(r)?r:void 0}var Zi=Qe?function(t){return null==t?[]:(t=mt(t),se(Qe(t),(function(e){return pe.call(t,e)})))}:ru,Qi=Qe?function(t){for(var e=[];t;)fe(e,Zi(t)),t=Vt(t);return e}:ru,to=hn;function eo(t,e,r){for(var n=-1,i=(e=oi(e,t)).length,o=!1;++n<i;){var s=So(e[n]);if(!(o=null!=t&&r(t,s)))break;t=t[s]}return o||++n!=i?o:!!(i=null==t?0:t.length)&&Fs(i)&&io(s,i)&&(Rs(t)||Cs(t))}function ro(t){return"function"!=typeof t.constructor||co(t)?{}:kr(Vt(t))}function no(t){return Rs(t)||Cs(t)||!!(Ke&&t&&t[Ke])}function io(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&st.test(t))&&t>-1&&t%1==0&&t<e}function oo(t,e,r){if(!qs(r))return!1;var n=typeof e;return!!("number"==n?Ns(r)&&io(e,r.length):"string"==n&&e in r)&&ks(r[e],t)}function so(t,e){if(Rs(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Xs(t))||z.test(t)||!q.test(t)||null!=e&&t in mt(e)}function ao(t){var e=Wi(t),r=xr[e];if("function"!=typeof r||!(e in Cr.prototype))return!1;if(t===r)return!0;var n=Gi(r);return!!n&&t===n[0]}(fr&&to(new fr(new ArrayBuffer(1)))!=A||lr&&to(new lr)!=d||hr&&"[object Promise]"!=to(hr.resolve())||dr&&to(new dr)!=b||pr&&to(new pr)!=w)&&(to=function(t){var e=hn(t),r=e==m?t.constructor:void 0,n=r?Mo(r):"";if(n)switch(n){case yr:return A;case vr:return d;case wr:return"[object Promise]";case _r:return b;case Ar:return w}return e});var uo=At?Us:nu;function co(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||_t)}function fo(t){return t==t&&!qs(t)}function lo(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in mt(r))}}function ho(t,e,r){return e=ir(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=ir(n.length-e,0),s=ft(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=ft(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),ee(t,this,a)}}function po(t,e){return e.length<2?t:fn(t,Hn(e,0,-1))}function mo(t,e){for(var r=t.length,n=or(e.length,r),i=mi(t);n--;){var o=e[n];t[n]=io(o,r)?i[o]:void 0}return t}function go(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bo=_o(Fn),yo=Ye||function(t,e){return Ht.setTimeout(t,e)},vo=_o(qn);function wo(t,e,r){var n=e+"";return vo(t,function(t,e){var r=e.length;if(!r)return t;var n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(X,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return ne(o,(function(r){var n="_."+r[0];e&r[1]&&!ae(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(Y);return e?e[1].split(J):[]}(n),r)))}function _o(t){var e=0,r=0;return function(){var n=sr(),i=16-(n-r);if(r=n,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ao(t,e){var r=-1,n=t.length,i=n-1;for(e=void 0===e?n:e;++r<e;){var o=On(r,i),s=t[o];t[o]=t[r],t[r]=s}return t.length=e,t}var Eo=function(t){var e=_s((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(H,(function(t,r,n,i){e.push(n?i.replace(Q,"$1"):r||t)})),e}),(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}();function So(t){if("string"==typeof t||Xs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Mo(t){if(null!=t){try{return Et.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function xo(t){if(t instanceof Cr)return t.clone();var e=new Ir(t.__wrapped__,t.__chain__);return e.__actions__=mi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var ko=Dn((function(t,e){return Os(t)?Jr(t,nn(e,1,Os,!0)):[]})),To=Dn((function(t,e){var r=Lo(e);return Os(r)&&(r=void 0),Os(t)?Jr(t,nn(e,1,Os,!0),$i(r,2)):[]})),Io=Dn((function(t,e){var r=Lo(e);return Os(r)&&(r=void 0),Os(t)?Jr(t,nn(e,1,Os,!0),void 0,r):[]}));function Co(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ea(r);return i<0&&(i=ir(n+i,0)),ge(t,$i(e,3),i)}function Ro(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n-1;return void 0!==r&&(i=ea(r),i=r<0?ir(n+i,0):or(i,n-1)),ge(t,$i(e,3),i,!0)}function Bo(t){return null!=t&&t.length?nn(t,1):[]}function No(t){return t&&t.length?t[0]:void 0}var Oo=Dn((function(t){var e=ce(t,ni);return e.length&&e[0]===t[0]?gn(e):[]})),Po=Dn((function(t){var e=Lo(t),r=ce(t,ni);return e===Lo(r)?e=void 0:r.pop(),r.length&&r[0]===t[0]?gn(r,$i(e,2)):[]})),Do=Dn((function(t){var e=Lo(t),r=ce(t,ni);return(e="function"==typeof e?e:void 0)&&r.pop(),r.length&&r[0]===t[0]?gn(r,void 0,e):[]}));function Lo(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Uo=Dn(jo);function jo(t,e){return t&&t.length&&e&&e.length?Bn(t,e):t}var Fo=zi((function(t,e){var r=null==t?0:t.length,n=Wr(t,e);return Nn(t,ce(e,(function(t){return io(t,r)?+t:t})).sort(hi)),n}));function qo(t){return null==t?t:cr.call(t)}var zo=Dn((function(t){return Yn(nn(t,1,Os,!0))})),Ho=Dn((function(t){var e=Lo(t);return Os(e)&&(e=void 0),Yn(nn(t,1,Os,!0),$i(e,2))})),Ko=Dn((function(t){var e=Lo(t);return e="function"==typeof e?e:void 0,Yn(nn(t,1,Os,!0),void 0,e)}));function Go(t){if(!t||!t.length)return[];var e=0;return t=se(t,(function(t){if(Os(t))return e=ir(t.length,e),!0})),Me(e,(function(e){return ce(t,_e(e))}))}function Wo(t,e){if(!t||!t.length)return[];var r=Go(t);return null==e?r:ce(r,(function(t){return ee(e,void 0,t)}))}var Vo=Dn((function(t,e){return Os(t)?Jr(t,e):[]})),$o=Dn((function(t){return ei(se(t,Os))})),Xo=Dn((function(t){var e=Lo(t);return Os(e)&&(e=void 0),ei(se(t,Os),$i(e,2))})),Yo=Dn((function(t){var e=Lo(t);return e="function"==typeof e?e:void 0,ei(se(t,Os),void 0,e)})),Jo=Dn(Go),Zo=Dn((function(t){var e=t.length,r=e>1?t[e-1]:void 0;return r="function"==typeof r?(t.pop(),r):void 0,Wo(t,r)}));function Qo(t){var e=xr(t);return e.__chain__=!0,e}function ts(t,e){return e(t)}var es=zi((function(t){var e=t.length,r=e?t[0]:0,n=this.__wrapped__,i=function(e){return Wr(e,t)};return!(e>1||this.__actions__.length)&&n instanceof Cr&&io(r)?((n=n.slice(r,+r+(e?1:0))).__actions__.push({func:ts,args:[i],thisArg:void 0}),new Ir(n,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)})),rs=bi((function(t,e,r){St.call(t,r)?++t[r]:Gr(t,r,1)})),ns=Si(Co),is=Si(Ro);function os(t,e){return(Rs(t)?ne:Zr)(t,$i(e,3))}function ss(t,e){return(Rs(t)?ie:Qr)(t,$i(e,3))}var as=bi((function(t,e,r){St.call(t,r)?t[r].push(e):Gr(t,r,[e])})),us=Dn((function(t,e,r){var n=-1,i="function"==typeof e,o=Ns(t)?ft(t.length):[];return Zr(t,(function(t){o[++n]=i?ee(e,t,r):bn(t,e,r)})),o})),cs=bi((function(t,e,r){Gr(t,r,e)}));function fs(t,e){return(Rs(t)?ce:Mn)(t,$i(e,3))}var ls=bi((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),hs=Dn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&oo(t,e[0],e[1])?e=[]:r>2&&oo(e[0],e[1],e[2])&&(e=[e[0]]),Cn(t,nn(e,1),[])})),ds=Xe||function(){return Ht.Date.now()};function ps(t,e,r){return e=r?void 0:e,Li(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function ms(t,e){var n;if("function"!=typeof e)throw new yt(r);return t=ea(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var gs=Dn((function(t,e,r){var n=1;if(r.length){var i=Ue(r,Vi(gs));n|=32}return Li(t,n,e,r,i)})),bs=Dn((function(t,e,r){var n=3;if(r.length){var i=Ue(r,Vi(bs));n|=32}return Li(e,n,t,r,i)}));function ys(t,e,n){var i,o,s,a,u,c,f=0,l=!1,h=!1,d=!0;if("function"!=typeof t)throw new yt(r);function p(e){var r=i,n=o;return i=o=void 0,f=e,a=t.apply(n,r)}function m(t){return f=t,u=yo(b,e),l?p(t):a}function g(t){var r=t-c;return void 0===c||r>=e||r<0||h&&t-f>=s}function b(){var t=ds();if(g(t))return y(t);u=yo(b,function(t){var r=e-(t-c);return h?or(r,s-(t-f)):r}(t))}function y(t){return u=void 0,d&&i?p(t):(i=o=void 0,a)}function v(){var t=ds(),r=g(t);if(i=arguments,o=this,c=t,r){if(void 0===u)return m(c);if(h)return ui(u),u=yo(b,e),p(c)}return void 0===u&&(u=yo(b,e)),a}return e=na(e)||0,qs(n)&&(l=!!n.leading,s=(h="maxWait"in n)?ir(na(n.maxWait)||0,e):s,d="trailing"in n?!!n.trailing:d),v.cancel=function(){void 0!==u&&ui(u),f=0,i=c=o=u=void 0},v.flush=function(){return void 0===u?a:y(ds())},v}var vs=Dn((function(t,e){return Yr(t,1,e)})),ws=Dn((function(t,e,r){return Yr(t,na(e)||0,r)}));function _s(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new yt(r);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(_s.Cache||Nr),n}function As(t){if("function"!=typeof t)throw new yt(r);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}_s.Cache=Nr;var Es=si((function(t,e){var r=(e=1==e.length&&Rs(e[0])?ce(e[0],xe($i())):ce(nn(e,1),xe($i()))).length;return Dn((function(n){for(var i=-1,o=or(n.length,r);++i<o;)n[i]=e[i].call(this,n[i]);return ee(t,this,n)}))})),Ss=Dn((function(t,e){return Li(t,32,void 0,e,Ue(e,Vi(Ss)))})),Ms=Dn((function(t,e){return Li(t,64,void 0,e,Ue(e,Vi(Ms)))})),xs=zi((function(t,e){return Li(t,256,void 0,void 0,void 0,e)}));function ks(t,e){return t===e||t!=t&&e!=e}var Ts=Bi(dn),Is=Bi((function(t,e){return t>=e})),Cs=yn(function(){return arguments}())?yn:function(t){return zs(t)&&St.call(t,"callee")&&!pe.call(t,"callee")},Rs=ft.isArray,Bs=Xt?xe(Xt):function(t){return zs(t)&&hn(t)==_};function Ns(t){return null!=t&&Fs(t.length)&&!Us(t)}function Os(t){return zs(t)&&Ns(t)}var Ps=tr||nu,Ds=Yt?xe(Yt):function(t){return zs(t)&&hn(t)==c};function Ls(t){if(!zs(t))return!1;var e=hn(t);return e==f||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Gs(t)}function Us(t){if(!qs(t))return!1;var e=hn(t);return e==l||e==h||"[object AsyncFunction]"==e||"[object Proxy]"==e}function js(t){return"number"==typeof t&&t==ea(t)}function Fs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function qs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function zs(t){return null!=t&&"object"==typeof t}var Hs=Jt?xe(Jt):function(t){return zs(t)&&to(t)==d};function Ks(t){return"number"==typeof t||zs(t)&&hn(t)==p}function Gs(t){if(!zs(t)||hn(t)!=m)return!1;var e=Vt(t);if(null===e)return!0;var r=St.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==Ct}var Ws=Zt?xe(Zt):function(t){return zs(t)&&hn(t)==g},Vs=Qt?xe(Qt):function(t){return zs(t)&&to(t)==b};function $s(t){return"string"==typeof t||!Rs(t)&&zs(t)&&hn(t)==y}function Xs(t){return"symbol"==typeof t||zs(t)&&hn(t)==v}var Ys=te?xe(te):function(t){return zs(t)&&Fs(t.length)&&!!Dt[hn(t)]},Js=Bi(Sn),Zs=Bi((function(t,e){return t<=e}));function Qs(t){if(!t)return[];if(Ns(t))return $s(t)?qe(t):mi(t);if(Ge&&t[Ge])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[Ge]());var e=to(t);return(e==d?De:e==b?je:ka)(t)}function ta(t){return t?(t=na(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ea(t){var e=ta(t),r=e%1;return e==e?r?e-r:e:0}function ra(t){return t?Vr(ea(t),0,4294967295):0}function na(t){if("number"==typeof t)return t;if(Xs(t))return NaN;if(qs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=qs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(W,"");var r=nt.test(t);return r||ot.test(t)?Ft(t.slice(2),r?2:8):rt.test(t)?NaN:+t}function ia(t){return gi(t,va(t))}function oa(t){return null==t?"":Xn(t)}var sa=yi((function(t,e){if(co(e)||Ns(e))gi(e,ya(e),t);else for(var r in e)St.call(e,r)&&qr(t,r,e[r])})),aa=yi((function(t,e){gi(e,va(e),t)})),ua=yi((function(t,e,r,n){gi(e,va(e),t,n)})),ca=yi((function(t,e,r,n){gi(e,ya(e),t,n)})),fa=zi(Wr),la=Dn((function(t,e){t=mt(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&oo(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=va(o),a=-1,u=s.length;++a<u;){var c=s[a],f=t[c];(void 0===f||ks(f,_t[c])&&!St.call(t,c))&&(t[c]=o[c])}return t})),ha=Dn((function(t){return t.push(void 0,ji),ee(_a,void 0,t)}));function da(t,e,r){var n=null==t?void 0:fn(t,e);return void 0===n?r:n}function pa(t,e){return null!=t&&eo(t,e,mn)}var ma=ki((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=kt.call(e)),t[e]=r}),qa(Ka)),ga=ki((function(t,e,r){null!=e&&"function"!=typeof e.toString&&(e=kt.call(e)),St.call(t,e)?t[e].push(r):t[e]=[r]}),$i),ba=Dn(bn);function ya(t){return Ns(t)?Dr(t):En(t)}function va(t){return Ns(t)?Dr(t,!0):function(t){if(!qs(t))return function(t){var e=[];if(null!=t)for(var r in mt(t))e.push(r);return e}(t);var e=co(t),r=[];for(var n in t)("constructor"!=n||!e&&St.call(t,n))&&r.push(n);return r}(t)}var wa=yi((function(t,e,r){Tn(t,e,r)})),_a=yi((function(t,e,r,n){Tn(t,e,r,n)})),Aa=zi((function(t,e){var r={};if(null==t)return r;var n=!1;e=ce(e,(function(e){return e=oi(e,t),n||(n=e.length>1),e})),gi(t,Ki(t),r),n&&(r=$r(r,7,Fi));for(var i=e.length;i--;)Jn(r,e[i]);return r})),Ea=zi((function(t,e){return null==t?{}:function(t,e){return Rn(t,e,(function(e,r){return pa(t,r)}))}(t,e)}));function Sa(t,e){if(null==t)return{};var r=ce(Ki(t),(function(t){return[t]}));return e=$i(e),Rn(t,r,(function(t,r){return e(t,r[0])}))}var Ma=Di(ya),xa=Di(va);function ka(t){return null==t?[]:ke(t,ya(t))}var Ta=Ai((function(t,e,r){return e=e.toLowerCase(),t+(r?Ia(e):e)}));function Ia(t){return La(oa(t).toLowerCase())}function Ca(t){return(t=oa(t))&&t.replace(at,Be).replace(It,"")}var Ra=Ai((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ba=Ai((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Na=_i("toLowerCase"),Oa=Ai((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Pa=Ai((function(t,e,r){return t+(r?" ":"")+La(e)})),Da=Ai((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),La=_i("toUpperCase");function Ua(t,e,r){return t=oa(t),void 0===(e=r?void 0:e)?function(t){return Nt.test(t)}(t)?function(t){return t.match(Rt)||[]}(t):function(t){return t.match(Z)||[]}(t):t.match(e)||[]}var ja=Dn((function(t,e){try{return ee(t,void 0,e)}catch(t){return Ls(t)?t:new ht(t)}})),Fa=zi((function(t,e){return ne(e,(function(e){e=So(e),Gr(t,e,gs(t[e],t))})),t}));function qa(t){return function(){return t}}var za=Mi(),Ha=Mi(!0);function Ka(t){return t}function Ga(t){return An("function"==typeof t?t:$r(t,1))}var Wa=Dn((function(t,e){return function(r){return bn(r,t,e)}})),Va=Dn((function(t,e){return function(r){return bn(t,r,e)}}));function $a(t,e,r){var n=ya(e),i=cn(e,n);null!=r||qs(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=cn(e,ya(e)));var o=!(qs(r)&&"chain"in r&&!r.chain),s=Us(t);return ne(i,(function(r){var n=e[r];t[r]=n,s&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=mi(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,fe([this.value()],arguments))})})),t}function Xa(){}var Ya=Ii(ce),Ja=Ii(oe),Za=Ii(de);function Qa(t){return so(t)?_e(So(t)):function(t){return function(e){return fn(e,t)}}(t)}var tu=Ri(),eu=Ri(!0);function ru(){return[]}function nu(){return!1}var iu,ou=Ti((function(t,e){return t+e}),0),su=Oi("ceil"),au=Ti((function(t,e){return t/e}),1),uu=Oi("floor"),cu=Ti((function(t,e){return t*e}),1),fu=Oi("round"),lu=Ti((function(t,e){return t-e}),0);return xr.after=function(t,e){if("function"!=typeof e)throw new yt(r);return t=ea(t),function(){if(--t<1)return e.apply(this,arguments)}},xr.ary=ps,xr.assign=sa,xr.assignIn=aa,xr.assignInWith=ua,xr.assignWith=ca,xr.at=fa,xr.before=ms,xr.bind=gs,xr.bindAll=Fa,xr.bindKey=bs,xr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Rs(t)?t:[t]},xr.chain=Qo,xr.chunk=function(t,e,r){e=(r?oo(t,e,r):void 0===e)?1:ir(ea(e),0);var n=null==t?0:t.length;if(!n||e<1)return[];for(var i=0,o=0,s=ft(Je(n/e));i<n;)s[o++]=Hn(t,i,i+=e);return s},xr.compact=function(t){for(var e=-1,r=null==t?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i},xr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=ft(t-1),r=arguments[0],n=t;n--;)e[n-1]=arguments[n];return fe(Rs(r)?mi(r):[r],nn(e,1))},xr.cond=function(t){var e=null==t?0:t.length,n=$i();return t=e?ce(t,(function(t){if("function"!=typeof t[1])throw new yt(r);return[n(t[0]),t[1]]})):[],Dn((function(r){for(var n=-1;++n<e;){var i=t[n];if(ee(i[0],this,r))return ee(i[1],this,r)}}))},xr.conforms=function(t){return function(t){var e=ya(t);return function(r){return Xr(r,t,e)}}($r(t,1))},xr.constant=qa,xr.countBy=rs,xr.create=function(t,e){var r=kr(t);return null==e?r:Kr(r,e)},xr.curry=function t(e,r,n){var i=Li(e,8,void 0,void 0,void 0,void 0,void 0,r=n?void 0:r);return i.placeholder=t.placeholder,i},xr.curryRight=function t(e,r,n){var i=Li(e,16,void 0,void 0,void 0,void 0,void 0,r=n?void 0:r);return i.placeholder=t.placeholder,i},xr.debounce=ys,xr.defaults=la,xr.defaultsDeep=ha,xr.defer=vs,xr.delay=ws,xr.difference=ko,xr.differenceBy=To,xr.differenceWith=Io,xr.drop=function(t,e,r){var n=null==t?0:t.length;return n?Hn(t,(e=r||void 0===e?1:ea(e))<0?0:e,n):[]},xr.dropRight=function(t,e,r){var n=null==t?0:t.length;return n?Hn(t,0,(e=n-(e=r||void 0===e?1:ea(e)))<0?0:e):[]},xr.dropRightWhile=function(t,e){return t&&t.length?Qn(t,$i(e,3),!0,!0):[]},xr.dropWhile=function(t,e){return t&&t.length?Qn(t,$i(e,3),!0):[]},xr.fill=function(t,e,r,n){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&oo(t,e,r)&&(r=0,n=i),function(t,e,r,n){var i=t.length;for((r=ea(r))<0&&(r=-r>i?0:i+r),(n=void 0===n||n>i?i:ea(n))<0&&(n+=i),n=r>n?0:ra(n);r<n;)t[r++]=e;return t}(t,e,r,n)):[]},xr.filter=function(t,e){return(Rs(t)?se:rn)(t,$i(e,3))},xr.flatMap=function(t,e){return nn(fs(t,e),1)},xr.flatMapDeep=function(t,e){return nn(fs(t,e),1/0)},xr.flatMapDepth=function(t,e,r){return r=void 0===r?1:ea(r),nn(fs(t,e),r)},xr.flatten=Bo,xr.flattenDeep=function(t){return null!=t&&t.length?nn(t,1/0):[]},xr.flattenDepth=function(t,e){return null!=t&&t.length?nn(t,e=void 0===e?1:ea(e)):[]},xr.flip=function(t){return Li(t,512)},xr.flow=za,xr.flowRight=Ha,xr.fromPairs=function(t){for(var e=-1,r=null==t?0:t.length,n={};++e<r;){var i=t[e];n[i[0]]=i[1]}return n},xr.functions=function(t){return null==t?[]:cn(t,ya(t))},xr.functionsIn=function(t){return null==t?[]:cn(t,va(t))},xr.groupBy=as,xr.initial=function(t){return null!=t&&t.length?Hn(t,0,-1):[]},xr.intersection=Oo,xr.intersectionBy=Po,xr.intersectionWith=Do,xr.invert=ma,xr.invertBy=ga,xr.invokeMap=us,xr.iteratee=Ga,xr.keyBy=cs,xr.keys=ya,xr.keysIn=va,xr.map=fs,xr.mapKeys=function(t,e){var r={};return e=$i(e,3),an(t,(function(t,n,i){Gr(r,e(t,n,i),t)})),r},xr.mapValues=function(t,e){var r={};return e=$i(e,3),an(t,(function(t,n,i){Gr(r,n,e(t,n,i))})),r},xr.matches=function(t){return xn($r(t,1))},xr.matchesProperty=function(t,e){return kn(t,$r(e,1))},xr.memoize=_s,xr.merge=wa,xr.mergeWith=_a,xr.method=Wa,xr.methodOf=Va,xr.mixin=$a,xr.negate=As,xr.nthArg=function(t){return t=ea(t),Dn((function(e){return In(e,t)}))},xr.omit=Aa,xr.omitBy=function(t,e){return Sa(t,As($i(e)))},xr.once=function(t){return ms(2,t)},xr.orderBy=function(t,e,r,n){return null==t?[]:(Rs(e)||(e=null==e?[]:[e]),Rs(r=n?void 0:r)||(r=null==r?[]:[r]),Cn(t,e,r))},xr.over=Ya,xr.overArgs=Es,xr.overEvery=Ja,xr.overSome=Za,xr.partial=Ss,xr.partialRight=Ms,xr.partition=ls,xr.pick=Ea,xr.pickBy=Sa,xr.property=Qa,xr.propertyOf=function(t){return function(e){return null==t?void 0:fn(t,e)}},xr.pull=Uo,xr.pullAll=jo,xr.pullAllBy=function(t,e,r){return t&&t.length&&e&&e.length?Bn(t,e,$i(r,2)):t},xr.pullAllWith=function(t,e,r){return t&&t.length&&e&&e.length?Bn(t,e,void 0,r):t},xr.pullAt=Fo,xr.range=tu,xr.rangeRight=eu,xr.rearg=xs,xr.reject=function(t,e){return(Rs(t)?se:rn)(t,As($i(e,3)))},xr.remove=function(t,e){var r=[];if(!t||!t.length)return r;var n=-1,i=[],o=t.length;for(e=$i(e,3);++n<o;){var s=t[n];e(s,n,t)&&(r.push(s),i.push(n))}return Nn(t,i),r},xr.rest=function(t,e){if("function"!=typeof t)throw new yt(r);return Dn(t,e=void 0===e?e:ea(e))},xr.reverse=qo,xr.sampleSize=function(t,e,r){return e=(r?oo(t,e,r):void 0===e)?1:ea(e),(Rs(t)?Ur:Un)(t,e)},xr.set=function(t,e,r){return null==t?t:jn(t,e,r)},xr.setWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:jn(t,e,r,n)},xr.shuffle=function(t){return(Rs(t)?jr:zn)(t)},xr.slice=function(t,e,r){var n=null==t?0:t.length;return n?(r&&"number"!=typeof r&&oo(t,e,r)?(e=0,r=n):(e=null==e?0:ea(e),r=void 0===r?n:ea(r)),Hn(t,e,r)):[]},xr.sortBy=hs,xr.sortedUniq=function(t){return t&&t.length?Vn(t):[]},xr.sortedUniqBy=function(t,e){return t&&t.length?Vn(t,$i(e,2)):[]},xr.split=function(t,e,r){return r&&"number"!=typeof r&&oo(t,e,r)&&(e=r=void 0),(r=void 0===r?4294967295:r>>>0)?(t=oa(t))&&("string"==typeof e||null!=e&&!Ws(e))&&!(e=Xn(e))&&Pe(t)?ai(qe(t),0,r):t.split(e,r):[]},xr.spread=function(t,e){if("function"!=typeof t)throw new yt(r);return e=null==e?0:ir(ea(e),0),Dn((function(r){var n=r[e],i=ai(r,0,e);return n&&fe(i,n),ee(t,this,i)}))},xr.tail=function(t){var e=null==t?0:t.length;return e?Hn(t,1,e):[]},xr.take=function(t,e,r){return t&&t.length?Hn(t,0,(e=r||void 0===e?1:ea(e))<0?0:e):[]},xr.takeRight=function(t,e,r){var n=null==t?0:t.length;return n?Hn(t,(e=n-(e=r||void 0===e?1:ea(e)))<0?0:e,n):[]},xr.takeRightWhile=function(t,e){return t&&t.length?Qn(t,$i(e,3),!1,!0):[]},xr.takeWhile=function(t,e){return t&&t.length?Qn(t,$i(e,3)):[]},xr.tap=function(t,e){return e(t),t},xr.throttle=function(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw new yt(r);return qs(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),ys(t,e,{leading:i,maxWait:e,trailing:o})},xr.thru=ts,xr.toArray=Qs,xr.toPairs=Ma,xr.toPairsIn=xa,xr.toPath=function(t){return Rs(t)?ce(t,So):Xs(t)?[t]:mi(Eo(oa(t)))},xr.toPlainObject=ia,xr.transform=function(t,e,r){var n=Rs(t),i=n||Ps(t)||Ys(t);if(e=$i(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:qs(t)&&Us(o)?kr(Vt(t)):{}}return(i?ne:an)(t,(function(t,n,i){return e(r,t,n,i)})),r},xr.unary=function(t){return ps(t,1)},xr.union=zo,xr.unionBy=Ho,xr.unionWith=Ko,xr.uniq=function(t){return t&&t.length?Yn(t):[]},xr.uniqBy=function(t,e){return t&&t.length?Yn(t,$i(e,2)):[]},xr.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Yn(t,void 0,e):[]},xr.unset=function(t,e){return null==t||Jn(t,e)},xr.unzip=Go,xr.unzipWith=Wo,xr.update=function(t,e,r){return null==t?t:Zn(t,e,ii(r))},xr.updateWith=function(t,e,r,n){return n="function"==typeof n?n:void 0,null==t?t:Zn(t,e,ii(r),n)},xr.values=ka,xr.valuesIn=function(t){return null==t?[]:ke(t,va(t))},xr.without=Vo,xr.words=Ua,xr.wrap=function(t,e){return Ss(ii(e),t)},xr.xor=$o,xr.xorBy=Xo,xr.xorWith=Yo,xr.zip=Jo,xr.zipObject=function(t,e){return ri(t||[],e||[],qr)},xr.zipObjectDeep=function(t,e){return ri(t||[],e||[],jn)},xr.zipWith=Zo,xr.entries=Ma,xr.entriesIn=xa,xr.extend=aa,xr.extendWith=ua,$a(xr,xr),xr.add=ou,xr.attempt=ja,xr.camelCase=Ta,xr.capitalize=Ia,xr.ceil=su,xr.clamp=function(t,e,r){return void 0===r&&(r=e,e=void 0),void 0!==r&&(r=(r=na(r))==r?r:0),void 0!==e&&(e=(e=na(e))==e?e:0),Vr(na(t),e,r)},xr.clone=function(t){return $r(t,4)},xr.cloneDeep=function(t){return $r(t,5)},xr.cloneDeepWith=function(t,e){return $r(t,5,e="function"==typeof e?e:void 0)},xr.cloneWith=function(t,e){return $r(t,4,e="function"==typeof e?e:void 0)},xr.conformsTo=function(t,e){return null==e||Xr(t,e,ya(e))},xr.deburr=Ca,xr.defaultTo=function(t,e){return null==t||t!=t?e:t},xr.divide=au,xr.endsWith=function(t,e,r){t=oa(t),e=Xn(e);var n=t.length,i=r=void 0===r?n:Vr(ea(r),0,n);return(r-=e.length)>=0&&t.slice(r,i)==e},xr.eq=ks,xr.escape=function(t){return(t=oa(t))&&L.test(t)?t.replace(P,Ne):t},xr.escapeRegExp=function(t){return(t=oa(t))&&G.test(t)?t.replace(K,"\\$&"):t},xr.every=function(t,e,r){var n=Rs(t)?oe:tn;return r&&oo(t,e,r)&&(e=void 0),n(t,$i(e,3))},xr.find=ns,xr.findIndex=Co,xr.findKey=function(t,e){return me(t,$i(e,3),an)},xr.findLast=is,xr.findLastIndex=Ro,xr.findLastKey=function(t,e){return me(t,$i(e,3),un)},xr.floor=uu,xr.forEach=os,xr.forEachRight=ss,xr.forIn=function(t,e){return null==t?t:on(t,$i(e,3),va)},xr.forInRight=function(t,e){return null==t?t:sn(t,$i(e,3),va)},xr.forOwn=function(t,e){return t&&an(t,$i(e,3))},xr.forOwnRight=function(t,e){return t&&un(t,$i(e,3))},xr.get=da,xr.gt=Ts,xr.gte=Is,xr.has=function(t,e){return null!=t&&eo(t,e,pn)},xr.hasIn=pa,xr.head=No,xr.identity=Ka,xr.includes=function(t,e,r,n){t=Ns(t)?t:ka(t),r=r&&!n?ea(r):0;var i=t.length;return r<0&&(r=ir(i+r,0)),$s(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&be(t,e,r)>-1},xr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ea(r);return i<0&&(i=ir(n+i,0)),be(t,e,i)},xr.inRange=function(t,e,r){return e=ta(e),void 0===r?(r=e,e=0):r=ta(r),function(t,e,r){return t>=or(e,r)&&t<ir(e,r)}(t=na(t),e,r)},xr.invoke=ba,xr.isArguments=Cs,xr.isArray=Rs,xr.isArrayBuffer=Bs,xr.isArrayLike=Ns,xr.isArrayLikeObject=Os,xr.isBoolean=function(t){return!0===t||!1===t||zs(t)&&hn(t)==u},xr.isBuffer=Ps,xr.isDate=Ds,xr.isElement=function(t){return zs(t)&&1===t.nodeType&&!Gs(t)},xr.isEmpty=function(t){if(null==t)return!0;if(Ns(t)&&(Rs(t)||"string"==typeof t||"function"==typeof t.splice||Ps(t)||Ys(t)||Cs(t)))return!t.length;var e=to(t);if(e==d||e==b)return!t.size;if(co(t))return!En(t).length;for(var r in t)if(St.call(t,r))return!1;return!0},xr.isEqual=function(t,e){return vn(t,e)},xr.isEqualWith=function(t,e,r){var n=(r="function"==typeof r?r:void 0)?r(t,e):void 0;return void 0===n?vn(t,e,void 0,r):!!n},xr.isError=Ls,xr.isFinite=function(t){return"number"==typeof t&&er(t)},xr.isFunction=Us,xr.isInteger=js,xr.isLength=Fs,xr.isMap=Hs,xr.isMatch=function(t,e){return t===e||wn(t,e,Yi(e))},xr.isMatchWith=function(t,e,r){return r="function"==typeof r?r:void 0,wn(t,e,Yi(e),r)},xr.isNaN=function(t){return Ks(t)&&t!=+t},xr.isNative=function(t){if(uo(t))throw new ht("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _n(t)},xr.isNil=function(t){return null==t},xr.isNull=function(t){return null===t},xr.isNumber=Ks,xr.isObject=qs,xr.isObjectLike=zs,xr.isPlainObject=Gs,xr.isRegExp=Ws,xr.isSafeInteger=function(t){return js(t)&&t>=-9007199254740991&&t<=9007199254740991},xr.isSet=Vs,xr.isString=$s,xr.isSymbol=Xs,xr.isTypedArray=Ys,xr.isUndefined=function(t){return void 0===t},xr.isWeakMap=function(t){return zs(t)&&to(t)==w},xr.isWeakSet=function(t){return zs(t)&&"[object WeakSet]"==hn(t)},xr.join=function(t,e){return null==t?"":rr.call(t,e)},xr.kebabCase=Ra,xr.last=Lo,xr.lastIndexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=n;return void 0!==r&&(i=(i=ea(r))<0?ir(n+i,0):or(i,n-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,i):ge(t,ve,i,!0)},xr.lowerCase=Ba,xr.lowerFirst=Na,xr.lt=Js,xr.lte=Zs,xr.max=function(t){return t&&t.length?en(t,Ka,dn):void 0},xr.maxBy=function(t,e){return t&&t.length?en(t,$i(e,2),dn):void 0},xr.mean=function(t){return we(t,Ka)},xr.meanBy=function(t,e){return we(t,$i(e,2))},xr.min=function(t){return t&&t.length?en(t,Ka,Sn):void 0},xr.minBy=function(t,e){return t&&t.length?en(t,$i(e,2),Sn):void 0},xr.stubArray=ru,xr.stubFalse=nu,xr.stubObject=function(){return{}},xr.stubString=function(){return""},xr.stubTrue=function(){return!0},xr.multiply=cu,xr.nth=function(t,e){return t&&t.length?In(t,ea(e)):void 0},xr.noConflict=function(){return Ht._===this&&(Ht._=Bt),this},xr.noop=Xa,xr.now=ds,xr.pad=function(t,e,r){t=oa(t);var n=(e=ea(e))?Fe(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Ci(Ze(i),r)+t+Ci(Je(i),r)},xr.padEnd=function(t,e,r){t=oa(t);var n=(e=ea(e))?Fe(t):0;return e&&n<e?t+Ci(e-n,r):t},xr.padStart=function(t,e,r){t=oa(t);var n=(e=ea(e))?Fe(t):0;return e&&n<e?Ci(e-n,r)+t:t},xr.parseInt=function(t,e,r){return r||null==e?e=0:e&&(e=+e),ar(oa(t).replace(V,""),e||0)},xr.random=function(t,e,r){if(r&&"boolean"!=typeof r&&oo(t,e,r)&&(e=r=void 0),void 0===r&&("boolean"==typeof e?(r=e,e=void 0):"boolean"==typeof t&&(r=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=ta(t),void 0===e?(e=t,t=0):e=ta(e)),t>e){var n=t;t=e,e=n}if(r||t%1||e%1){var i=ur();return or(t+i*(e-t+jt("1e-"+((i+"").length-1))),e)}return On(t,e)},xr.reduce=function(t,e,r){var n=Rs(t)?le:Ee,i=arguments.length<3;return n(t,$i(e,4),r,i,Zr)},xr.reduceRight=function(t,e,r){var n=Rs(t)?he:Ee,i=arguments.length<3;return n(t,$i(e,4),r,i,Qr)},xr.repeat=function(t,e,r){return e=(r?oo(t,e,r):void 0===e)?1:ea(e),Pn(oa(t),e)},xr.replace=function(){var t=arguments,e=oa(t[0]);return t.length<3?e:e.replace(t[1],t[2])},xr.result=function(t,e,r){var n=-1,i=(e=oi(e,t)).length;for(i||(i=1,t=void 0);++n<i;){var o=null==t?void 0:t[So(e[n])];void 0===o&&(n=i,o=r),t=Us(o)?o.call(t):o}return t},xr.round=fu,xr.runInContext=t,xr.sample=function(t){return(Rs(t)?Lr:Ln)(t)},xr.size=function(t){if(null==t)return 0;if(Ns(t))return $s(t)?Fe(t):t.length;var e=to(t);return e==d||e==b?t.size:En(t).length},xr.snakeCase=Oa,xr.some=function(t,e,r){var n=Rs(t)?de:Kn;return r&&oo(t,e,r)&&(e=void 0),n(t,$i(e,3))},xr.sortedIndex=function(t,e){return Gn(t,e)},xr.sortedIndexBy=function(t,e,r){return Wn(t,e,$i(r,2))},xr.sortedIndexOf=function(t,e){var r=null==t?0:t.length;if(r){var n=Gn(t,e);if(n<r&&ks(t[n],e))return n}return-1},xr.sortedLastIndex=function(t,e){return Gn(t,e,!0)},xr.sortedLastIndexBy=function(t,e,r){return Wn(t,e,$i(r,2),!0)},xr.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var r=Gn(t,e,!0)-1;if(ks(t[r],e))return r}return-1},xr.startCase=Pa,xr.startsWith=function(t,e,r){return t=oa(t),r=null==r?0:Vr(ea(r),0,t.length),e=Xn(e),t.slice(r,r+e.length)==e},xr.subtract=lu,xr.sum=function(t){return t&&t.length?Se(t,Ka):0},xr.sumBy=function(t,e){return t&&t.length?Se(t,$i(e,2)):0},xr.template=function(t,e,r){var n=xr.templateSettings;r&&oo(t,e,r)&&(e=void 0),t=oa(t),e=ua({},e,n,Ui);var i,o,s=ua({},e.imports,n.imports,Ui),a=ya(s),u=ke(s,a),c=0,f=e.interpolate||ut,l="__p += '",h=gt((e.escape||ut).source+"|"+f.source+"|"+(f===F?tt:ut).source+"|"+(e.evaluate||ut).source+"|$","g"),d="//# sourceURL="+(St.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pt+"]")+"\n";t.replace(h,(function(e,r,n,s,a,u){return n||(n=s),l+=t.slice(c,u).replace(ct,Oe),r&&(i=!0,l+="' +\n__e("+r+") +\n'"),a&&(o=!0,l+="';\n"+a+";\n__p += '"),n&&(l+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),l+="';\n";var p=St.call(e,"variable")&&e.variable;p||(l="with (obj) {\n"+l+"\n}\n"),l=(o?l.replace(R,""):l).replace(B,"$1").replace(N,"$1;"),l="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var m=ja((function(){return dt(a,d+"return "+l).apply(void 0,u)}));if(m.source=l,Ls(m))throw m;return m},xr.times=function(t,e){if((t=ea(t))<1||t>9007199254740991)return[];var r=4294967295,n=or(t,4294967295);t-=4294967295;for(var i=Me(n,e=$i(e));++r<t;)e(r);return i},xr.toFinite=ta,xr.toInteger=ea,xr.toLength=ra,xr.toLower=function(t){return oa(t).toLowerCase()},xr.toNumber=na,xr.toSafeInteger=function(t){return t?Vr(ea(t),-9007199254740991,9007199254740991):0===t?t:0},xr.toString=oa,xr.toUpper=function(t){return oa(t).toUpperCase()},xr.trim=function(t,e,r){if((t=oa(t))&&(r||void 0===e))return t.replace(W,"");if(!t||!(e=Xn(e)))return t;var n=qe(t),i=qe(e);return ai(n,Ie(n,i),Ce(n,i)+1).join("")},xr.trimEnd=function(t,e,r){if((t=oa(t))&&(r||void 0===e))return t.replace($,"");if(!t||!(e=Xn(e)))return t;var n=qe(t);return ai(n,0,Ce(n,qe(e))+1).join("")},xr.trimStart=function(t,e,r){if((t=oa(t))&&(r||void 0===e))return t.replace(V,"");if(!t||!(e=Xn(e)))return t;var n=qe(t);return ai(n,Ie(n,qe(e))).join("")},xr.truncate=function(t,e){var r=30,n="...";if(qs(e)){var i="separator"in e?e.separator:i;r="length"in e?ea(e.length):r,n="omission"in e?Xn(e.omission):n}var o=(t=oa(t)).length;if(Pe(t)){var s=qe(t);o=s.length}if(r>=o)return t;var a=r-Fe(n);if(a<1)return n;var u=s?ai(s,0,a).join(""):t.slice(0,a);if(void 0===i)return u+n;if(s&&(a+=u.length-a),Ws(i)){if(t.slice(a).search(i)){var c,f=u;for(i.global||(i=gt(i.source,oa(et.exec(i))+"g")),i.lastIndex=0;c=i.exec(f);)var l=c.index;u=u.slice(0,void 0===l?a:l)}}else if(t.indexOf(Xn(i),a)!=a){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+n},xr.unescape=function(t){return(t=oa(t))&&D.test(t)?t.replace(O,ze):t},xr.uniqueId=function(t){var e=++Mt;return oa(t)+e},xr.upperCase=Da,xr.upperFirst=La,xr.each=os,xr.eachRight=ss,xr.first=No,$a(xr,(iu={},an(xr,(function(t,e){St.call(xr.prototype,e)||(iu[e]=t)})),iu),{chain:!1}),xr.VERSION="4.17.20",ne(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){xr[t].placeholder=xr})),ne(["drop","take"],(function(t,e){Cr.prototype[t]=function(r){r=void 0===r?1:ir(ea(r),0);var n=this.__filtered__&&!e?new Cr(this):this.clone();return n.__filtered__?n.__takeCount__=or(r,n.__takeCount__):n.__views__.push({size:or(r,4294967295),type:t+(n.__dir__<0?"Right":"")}),n},Cr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ne(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Cr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:$i(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ne(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Cr.prototype[t]=function(){return this[r](1).value()[0]}})),ne(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Cr.prototype[t]=function(){return this.__filtered__?new Cr(this):this[r](1)}})),Cr.prototype.compact=function(){return this.filter(Ka)},Cr.prototype.find=function(t){return this.filter(t).head()},Cr.prototype.findLast=function(t){return this.reverse().find(t)},Cr.prototype.invokeMap=Dn((function(t,e){return"function"==typeof t?new Cr(this):this.map((function(r){return bn(r,t,e)}))})),Cr.prototype.reject=function(t){return this.filter(As($i(t)))},Cr.prototype.slice=function(t,e){t=ea(t);var r=this;return r.__filtered__&&(t>0||e<0)?new Cr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),void 0!==e&&(r=(e=ea(e))<0?r.dropRight(-e):r.take(e-t)),r)},Cr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Cr.prototype.toArray=function(){return this.take(4294967295)},an(Cr.prototype,(function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),i=xr[n?"take"+("last"==e?"Right":""):e],o=n||/^find/.test(e);i&&(xr.prototype[e]=function(){var e=this.__wrapped__,s=n?[1]:arguments,a=e instanceof Cr,u=s[0],c=a||Rs(e),f=function(t){var e=i.apply(xr,fe([t],s));return n&&l?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(a=c=!1);var l=this.__chain__,h=!!this.__actions__.length,d=o&&!l,p=a&&!h;if(!o&&c){e=p?e:new Cr(this);var m=t.apply(e,s);return m.__actions__.push({func:ts,args:[f],thisArg:void 0}),new Ir(m,l)}return d&&p?t.apply(this,s):(m=this.thru(f),d?n?m.value()[0]:m.value():m)})})),ne(["pop","push","shift","sort","splice","unshift"],(function(t){var e=vt[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);xr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Rs(i)?i:[],t)}return this[r]((function(r){return e.apply(Rs(r)?r:[],t)}))}})),an(Cr.prototype,(function(t,e){var r=xr[e];if(r){var n=r.name+"";St.call(br,n)||(br[n]=[]),br[n].push({name:e,func:r})}})),br[xi(void 0,2).name]=[{name:"wrapper",func:void 0}],Cr.prototype.clone=function(){var t=new Cr(this.__wrapped__);return t.__actions__=mi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=mi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=mi(this.__views__),t},Cr.prototype.reverse=function(){if(this.__filtered__){var t=new Cr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Cr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Rs(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=or(e,t+s);break;case"takeRight":t=ir(t,e-s)}}return{start:t,end:e}}(0,i,this.__views__),s=o.start,a=o.end,u=a-s,c=n?a:s-1,f=this.__iteratees__,l=f.length,h=0,d=or(u,this.__takeCount__);if(!r||!n&&i==u&&d==u)return ti(t,this.__actions__);var p=[];t:for(;u--&&h<d;){for(var m=-1,g=t[c+=e];++m<l;){var b=f[m],y=b.iteratee,v=b.type,w=y(g);if(2==v)g=w;else if(!w){if(1==v)continue t;break t}}p[h++]=g}return p},xr.prototype.at=es,xr.prototype.chain=function(){return Qo(this)},xr.prototype.commit=function(){return new Ir(this.value(),this.__chain__)},xr.prototype.next=function(){void 0===this.__values__&&(this.__values__=Qs(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},xr.prototype.plant=function(t){for(var e,r=this;r instanceof Tr;){var n=xo(r);n.__index__=0,n.__values__=void 0,e?i.__wrapped__=n:e=n;var i=n;r=r.__wrapped__}return i.__wrapped__=t,e},xr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Cr){var e=t;return this.__actions__.length&&(e=new Cr(this)),(e=e.reverse()).__actions__.push({func:ts,args:[qo],thisArg:void 0}),new Ir(e,this.__chain__)}return this.thru(qo)},xr.prototype.toJSON=xr.prototype.valueOf=xr.prototype.value=function(){return ti(this.__wrapped__,this.__actions__)},xr.prototype.first=xr.prototype.head,Ge&&(xr.prototype[Ge]=function(){return this}),xr}();Gt?((Gt.exports=He)._=He,Kt._=He):Ht._=He}).call(this)}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],150:[function(t,e,r){"use strict";var n=t("inherits"),i=t("hash-base"),o=t("safe-buffer").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<<e|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 f(t,e,r,n,i,o,s){return u(t+(e&n|r&~n)+i+o|0,s)+e|0}function l(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=f(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=l(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,r,n,i,t[8],2272392833,11),i=l(i,o,r,n,t[11],1839030562,16),n=l(n,i,o,r,t[14],4259657740,23),r=l(r,n,i,o,t[1],2763975236,4),o=l(o,r,n,i,t[4],1272893353,11),i=l(i,o,r,n,t[7],4139469664,16),n=l(n,i,o,r,t[10],3200236656,23),r=l(r,n,i,o,t[13],681279174,4),o=l(o,r,n,i,t[0],3936430074,11),i=l(i,o,r,n,t[3],3572445317,16),n=l(n,i,o,r,t[6],76029189,23),r=l(r,n,i,o,t[9],3654602809,4),o=l(o,r,n,i,t[12],3873151461,11),i=l(i,o,r,n,t[15],530742520,16),r=h(r,n=l(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},e.exports=a},{"hash-base":124,inherits:139,"safe-buffer":192}],151:[function(t,e,r){var n=t("bn.js"),i=t("brorand");function o(t){this.rand=t||new i.Rand}e.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var c=t.shrn(u),f=a.toRed(o);e>0;e--){var l=this._randrange(new n(2),a);r&&r(l);var h=l.toRed(o).redPow(c);if(0!==h.cmp(s)&&0!==h.cmp(f)){for(var d=1;d<u;d++){if(0===(h=h.redSqr()).cmp(s))return!1;if(0===h.cmp(f))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),c=s.toRed(i);e>0;e--){var f=this._randrange(new n(2),s),l=t.gcd(f);if(0!==l.cmpn(1))return l;var h=f.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var d=1;d<a;d++){if(0===(h=h.redSqr()).cmp(o))return h.fromRed().subn(1).gcd(t);if(0===h.cmp(c))break}if(d===a)return(h=h.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},{"bn.js":52,brorand:53}],152:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}e.exports=n,n.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],153:[function(t,e,r){"use strict";var n=r;function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],154:[function(t,e,r){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],155:[function(t,e,r){"use strict";var n=t("asn1.js");r.certificate=t("./certificate");var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));r.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));r.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));r.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));r.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));r.EncryptedPrivateKey=c;var f=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));r.DSAPrivateKey=f,r.DSAparam=n.define("DSAparam",(function(){this.int()}));var l=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));r.ECPrivateKey=l;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));r.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},{"./certificate":156,"asn1.js":35}],156:[function(t,e,r){"use strict";var n=t("asn1.js"),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),f=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),l=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(f),this.key("validity").use(l),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));e.exports=p},{"asn1.js":35}],157:[function(t,e,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=t("evp_bytestokey"),a=t("browserify-aes"),u=t("safe-buffer").Buffer;e.exports=function(t,e){var r,c=t.toString(),f=c.match(n);if(f){var l="aes"+f[1],h=u.from(f[2],"hex"),d=u.from(f[3].replace(/[\r\n]/g,""),"base64"),p=s(e,h.slice(0,8),parseInt(f[1],10)).key,m=[],g=a.createDecipheriv(l,p,h);m.push(g.update(d)),m.push(g.final()),r=u.concat(m)}else{var b=c.match(o);r=u.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},{"browserify-aes":57,evp_bytestokey:122,"safe-buffer":192}],158:[function(t,e,r){var n=t("./asn1"),i=t("./aesid.json"),o=t("./fixProc"),s=t("browserify-aes"),a=t("pbkdf2"),u=t("safe-buffer").Buffer;function c(t){var e;"object"!=typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=u.from(t));var r,c,f=o(t,e),l=f.tag,h=f.data;switch(l){case"CERTIFICATE":c=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(h,"der")),r=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":h=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,h=a.pbkdf2Sync(e,r,n,l,"sha1"),d=s.createDecipheriv(o,h,c),p=[];return p.push(d.update(f)),p.push(d.final()),u.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),e);case"PRIVATE KEY":switch(r=(c=n.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=n.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+l)}}e.exports=c,c.signature=n.signature},{"./aesid.json":154,"./asn1":155,"./fixProc":157,"browserify-aes":57,pbkdf2:159,"safe-buffer":192}],159:[function(t,e,r){r.pbkdf2=t("./lib/async"),r.pbkdf2Sync=t("./lib/sync")},{"./lib/async":160,"./lib/sync":163}],160:[function(t,e,n){(function(r,n){(function(){var i,o=t("safe-buffer").Buffer,s=t("./precondition"),a=t("./default-encoding"),u=t("./sync"),c=t("./to-buffer"),f=n.crypto&&n.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}e.exports=function(t,e,p,m,g,b){"function"==typeof g&&(b=g,g=void 0);var y=l[(g=g||"sha1").toLowerCase()];if(!y||"function"!=typeof n.Promise)return r.nextTick((function(){var r;try{r=u(t,e,p,m,g)}catch(t){return b(t)}b(null,r)}));if(s(p,m),t=c(t,a,"Password"),e=c(e,a,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){r.nextTick((function(){e(null,t)}))}),(function(t){r.nextTick((function(){e(t)}))}))}(function(t){if(n.process&&!n.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=d(i=i||o.alloc(8),i,10,128,t).then((function(){return!0})).catch((function(){return!1}));return h[t]=e,e}(y).then((function(r){return r?d(t,e,p,m,y):u(t,e,p,m,g)})),b)}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":161,"./precondition":162,"./sync":163,"./to-buffer":164,_process:166,"safe-buffer":192}],161:[function(t,e,r){(function(t){(function(){var r;r=t.browser?"utf-8":t.version?parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=r}).call(this)}).call(this,t("_process"))},{_process:166}],162:[function(t,e,r){var n=Math.pow(2,30)-1;e.exports=function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>n||e!=e)throw new TypeError("Bad key length")}},{}],163:[function(t,e,r){var n=t("create-hash/md5"),i=t("ripemd160"),o=t("sha.js"),s=t("safe-buffer").Buffer,a=t("./precondition"),u=t("./default-encoding"),c=t("./to-buffer"),f=s.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,f],u));for(var c=s.allocUnsafe(u+l[t]),h=s.allocUnsafe(u+l[t]),d=0;d<u;d++)c[d]=54^e[d],h[d]=92^e[d];var p=s.allocUnsafe(u+r+4);c.copy(p,0,0,u),this.ipad1=p,this.ipad2=c,this.opad=h,this.alg=t,this.blocksize=u,this.hash=a,this.size=l[t]}h.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(t,e,r,n,i){a(r,n);var o=new h(i=i||"sha1",t=c(t,u,"Password"),(e=c(e,u,"Salt")).length),f=s.allocUnsafe(n),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,m=l[i],g=Math.ceil(n/m),b=1;b<=g;b++){d.writeUInt32BE(b,e.length);for(var y=o.run(d,o.ipad1),v=y,w=1;w<r;w++){v=o.run(v,o.ipad2);for(var _=0;_<m;_++)y[_]^=v[_]}y.copy(f,p),p+=m}return f}},{"./default-encoding":161,"./precondition":162,"./to-buffer":164,"create-hash/md5":90,ripemd160:191,"safe-buffer":192,"sha.js":202}],164:[function(t,e,r){var n=t("safe-buffer").Buffer;e.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},{"safe-buffer":192}],165:[function(t,e,r){(function(t){(function(){"use strict";void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this)}).call(this,t("_process"))},{_process:166}],166:[function(t,e,r){var n,i,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var c,f=[],l=!1,h=-1;function d(){l&&c&&(l=!1,c.length?f=c.concat(f):h=-1,f.length&&p())}function p(){if(!l){var t=u(d);l=!0;for(var e=f.length;e;){for(c=f,f=[];++h<e;)c&&c[h].run();h=-1,e=f.length}c=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new m(t,e)),1!==f.length||l||u(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],167:[function(t,e,r){r.publicEncrypt=t("./publicEncrypt"),r.privateDecrypt=t("./privateDecrypt"),r.privateEncrypt=function(t,e){return r.publicEncrypt(t,e,!0)},r.publicDecrypt=function(t,e){return r.privateDecrypt(t,e,!0)}},{"./privateDecrypt":169,"./publicEncrypt":170}],168:[function(t,e,r){var n=t("create-hash"),i=t("safe-buffer").Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}e.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},{"create-hash":89,"safe-buffer":192}],169:[function(t,e,r){var n=t("parse-asn1"),i=t("./mgf"),o=t("./xor"),s=t("bn.js"),a=t("browserify-rsa"),u=t("create-hash"),c=t("./withPublic"),f=t("safe-buffer").Buffer;e.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var h,d=n(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");h=r?c(new s(e),d):a(e,d);var m=f.alloc(p-h.length);if(h=f.concat([m,h],p),4===l)return function(t,e){var r=t.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),s=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),c=e.slice(s+1),l=o(a,i(c,s)),h=o(c,i(l,r-s-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));for(var i=-1;++i<n;)r+=t[i]^e[i];return r}(n,h.slice(0,s)))throw new Error("decryption error");for(var d=s;0===h[d];)d++;if(1!==h[d++])throw new Error("decryption error");return h.slice(d)}(d,h);if(1===l)return function(t,e,r){for(var n=e.slice(0,2),i=2,o=0;0!==e[i++];)if(i>=e.length){o++;break}var s=e.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++,s.length<8&&o++,o)throw new Error("decryption error");return e.slice(i)}(0,h,r);if(3===l)return h;throw new Error("unknown padding")}},{"./mgf":168,"./withPublic":171,"./xor":172,"bn.js":52,"browserify-rsa":75,"create-hash":89,"parse-asn1":158,"safe-buffer":192}],170:[function(t,e,r){var n=t("parse-asn1"),i=t("randombytes"),o=t("create-hash"),s=t("./mgf"),a=t("./xor"),u=t("bn.js"),c=t("./withPublic"),f=t("browserify-rsa"),l=t("safe-buffer").Buffer;e.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===h)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,c=o("sha1").update(l.alloc(0)).digest(),f=c.length,h=2*f;if(n>r-h-2)throw new Error("message too long");var d=l.alloc(r-n-h-2),p=r-f-1,m=i(f),g=a(l.concat([c,d,l.alloc(1,1),e],p),s(m,p)),b=a(m,s(g,f));return new u(l.concat([l.alloc(1),b,g],r))}(p,e);else if(1===h)d=function(t,e,r){var n,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");return n=r?l.alloc(s-o-3,255):function(t){for(var e,r=l.allocUnsafe(t),n=0,o=i(2*t),s=0;n<t;)s===o.length&&(o=i(2*t),s=0),(e=o[s++])&&(r[n++]=e);return r}(s-o-3),new u(l.concat([l.from([0,r?1:2]),n,l.alloc(1),e],s))}(p,e,r);else{if(3!==h)throw new Error("unknown padding");if((d=new u(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?f(d,p):c(d,p)}},{"./mgf":168,"./withPublic":171,"./xor":172,"bn.js":52,"browserify-rsa":75,"create-hash":89,"parse-asn1":158,randombytes:173,"safe-buffer":192}],171:[function(t,e,r){var n=t("bn.js"),i=t("safe-buffer").Buffer;e.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},{"bn.js":52,"safe-buffer":192}],172:[function(t,e,r){e.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},{}],173:[function(t,e,n){(function(r,n){(function(){"use strict";var i=t("safe-buffer").Buffer,o=n.crypto||n.msCrypto;o&&o.getRandomValues?e.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var n=i.allocUnsafe(t);if(t>0)if(t>65536)for(var s=0;s<t;s+=65536)o.getRandomValues(n.slice(s,s+65536));else o.getRandomValues(n);return"function"==typeof e?r.nextTick((function(){e(null,n)})):n}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:166,"safe-buffer":192}],174:[function(t,e,n){(function(e,r){(function(){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=t("safe-buffer"),s=t("randombytes"),a=o.Buffer,u=o.kMaxLength,c=r.crypto||r.msCrypto,f=Math.pow(2,32)-1;function l(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>f||t<0)throw new TypeError("offset must be a uint32");if(t>u||t>e)throw new RangeError("offset out of range")}function h(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>f||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>u)throw new RangeError("buffer too small")}function d(t,r,n,i){if(e.browser){var o=t.buffer,a=new Uint8Array(o,r,n);return c.getRandomValues(a),i?void e.nextTick((function(){i(null,t)})):t}if(!i)return s(n).copy(t,r),t;s(n,(function(e,n){if(e)return i(e);n.copy(t,r),i(null,t)}))}c&&c.getRandomValues||!e.browser?(n.randomFill=function(t,e,n,i){if(!(a.isBuffer(t)||t instanceof r.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(e,t.length),h(n,e,t.length),d(t,e,n,i)},n.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof r.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return l(e,t.length),void 0===n&&(n=t.length-e),h(n,e,t.length),d(t,e,n)}):(n.randomFill=i,n.randomFillSync=i)}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:166,randombytes:173,"safe-buffer":192}],175:[function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"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))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,r){var n,i,s;if("string"==typeof e&&(i="not ",e.substr(0,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="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"))s="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var a=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+".".length>t.length)&&-1!==t.indexOf(".",r)}(t)?"property":"argument";s='The "'.concat(t,'" ').concat(a," ").concat(n," ").concat(o(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],176:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var i=t("./_stream_readable"),o=t("./_stream_writable");t("inherits")(c,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(t){if(!(this instanceof c))return new c(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||r.nextTick(l,this)}function l(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,t("_process"))},{"./_stream_readable":178,"./_stream_writable":180,_process:166,inherits:139}],177:[function(t,e,r){"use strict";e.exports=i;var n=t("./_stream_transform");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}t("inherits")(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":179,inherits:139}],178:[function(t,e,n){(function(r,n){(function(){"use strict";var i;e.exports=M,M.ReadableState=S,t("events").EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=t("./internal/streams/stream"),u=t("buffer").Buffer,c=n.Uint8Array||function(){},f=t("util");o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,d,p=t("./internal/streams/buffer_list"),m=t("./internal/streams/destroy"),g=t("./internal/streams/state").getHighWaterMark,b=t("../errors").codes,y=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t("inherits")(M,a);var A=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(e,r,n){i=i||t("./_stream_duplex"),e=e||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=t("string_decoder/").StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function M(e){if(i=i||t("./_stream_duplex"),!(this instanceof M))return new M(e);var r=this instanceof i;this._readableState=new S(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function x(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?I(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,C(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)A(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?A(t,new _):k(t,a,e,!0);else if(a.ended)A(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?k(t,a,e,!1):R(t,a)):k(t,a,e,!1)}else n||(a.reading=!1,R(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function k(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&I(t)),R(t,e)}function T(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(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;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(C,t))}function C(t){var e=t._readableState;o("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,D(t)}function R(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(o("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function N(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function O(t){o("readable nexttick read 0"),t.read(0)}function P(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function L(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 U(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(j,e,t))}function j(t,e){if(o("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<n;r++)if(t[r]===e)return r;return-1}Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),M.prototype.destroy=m.destroy,M.prototype._undestroy=m.undestroy,M.prototype._destroy=function(t,e){e(t)},M.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=u.from(t,e),e=""),r=!0),x(this,t,e,!1,r)},M.prototype.unshift=function(t){return x(this,t,null,!0,!1)},M.prototype.isPaused=function(){return!1===this._readableState.flowing},M.prototype.setEncoding=function(e){l||(l=t("string_decoder/").StringDecoder);var r=new l(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},M.prototype.read=function(t){o("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):I(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&o("length less than watermark",i=!0),e.ended||e.reading?o("reading or ended",i=!1):i&&(o("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=T(r,e))),null===(n=t>0?L(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&&U(this)),null!==n&&this.emit("data",n),n},M.prototype._read=function(t){A(this,new w("_read()"))},M.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,e);var a=e&&!1===e.end||t===r.stdout||t===r.stderr?m:u;function u(){o("onend"),t.end()}i.endEmitted?r.nextTick(a):n.once("end",a),t.on("unpipe",(function e(r,s){o("onunpipe"),r===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),n.removeListener("end",u),n.removeListener("end",m),n.removeListener("data",l),f=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,D(t))}}(n);t.on("drain",c);var f=!1;function l(e){o("ondata");var r=t.write(e);o("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==F(i.pipes,t))&&!f&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(e){o("onerror",e),m(),t.removeListener("error",h),0===s(t,"error")&&A(t,e)}function d(){t.removeListener("finish",p),m()}function p(){o("onfinish"),t.removeListener("close",d),m()}function m(){o("unpipe"),n.unpipe(t)}return n.on("data",l),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",n),i.flowing||(o("pipe resume"),n.resume()),t},M.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;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},M.prototype.on=function(t,e){var n=a.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?I(this):i.reading||r.nextTick(O,this))),n},M.prototype.addListener=M.prototype.on,M.prototype.removeListener=function(t,e){var n=a.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(N,this),n},M.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(N,this),e},M.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(P,t,e))}(this,t)),t.paused=!1,this},M.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},M.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("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){o("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 s=0;s<E.length;s++)t.on(E[s],this.emit.bind(this,E[s]));return this._read=function(e){o("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(M.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=t("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(M.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(M.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(M.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),M._fromList=L,Object.defineProperty(M.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(M.from=function(e,r){return void 0===d&&(d=t("./internal/streams/from")),d(M,e,r)})}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":175,"./_stream_duplex":176,"./internal/streams/async_iterator":181,"./internal/streams/buffer_list":182,"./internal/streams/destroy":183,"./internal/streams/from":185,"./internal/streams/state":187,"./internal/streams/stream":188,_process:166,buffer:84,events:121,inherits:139,"string_decoder/":225,util:54}],179:[function(t,e,r){"use strict";e.exports=f;var n=t("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=t("./_stream_duplex");function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);u.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",l)}function l(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(e,r){h(t,e,r)}))}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}t("inherits")(f,u),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new i("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},{"../errors":175,"./_stream_duplex":176,inherits:139}],180:[function(t,e,n){(function(r,n){(function(){"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var o;e.exports=M,M.WritableState=S;var s,a={deprecate:t("util-deprecate")},u=t("./internal/streams/stream"),c=t("buffer").Buffer,f=n.Uint8Array||function(){},l=t("./internal/streams/destroy"),h=t("./internal/streams/state").getHighWaterMark,d=t("../errors").codes,p=d.ERR_INVALID_ARG_TYPE,m=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,v=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,_=d.ERR_UNKNOWN_ENCODING,A=l.errorOrDestroy;function E(){}function S(e,n,s){o=o||t("./_stream_duplex"),e=e||{},"boolean"!=typeof s&&(s=n instanceof o),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,o){--e.pendingcb,n?(r.nextTick(o,i),r.nextTick(R,t,e),t._writableState.errorEmitted=!0,A(t,i)):(o(i),t._writableState.errorEmitted=!0,A(t,i),R(t,e))}(t,n,i,e,o);else{var s=I(n)||t.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||T(t,n),i?r.nextTick(k,t,n,s,o):k(t,n,s,o)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function M(e){var r=this instanceof(o=o||t("./_stream_duplex"));if(!r&&!s.call(M,this))return new M(e);this._writableState=new S(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function x(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),R(t,e)}function T(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,x(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(x(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function C(t,e){t._final((function(r){e.pendingcb--,r&&A(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)}))}function R(t,e){var n=I(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(C,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}t("inherits")(M,u),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===M&&t&&t._writableState instanceof S}})):s=function(t){return t instanceof this},M.prototype.pipe=function(){A(this,new b)},M.prototype.write=function(t,e,n){var i,o=this._writableState,s=!1,a=!o.objectMode&&(i=t,c.isBuffer(i)||i instanceof f);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof n&&(n=E),o.ending?function(t,e){var n=new w;A(t,n),r.nextTick(e,n)}(this,n):(a||function(t,e,n,i){var o;return null===n?o=new v:"string"==typeof n||e.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(A(t,o),r.nextTick(i,o),!1)}(this,o,t,n))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else x(t,e,!1,a,n,i,o);return u}(this,o,a,t,e,n)),s},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||T(this,t))},M.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),M.prototype._write=function(t,e,r){r(new m("_write()"))},M.prototype._writev=null,M.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,R(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n)),e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(M.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(M.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),M.prototype.destroy=l.destroy,M.prototype._undestroy=l.undestroy,M.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":175,"./_stream_duplex":176,"./internal/streams/destroy":183,"./internal/streams/state":187,"./internal/streams/stream":188,_process:166,buffer:84,inherits:139,"util-deprecate":233}],181:[function(t,e,r){(function(r){(function(){"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=t("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),l=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[f]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function m(t){r.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),b=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,n){r.nextTick((function(){t[u]?n(t[u]):e(d(void 0,!0))}))}));var n,i=this[f];if(i)n=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(d(void 0,!0)):e[l](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(d(o,!1));n=new Promise(this[l])}return this[f]=n,n}},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);e.exports=function(t){var e,r=Object.create(b,(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,l,{value:function(t,e){var n=r[h].read();n?(r[f]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[f]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[f]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":184,_process:166}],182:[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;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=t("buffer").Buffer,a=t("util").inspect,u=a&&a.custom||"inspect";e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?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 t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.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;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}])&&o(e.prototype,r),t}()},{buffer:84,util:54}],183:[function(t,e,r){(function(t){(function(){"use strict";function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}e.exports={destroy:function(e,o){var s=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!o&&e?s._writableState?s._writableState.errorEmitted?t.nextTick(n,s):(s._writableState.errorEmitted=!0,t.nextTick(r,s,e)):t.nextTick(r,s,e):o?(t.nextTick(n,s),o(e)):t.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,t("_process"))},{_process:166}],184:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||f()},c=e._writableState&&e._writableState.finished,f=function(){a=!1,c=!0,s||o.call(e)},l=e._readableState&&e._readableState.endEmitted,h=function(){s=!1,l=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!l?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!c?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},m=function(){e.req.on("finish",f)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",f),e.on("abort",p),e.req?m():e.on("request",m)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",h),e.on("finish",f),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",f),e.removeListener("abort",p),e.removeListener("request",m),e.req&&e.req.removeListener("finish",f),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("end",h),e.removeListener("error",d),e.removeListener("close",p)}}},{"../../../errors":175}],185:[function(t,e,r){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],186:[function(t,e,r){"use strict";var n,i=t("../../../errors").codes,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(e,r,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;e.on("close",(function(){a=!0})),void 0===n&&(n=t("./end-of-stream")),n(e,{readable:r,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(t){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}e.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=l(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},{"../../../errors":175,"./end-of-stream":184}],187:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.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}}},{"../../../errors":175}],188:[function(t,e,r){e.exports=t("events").EventEmitter},{events:121}],189:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),r.finished=t("./lib/internal/streams/end-of-stream.js"),r.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":176,"./lib/_stream_passthrough.js":177,"./lib/_stream_readable.js":178,"./lib/_stream_transform.js":179,"./lib/_stream_writable.js":180,"./lib/internal/streams/end-of-stream.js":184,"./lib/internal/streams/pipeline.js":186}],190:[function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function a(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),s=new E(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=w(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,s),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function l(){}function h(){}function d(){}var p={};p[i]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(S([])));g&&g!==e&&r.call(g,i)&&(p=g);var b=d.prototype=l.prototype=Object.create(p);function y(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function v(t,e){var n;this._invoke=function(i,o){function s(){return new e((function(n,s){!function n(i,o,s,a){var u=c(t[i],t,o);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(l).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}(i,o,n,s)}))}return n=n?n.then(s,s):s()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=c(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return h.prototype=b.constructor=d,d.constructor=h,h.displayName=a(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,a(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(v.prototype),v.prototype[o]=function(){return this},t.AsyncIterator=v,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new v(u(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},y(b),a(b,s,"Generator"),b[i]=function(){return this},b.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=S,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}("object"==typeof e?e.exports:{});try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},{}],191:[function(t,e,r){"use strict";var n=t("buffer").Buffer,i=t("inherits"),o=t("hash-base"),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],f=[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],l=[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<<e|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 b(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function y(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function v(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,A=0|this._c,E=0|this._d,S=0|this._e,M=0;M<80;M+=1){var x,k;M<16?(x=m(r,n,i,o,d,t[a[M]],l[0],c[M]),k=v(w,_,A,E,S,t[u[M]],h[0],f[M])):M<32?(x=g(r,n,i,o,d,t[a[M]],l[1],c[M]),k=y(w,_,A,E,S,t[u[M]],h[1],f[M])):M<48?(x=b(r,n,i,o,d,t[a[M]],l[2],c[M]),k=b(w,_,A,E,S,t[u[M]],h[2],f[M])):M<64?(x=y(r,n,i,o,d,t[a[M]],l[3],c[M]),k=g(w,_,A,E,S,t[u[M]],h[3],f[M])):(x=v(r,n,i,o,d,t[a[M]],l[4],c[M]),k=m(w,_,A,E,S,t[u[M]],h[4],f[M])),r=d,d=o,o=p(i,10),i=n,n=x,w=S,S=E,E=p(A,10),A=_,_=k}var T=this._b+i+E|0;this._b=this._c+o+S|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+A|0,this._a=T},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},e.exports=d},{buffer:84,"hash-base":124,inherits:139}],192:[function(t,e,r){var n=t("buffer"),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?e.exports=n:(o(n,r),r.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)}},{buffer:84}],193:[function(t,e,r){(function(r){(function(){"use strict";var n,i=t("buffer"),o=i.Buffer,s={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=i[n]);var a=s.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=o[n]);if(s.Buffer.prototype=o.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=o(t);return e&&0!==e.length?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),e.exports=s}).call(this)}).call(this,t("_process"))},{_process:166,buffer:84}],194:[function(t,e,r){(function(t){(function(){"use strict";!function(n){function i(t){const e=new Uint32Array([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]);let r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,u=528734635,c=1541459225;const f=new Uint32Array(64);function l(t){let l=0,h=t.length;for(;h>=64;){let d,p,m,g,b,y=r,v=n,w=i,_=o,A=s,E=a,S=u,M=c;for(p=0;p<16;p++)m=l+4*p,f[p]=(255&t[m])<<24|(255&t[m+1])<<16|(255&t[m+2])<<8|255&t[m+3];for(p=16;p<64;p++)d=f[p-2],g=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=f[p-15],b=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,f[p]=(g+f[p-7]|0)+(b+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&E^~A&S)|0)+(M+(e[p]+f[p]|0)|0)|0,b=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&v^y&w^v&w)|0,M=S,S=E,E=A,A=_+g|0,_=w,w=v,v=y,y=g+b|0;r=r+y|0,n=n+v|0,i=i+w|0,o=o+_|0,s=s+A|0,a=a+E|0,u=u+S|0,c=c+M|0,l+=64,h-=64}}l(t);let h,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,g=d<56?56:120,b=t.slice(t.length-d,t.length);for(b.push(128),h=d+1;h<g;h++)b.push(0);return b.push(p>>>24&255),b.push(p>>>16&255),b.push(p>>>8&255),b.push(p>>>0&255),b.push(m>>>24&255),b.push(m>>>16&255),b.push(m>>>8&255),b.push(m>>>0&255),l(b),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function o(t,e,r){t=t.length<=64?t:i(t);const n=64+e.length+4,o=new Array(n),s=new Array(64);let a,u=[];for(a=0;a<64;a++)o[a]=54;for(a=0;a<t.length;a++)o[a]^=t[a];for(a=0;a<e.length;a++)o[64+a]=e[a];for(a=n-4;a<n;a++)o[a]=0;for(a=0;a<64;a++)s[a]=92;for(a=0;a<t.length;a++)s[a]^=t[a];function c(){for(let t=n-1;t>=n-4;t--){if(o[t]++,o[t]<=255)return;o[t]=0}}for(;r>=32;)c(),u=u.concat(i(s.concat(i(o)))),r-=32;return r>0&&(c(),u=u.concat(i(s.concat(i(o))).slice(0,r))),u}function s(t,e,r,n,i){let o;for(f(t,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(t,16*o,i,16),u(i,n),f(i,0,t,e+16*o,16);for(o=0;o<r;o++)f(t,e+2*o*16,t,16*o,16);for(o=0;o<r;o++)f(t,e+16*(2*o+1),t,16*(o+r),16)}function a(t,e){return t<<e|t>>>32-e}function u(t,e){f(t,0,e,0,16);for(let t=8;t>0;t-=2)e[4]^=a(e[0]+e[12],7),e[8]^=a(e[4]+e[0],9),e[12]^=a(e[8]+e[4],13),e[0]^=a(e[12]+e[8],18),e[9]^=a(e[5]+e[1],7),e[13]^=a(e[9]+e[5],9),e[1]^=a(e[13]+e[9],13),e[5]^=a(e[1]+e[13],18),e[14]^=a(e[10]+e[6],7),e[2]^=a(e[14]+e[10],9),e[6]^=a(e[2]+e[14],13),e[10]^=a(e[6]+e[2],18),e[3]^=a(e[15]+e[11],7),e[7]^=a(e[3]+e[15],9),e[11]^=a(e[7]+e[3],13),e[15]^=a(e[11]+e[7],18),e[1]^=a(e[0]+e[3],7),e[2]^=a(e[1]+e[0],9),e[3]^=a(e[2]+e[1],13),e[0]^=a(e[3]+e[2],18),e[6]^=a(e[5]+e[4],7),e[7]^=a(e[6]+e[5],9),e[4]^=a(e[7]+e[6],13),e[5]^=a(e[4]+e[7],18),e[11]^=a(e[10]+e[9],7),e[8]^=a(e[11]+e[10],9),e[9]^=a(e[8]+e[11],13),e[10]^=a(e[9]+e[8],18),e[12]^=a(e[15]+e[14],7),e[13]^=a(e[12]+e[15],9),e[14]^=a(e[13]+e[12],13),e[15]^=a(e[14]+e[13],18);for(let r=0;r<16;++r)t[r]+=e[r]}function c(t,e,r,n){for(let i=0;i<n;i++)r[i]^=t[e+i]}function f(t,e,r,n,i){for(;i--;)r[n++]=t[e++]}function l(t){if(!t||"number"!=typeof t.length)return!1;for(let e=0;e<t.length;e++){const r=t[e];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function h(t,e){if("number"!=typeof t||t%1)throw new Error("invalid "+e);return t}function d(e,r,n,i,a,u,d){if(n=h(n,"N"),i=h(i,"r"),a=h(a,"p"),u=h(u,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>2147483647/128/i)throw new Error("N too large");if(i>2147483647/128/a)throw new Error("r too large");if(!l(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!l(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);let p=o(e,r,128*a*i);const m=new Uint32Array(32*a*i);for(let t=0;t<m.length;t++){const e=4*t;m[t]=(255&p[e+3])<<24|(255&p[e+2])<<16|(255&p[e+1])<<8|(255&p[e+0])<<0}const g=new Uint32Array(64*i),b=new Uint32Array(32*i*n),y=32*i,v=new Uint32Array(16),w=new Uint32Array(16),_=a*n*2;let A,E,S=0,M=null,x=!1,k=0,T=0;const I=d?parseInt(1e3/i):4294967295,C=void 0!==t?t:setTimeout,R=function(){if(x)return d(new Error("cancelled"),S/_);let t;switch(k){case 0:E=32*T*i,f(m,E,g,0,y),k=1,A=0;case 1:t=n-A,t>I&&(t=I);for(let e=0;e<t;e++)f(g,0,b,(A+e)*y,y),s(g,y,i,v,w);if(A+=t,S+=t,d){const t=parseInt(1e3*S/_);if(t!==M){if(x=d(null,S/_),x)break;M=t}}if(A<n)break;A=0,k=2;case 2:t=n-A,t>I&&(t=I);for(let e=0;e<t;e++){const t=g[16*(2*i-1)]&n-1;c(b,t*y,g,y),s(g,y,i,v,w)}if(A+=t,S+=t,d){const t=parseInt(1e3*S/_);if(t!==M){if(x=d(null,S/_),x)break;M=t}}if(A<n)break;if(f(g,0,m,E,y),T++,T<a){k=0;break}p=[];for(let t=0;t<m.length;t++)p.push(m[t]>>0&255),p.push(m[t]>>8&255),p.push(m[t]>>16&255),p.push(m[t]>>24&255);const r=o(e,p,u);return d&&d(null,1,r),r}d&&C(R)};if(!d)for(;;){const t=R();if(null!=t)return t}R()}const p={scrypt:function(t,e,r,n,i,o,s){return new Promise((function(a,u){let c=0;s&&s(0),d(t,e,r,n,i,o,(function(t,e,r){if(t)u(t);else if(r)s&&1!==c&&s(1),a(new Uint8Array(r));else if(s&&e!==c)return c=e,s(e)}))}))},syncScrypt:function(t,e,r,n,i,o){return new Uint8Array(d(t,e,r,n,i,o))}};void 0!==r?e.exports=p:n&&(n.scrypt&&(n._scrypt=n.scrypt),n.scrypt=p)}(this)}).call(this)}).call(this,t("timers").setImmediate)},{timers:232}],195:[function(t,e,r){"use strict";e.exports=t("./lib")(t("./lib/elliptic"))},{"./lib":199,"./lib/elliptic":198}],196:[function(t,e,r){(function(t){(function(){"use strict";var e=Object.prototype.toString;r.isArray=function(t,e){if(!Array.isArray(t))throw TypeError(e)},r.isBoolean=function(t,r){if("[object Boolean]"!==e.call(t))throw TypeError(r)},r.isBuffer=function(e,r){if(!t.isBuffer(e))throw TypeError(r)},r.isFunction=function(t,r){if("[object Function]"!==e.call(t))throw TypeError(r)},r.isNumber=function(t,r){if("[object Number]"!==e.call(t))throw TypeError(r)},r.isObject=function(t,r){if("[object Object]"!==e.call(t))throw TypeError(r)},r.isBufferLength=function(t,e,r){if(t.length!==e)throw RangeError(r)},r.isBufferLength2=function(t,e,r,n){if(t.length!==e&&t.length!==r)throw RangeError(n)},r.isLengthGTZero=function(t,e){if(0===t.length)throw RangeError(e)},r.isNumberInInterval=function(t,e,r,n){if(t<=e||t>=r)throw RangeError(n)}}).call(this)}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":140}],197:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("bip66"),o=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]),s=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]);r.privateKeyExport=function(t,e,r){var i=n.from(r?o:s);return t.copy(i,r?8:9),e.copy(i,r?181:214),i},r.privateKeyImport=function(t){var e=t.length,r=0;if(!(e<r+1||48!==t[r])&&!(e<(r+=1)+1)&&128&t[r]){var n=127&t[r];if(r+=1,!(n<1||n>2||e<r+n)){var i=t[r+n-1]|(n>1?t[r+n-2]<<8:0);if(!(e<(r+=n)+i||e<r+3||2!==t[r]||1!==t[r+1]||1!==t[r+2]||e<(r+=3)+2||4!==t[r]||t[r+1]>32||e<r+2+t[r+1]))return t.slice(r+2,r+2+t[r+1])}}},r.signatureExport=function(t){for(var e=n.concat([n.from([0]),t.r]),r=33,o=0;r>1&&0===e[o]&&!(128&e[o+1]);--r,++o);for(var s=n.concat([n.from([0]),t.s]),a=33,u=0;a>1&&0===s[u]&&!(128&s[u+1]);--a,++u);return i.encode(e.slice(o),s.slice(u))},r.signatureImport=function(t){var e=n.alloc(32,0),r=n.alloc(32,0);try{var o=i.decode(t);if(33===o.r.length&&0===o.r[0]&&(o.r=o.r.slice(1)),o.r.length>32)throw new Error("R length is too long");if(33===o.s.length&&0===o.s[0]&&(o.s=o.s.slice(1)),o.s.length>32)throw new Error("S length is too long")}catch(t){return}return o.r.copy(e,32-o.r.length),o.s.copy(r,32-o.s.length),{r:e,s:r}},r.signatureImportLax=function(t){var e=n.alloc(32,0),r=n.alloc(32,0),i=t.length,o=0;if(48===t[o++]){var s=t[o++];if(!(128&s&&(o+=s-128)>i)&&2===t[o++]){var a=t[o++];if(128&a){if(o+(s=a-128)>i)return;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)){var u=o;if(o+=a,2===t[o++]){var c=t[o++];if(128&c){if(o+(s=c-128)>i)return;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)){var f=o;for(o+=c;a>0&&0===t[u];a-=1,u+=1);if(!(a>32)){var l=t.slice(u,u+a);for(l.copy(e,32-l.length);c>0&&0===t[f];c-=1,f+=1);if(!(c>32)){var h=t.slice(f,f+c);return h.copy(r,32-h.length),{r:e,s:r}}}}}}}}}},{bip66:51,"safe-buffer":192}],198:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("create-hash"),o=t("bn.js"),s=t("elliptic").ec,a=t("../messages.json"),u=new s("secp256k1"),c=u.curve;function f(t){var e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){var r=new o(e);if(r.cmp(c.p)>=0)return null;var n=(r=r.toRed(c.red)).redSqr().redIMul(r).redIAdd(c.b).redSqrt();return 3===t!==n.isOdd()&&(n=n.redNeg()),u.keyPair({pub:{x:r,y:n}})}(e,t.slice(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){var n=new o(e),i=new o(r);if(n.cmp(c.p)>=0||i.cmp(c.p)>=0)return null;if(n=n.toRed(c.red),i=i.toRed(c.red),(6===t||7===t)&&i.isOdd()!==(7===t))return null;var s=n.redSqr().redIMul(n);return i.redSqr().redISub(s.redIAdd(c.b)).isZero()?u.keyPair({pub:{x:n,y:i}}):null}(e,t.slice(1,33),t.slice(33,65));default:return null}}r.privateKeyVerify=function(t){var e=new o(t);return e.cmp(c.n)<0&&!e.isZero()},r.privateKeyExport=function(t,e){var r=new o(t);if(r.cmp(c.n)>=0||r.isZero())throw new Error(a.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(u.keyFromPrivate(t).getPublic(e,!0))},r.privateKeyNegate=function(t){var e=new o(t);return e.isZero()?n.alloc(32):c.n.sub(e).umod(c.n).toArrayLike(n,"be",32)},r.privateKeyModInverse=function(t){var e=new o(t);if(e.cmp(c.n)>=0||e.isZero())throw new Error(a.EC_PRIVATE_KEY_RANGE_INVALID);return e.invm(c.n).toArrayLike(n,"be",32)},r.privateKeyTweakAdd=function(t,e){var r=new o(e);if(r.cmp(c.n)>=0)throw new Error(a.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new o(t)),r.cmp(c.n)>=0&&r.isub(c.n),r.isZero())throw new Error(a.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},r.privateKeyTweakMul=function(t,e){var r=new o(e);if(r.cmp(c.n)>=0||r.isZero())throw new Error(a.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new o(t)),r.cmp(c.n)&&(r=r.umod(c.n)),r.toArrayLike(n,"be",32)},r.publicKeyCreate=function(t,e){var r=new o(t);if(r.cmp(c.n)>=0||r.isZero())throw new Error(a.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(u.keyFromPrivate(t).getPublic(e,!0))},r.publicKeyConvert=function(t,e){var r=f(t);if(null===r)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(e,!0))},r.publicKeyVerify=function(t){return null!==f(t)},r.publicKeyTweakAdd=function(t,e,r){var i=f(t);if(null===i)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new o(e)).cmp(c.n)>=0)throw new Error(a.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var s=c.g.mul(e).add(i.pub);if(s.isInfinity())throw new Error(a.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(s.encode(!0,r))},r.publicKeyTweakMul=function(t,e,r){var i=f(t);if(null===i)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);if((e=new o(e)).cmp(c.n)>=0||e.isZero())throw new Error(a.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(i.pub.mul(e).encode(!0,r))},r.publicKeyCombine=function(t,e){for(var r=new Array(t.length),i=0;i<t.length;++i)if(r[i]=f(t[i]),null===r[i])throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);for(var o=r[0].pub,s=1;s<r.length;++s)o=o.add(r[s].pub);if(o.isInfinity())throw new Error(a.EC_PUBLIC_KEY_COMBINE_FAIL);return n.from(o.encode(!0,e))},r.signatureNormalize=function(t){var e=new o(t.slice(0,32)),r=new o(t.slice(32,64));if(e.cmp(c.n)>=0||r.cmp(c.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);var i=n.from(t);return 1===r.cmp(u.nh)&&c.n.sub(r).toArrayLike(n,"be",32).copy(i,32),i},r.signatureExport=function(t){var e=t.slice(0,32),r=t.slice(32,64);if(new o(e).cmp(c.n)>=0||new o(r).cmp(c.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);return{r:e,s:r}},r.signatureImport=function(t){var e=new o(t.r);e.cmp(c.n)>=0&&(e=new o(0));var r=new o(t.s);return r.cmp(c.n)>=0&&(r=new o(0)),n.concat([e.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},r.sign=function(t,e,r,i){if("function"==typeof r){var s=r;r=function(r){var u=s(t,e,null,i,r);if(!n.isBuffer(u)||32!==u.length)throw new Error(a.ECDSA_SIGN_FAIL);return new o(u)}}var f=new o(e);if(f.cmp(c.n)>=0||f.isZero())throw new Error(a.ECDSA_SIGN_FAIL);var l=u.sign(t,e,{canonical:!0,k:r,pers:i});return{signature:n.concat([l.r.toArrayLike(n,"be",32),l.s.toArrayLike(n,"be",32)]),recovery:l.recoveryParam}},r.verify=function(t,e,r){var n={r:e.slice(0,32),s:e.slice(32,64)},i=new o(n.r),s=new o(n.s);if(i.cmp(c.n)>=0||s.cmp(c.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);if(1===s.cmp(u.nh)||i.isZero()||s.isZero())return!1;var l=f(r);if(null===l)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);return u.verify(t,n,{x:l.pub.x,y:l.pub.y})},r.recover=function(t,e,r,i){var s={r:e.slice(0,32),s:e.slice(32,64)},f=new o(s.r),l=new o(s.s);if(f.cmp(c.n)>=0||l.cmp(c.n)>=0)throw new Error(a.ECDSA_SIGNATURE_PARSE_FAIL);try{if(f.isZero()||l.isZero())throw new Error;var h=u.recoverPubKey(t,s,r);return n.from(h.encode(!0,i))}catch(t){throw new Error(a.ECDSA_RECOVER_FAIL)}},r.ecdh=function(t,e){var n=r.ecdhUnsafe(t,e,!0);return i("sha256").update(n).digest()},r.ecdhUnsafe=function(t,e,r){var i=f(t);if(null===i)throw new Error(a.EC_PUBLIC_KEY_PARSE_FAIL);var s=new o(e);if(s.cmp(c.n)>=0||s.isZero())throw new Error(a.ECDH_FAIL);return n.from(i.pub.mul(s).encode(!0,r))}},{"../messages.json":200,"bn.js":52,"create-hash":89,elliptic:104,"safe-buffer":192}],199:[function(t,e,r){"use strict";var n=t("./assert"),i=t("./der"),o=t("./messages.json");function s(t,e){return void 0===t?e:(n.isBoolean(t,o.COMPRESSED_TYPE_INVALID),t)}e.exports=function(t){return{privateKeyVerify:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),32===e.length&&t.privateKeyVerify(e)},privateKeyExport:function(e,r){n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=s(r,!0);var a=t.privateKeyExport(e,r);return i.privateKeyExport(e,a,r)},privateKeyImport:function(e){if(n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),(e=i.privateKeyImport(e))&&32===e.length&&t.privateKeyVerify(e))return e;throw new Error(o.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.privateKeyNegate(e)},privateKeyModInverse:function(e){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.privateKeyModInverse(e)},privateKeyTweakAdd:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),t.privateKeyTweakAdd(e,r)},privateKeyTweakMul:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),t.privateKeyTweakMul(e,r)},publicKeyCreate:function(e,r){return n.isBuffer(e,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(e,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=s(r,!0),t.publicKeyCreate(e,r)},publicKeyConvert:function(e,r){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),r=s(r,!0),t.publicKeyConvert(e,r)},publicKeyVerify:function(e){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),t.publicKeyVerify(e)},publicKeyTweakAdd:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=s(i,!0),t.publicKeyTweakAdd(e,r,i)},publicKeyTweakMul:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=s(i,!0),t.publicKeyTweakMul(e,r,i)},publicKeyCombine:function(e,r){n.isArray(e,o.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(e,o.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i<e.length;++i)n.isBuffer(e[i],o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e[i],33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID);return r=s(r,!0),t.publicKeyCombine(e,r)},signatureNormalize:function(e){return n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(e,64,o.ECDSA_SIGNATURE_LENGTH_INVALID),t.signatureNormalize(e)},signatureExport:function(e){n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(e,64,o.ECDSA_SIGNATURE_LENGTH_INVALID);var r=t.signatureExport(e);return i.signatureExport(r)},signatureImport:function(e){n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(e,o.ECDSA_SIGNATURE_LENGTH_INVALID);var r=i.signatureImport(e);if(r)return t.signatureImport(r);throw new Error(o.ECDSA_SIGNATURE_PARSE_DER_FAIL)},signatureImportLax:function(e){n.isBuffer(e,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isLengthGTZero(e,o.ECDSA_SIGNATURE_LENGTH_INVALID);var r=i.signatureImportLax(e);if(r)return t.signatureImport(r);throw new Error(o.ECDSA_SIGNATURE_PARSE_DER_FAIL)},sign:function(e,r,i){n.isBuffer(e,o.MSG32_TYPE_INVALID),n.isBufferLength(e,32,o.MSG32_LENGTH_INVALID),n.isBuffer(r,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,o.EC_PRIVATE_KEY_LENGTH_INVALID);var s=null,a=null;return void 0!==i&&(n.isObject(i,o.OPTIONS_TYPE_INVALID),void 0!==i.data&&(n.isBuffer(i.data,o.OPTIONS_DATA_TYPE_INVALID),n.isBufferLength(i.data,32,o.OPTIONS_DATA_LENGTH_INVALID),s=i.data),void 0!==i.noncefn&&(n.isFunction(i.noncefn,o.OPTIONS_NONCEFN_TYPE_INVALID),a=i.noncefn)),t.sign(e,r,a,s)},verify:function(e,r,i){return n.isBuffer(e,o.MSG32_TYPE_INVALID),n.isBufferLength(e,32,o.MSG32_LENGTH_INVALID),n.isBuffer(r,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,o.ECDSA_SIGNATURE_LENGTH_INVALID),n.isBuffer(i,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(i,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),t.verify(e,r,i)},recover:function(e,r,i,a){return n.isBuffer(e,o.MSG32_TYPE_INVALID),n.isBufferLength(e,32,o.MSG32_LENGTH_INVALID),n.isBuffer(r,o.ECDSA_SIGNATURE_TYPE_INVALID),n.isBufferLength(r,64,o.ECDSA_SIGNATURE_LENGTH_INVALID),n.isNumber(i,o.RECOVERY_ID_TYPE_INVALID),n.isNumberInInterval(i,-1,4,o.RECOVERY_ID_VALUE_INVALID),a=s(a,!0),t.recover(e,r,i,a)},ecdh:function(e,r){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),t.ecdh(e,r)},ecdhUnsafe:function(e,r,i){return n.isBuffer(e,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(e,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(r,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),i=s(i,!0),t.ecdhUnsafe(e,r,i)}}}},{"./assert":196,"./der":197,"./messages.json":200}],200:[function(t,e,r){e.exports={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:"scalar was invalid (zero or overflow)",ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer",ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid",ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature",ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature",ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:"couldn't serialize signature to DER format",ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid",ECDSA_RECOVER_FAIL:"couldn't recover public key from signature",MSG32_TYPE_INVALID:"message should be a Buffer",MSG32_LENGTH_INVALID:"message length is invalid",OPTIONS_TYPE_INVALID:"options should be an Object",OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer",OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid",OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function",RECOVERY_ID_TYPE_INVALID:"recovery should be a Number",RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4",TWEAK_TYPE_INVALID:"tweak should be a Buffer",TWEAK_LENGTH_INVALID:"tweak length is invalid"}},{}],201:[function(t,e,r){var n=t("safe-buffer").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<o;){for(var u=s%i,c=Math.min(o-a,i-u),f=0;f<c;f++)r[u+f]=t[a+f];a+=c,(s+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=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")},e.exports=i},{"safe-buffer":192}],202:[function(t,e,r){(r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":203,"./sha1":204,"./sha224":205,"./sha256":206,"./sha384":207,"./sha512":208}],203:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").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 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,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var d=~~(h/20),p=0|((e=n)<<5|e>>>27)+f(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},e.exports=u},{"./hash":201,inherits:139,"safe-buffer":192}],204:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").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 f(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,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)+l(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=f(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},e.exports=u},{"./hash":201,inherits:139,"safe-buffer":192}],205:[function(t,e,r){var n=t("inherits"),i=t("./sha256"),o=t("./hash"),s=t("safe-buffer").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},e.exports=u},{"./hash":201,"./sha256":206,inherits:139,"safe-buffer":192}],206:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").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 f(t,e,r){return t&e|r&(t|e)}function l(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,b=0;b<16;++b)r[b]=t.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((e=r[b-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[b-7]+d(r[b-15])+r[b-16];for(var y=0;y<64;++y){var v=g+h(u)+c(u,p,m)+s[y]+r[y]|0,w=l(n)+f(n,i,o)|0;g=m,m=p,p=u,u=a+v|0,a=o,o=i,i=n,n=v+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},e.exports=u},{"./hash":201,inherits:139,"safe-buffer":192}],207:[function(t,e,r){var n=t("inherits"),i=t("./sha512"),o=t("./hash"),s=t("safe-buffer").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},e.exports=u},{"./hash":201,"./sha512":208,inherits:139,"safe-buffer":192}],208:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").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 f(t,e,r){return t&e|r&(t|e)}function l(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 b(t,e){return t>>>0<e>>>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,y=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,A=0|this._cl,E=0|this._dl,S=0|this._el,M=0|this._fl,x=0|this._gl,k=0|this._hl,T=0;T<32;T+=2)e[T]=t.readInt32BE(4*T),e[T+1]=t.readInt32BE(4*T+4);for(;T<160;T+=2){var I=e[T-30],C=e[T-30+1],R=d(I,C),B=p(C,I),N=m(I=e[T-4],C=e[T-4+1]),O=g(C,I),P=e[T-14],D=e[T-14+1],L=e[T-32],U=e[T-32+1],j=B+D|0,F=R+P+b(j,B)|0;F=(F=F+N+b(j=j+O|0,O)|0)+L+b(j=j+U|0,U)|0,e[T]=F,e[T+1]=j}for(var q=0;q<160;q+=2){F=e[q],j=e[q+1];var z=f(r,n,i),H=f(w,_,A),K=l(r,w),G=l(w,r),W=h(a,S),V=h(S,a),$=s[q],X=s[q+1],Y=c(a,u,y),J=c(S,M,x),Z=k+V|0,Q=v+W+b(Z,k)|0;Q=(Q=(Q=Q+Y+b(Z=Z+J|0,J)|0)+$+b(Z=Z+X|0,X)|0)+F+b(Z=Z+j|0,j)|0;var tt=G+H|0,et=K+z+b(tt,G)|0;v=y,k=x,y=u,x=M,u=a,M=S,a=o+Q+b(S=E+Z|0,E)|0,o=i,E=A,i=n,A=_,n=r,_=w,r=Q+et+b(w=Z+tt|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+A|0,this._dl=this._dl+E|0,this._el=this._el+S|0,this._fl=this._fl+M|0,this._gl=this._gl+x|0,this._hl=this._hl+k|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+n+b(this._bl,_)|0,this._ch=this._ch+i+b(this._cl,A)|0,this._dh=this._dh+o+b(this._dl,E)|0,this._eh=this._eh+a+b(this._el,S)|0,this._fh=this._fh+u+b(this._fl,M)|0,this._gh=this._gh+y+b(this._gl,x)|0,this._hh=this._hh+v+b(this._hl,k)|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},e.exports=u},{"./hash":201,inherits:139,"safe-buffer":192}],209:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/readable.js"),i.Writable=t("readable-stream/writable.js"),i.Duplex=t("readable-stream/duplex.js"),i.Transform=t("readable-stream/transform.js"),i.PassThrough=t("readable-stream/passthrough.js"),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(f(),0===n.listenerCount(this,"error"))throw t}function f(){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",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",c),t.on("error",c),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},{events:121,inherits:139,"readable-stream/duplex.js":210,"readable-stream/passthrough.js":219,"readable-stream/readable.js":220,"readable-stream/transform.js":221,"readable-stream/writable.js":222}],210:[function(t,e,r){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":211}],211:[function(t,e,r){"use strict";var n=t("process-nextick-args"),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=l;var o=Object.create(t("core-util-is"));o.inherits=t("inherits");var s=t("./_stream_readable"),a=t("./_stream_writable");o.inherits(l,s);for(var u=i(a.prototype),c=0;c<u.length;c++){var f=u[c];l.prototype[f]||(l.prototype[f]=a.prototype[f])}function l(t){if(!(this instanceof l))return new l(t);s.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},{"./_stream_readable":213,"./_stream_writable":215,"core-util-is":87,inherits:139,"process-nextick-args":165}],212:[function(t,e,r){"use strict";e.exports=o;var n=t("./_stream_transform"),i=Object.create(t("core-util-is"));function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}i.inherits=t("inherits"),i.inherits(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":214,"core-util-is":87,inherits:139}],213:[function(t,e,n){(function(r,n){(function(){"use strict";var i=t("process-nextick-args");e.exports=v;var o,s=t("isarray");v.ReadableState=y,t("events").EventEmitter;var a=function(t,e){return t.listeners(e).length},u=t("./internal/streams/stream"),c=t("safe-buffer").Buffer,f=n.Uint8Array||function(){},l=Object.create(t("core-util-is"));l.inherits=t("inherits");var h=t("util"),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,m=t("./internal/streams/BufferList"),g=t("./internal/streams/destroy");l.inherits(v,u);var b=["error","close","destroy","pause","resume"];function y(e,r){e=e||{};var n=r instanceof(o=o||t("./_stream_duplex"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,s=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=t("string_decoder/").StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||t("./_stream_duplex"),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(t,e,r,n,i){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,E(t)}}(t,s)):(i||(o=function(t,e){var r,n;return n=e,c.isBuffer(n)||n instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?_(t,s,e,!1):M(t,s)):_(t,s,e,!1))):n||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function _(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&E(t)),M(t,e)}function A(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(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 E(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(S,t):S(t))}function S(t){d("emit readable"),t.emit("readable"),I(t)}function M(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(x,t,e))}function x(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(d("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function k(t){d("readable nexttick read 0"),t.read(0)}function T(t,e){e.reading||(d("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),I(t),e.flowing&&!e.reading&&t.read(0)}function I(t){var e=t._readableState;for(d("flow",e.flowing);e.flowing&&null!==t.read(););}function C(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.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;return t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;for(t-=i.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0==(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),0==(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e),n}(t,e.buffer,e.decoder),r);var r}function R(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function N(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(t,e){this.push(null),e(t)},v.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=c.from(t,e),e=""),r=!0),w(this,t,e,!1,r)},v.prototype.unshift=function(t){return w(this,t,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=t("string_decoder/").StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this},v.prototype.read=function(t){d("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?R(this):E(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&R(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&d("length less than watermark",i=!0),e.ended||e.reading?d("reading or ended",i=!1):i&&(d("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=A(r,e))),null===(n=t>0?C(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&R(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=e&&!1===e.end||t===r.stdout||t===r.stderr?y:c;function c(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",(function e(r,i){d("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),t.removeListener("close",g),t.removeListener("finish",b),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",e),n.removeListener("end",c),n.removeListener("end",y),n.removeListener("data",p),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}));var f=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,I(t))}}(n);t.on("drain",f);var l=!1,h=!1;function p(e){d("ondata"),h=!1,!1!==t.write(e)||h||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==N(o.pipes,t))&&!l&&(d("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function m(e){d("onerror",e),y(),t.removeListener("error",m),0===a(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",b),y()}function b(){d("onfinish"),t.removeListener("close",g),y()}function y(){d("unpipe"),n.unpipe(t)}return n.on("data",p),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",g),t.once("finish",b),t.emit("pipe",n),o.flowing||(d("pipe resume"),n.resume()),t},v.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;o<i;o++)n[o].emit("unpipe",this,r);return this}var s=N(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},v.prototype.on=function(t,e){var r=u.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i.nextTick(k,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var t=this._readableState;return t.flowing||(d("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(T,t,e))}(this,t)),this},v.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(d("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){d("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<b.length;o++)t.on(b[o],this.emit.bind(this,b[o]));return this._read=function(e){d("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=C}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":211,"./internal/streams/BufferList":216,"./internal/streams/destroy":217,"./internal/streams/stream":218,_process:166,"core-util-is":87,events:121,inherits:139,isarray:141,"process-nextick-args":165,"safe-buffer":223,"string_decoder/":224,util:54}],214:[function(t,e,r){"use strict";e.exports=s;var n=t("./_stream_duplex"),i=Object.create(t("core-util-is"));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function s(t){if(!(this instanceof s))return new s(t);n.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",a)}function a(){var t=this;"function"==typeof this._flush?this._flush((function(e,r){u(t,e,r)})):u(this,null,null)}function u(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}i.inherits=t("inherits"),i.inherits(s,n),s.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},s.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},s.prototype._destroy=function(t,e){var r=this;n.prototype._destroy.call(this,t,(function(t){e(t),r.emit("close")}))}},{"./_stream_duplex":211,"core-util-is":87,inherits:139}],215:[function(t,e,n){(function(r,n,i){(function(){"use strict";var o=t("process-nextick-args");function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}e.exports=y;var a,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:o.nextTick;y.WritableState=b;var c=Object.create(t("core-util-is"));c.inherits=t("inherits");var f,l={deprecate:t("util-deprecate")},h=t("./internal/streams/stream"),d=t("safe-buffer").Buffer,p=n.Uint8Array||function(){},m=t("./internal/streams/destroy");function g(){}function b(e,r){a=a||t("./_stream_duplex"),e=e||{};var n=r instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),S(t,e))}(t,r,n,e,i);else{var s=A(r);s||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),n?u(w,t,r,s,i):w(t,r,s,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function y(e){if(a=a||t("./_stream_duplex"),!(f.call(y,this)||this instanceof a))return new y(e);this._writableState=new b(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function v(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),S(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,v(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(v(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function A(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function E(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),S(t,e)}))}function S(t,e){var r=A(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(E,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}c.inherits(y,h),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(b.prototype,"buffer",{get:l.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===y&&t&&t._writableState instanceof b}})):f=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=t,d.isBuffer(n)||n instanceof p);return a&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(n,s),i=!1),i}(this,i,t,r))&&(i.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else v(t,e,!1,a,n,i,o);return u}(this,i,a,t,e,r)),s},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||_(this,t))},y.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,r){var n=this._writableState;"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||n.finished||function(t,e,r){e.ending=!0,S(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this)}).call(this,t("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":211,"./internal/streams/destroy":217,"./internal/streams/stream":218,_process:166,"core-util-is":87,inherits:139,"process-nextick-args":165,"safe-buffer":223,timers:232,"util-deprecate":233}],216:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=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}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i=n.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=i,r=s,o.data.copy(e,r),s+=o.data.length,o=o.next;return i},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":223,util:54}],217:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":165}],218:[function(t,e,r){arguments[4][188][0].apply(r,arguments)},{dup:188,events:121}],219:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":220}],220:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":211,"./lib/_stream_passthrough.js":212,"./lib/_stream_readable.js":213,"./lib/_stream_transform.js":214,"./lib/_stream_writable.js":215}],221:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":220}],222:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":215}],223:[function(t,e,r){var n=t("buffer"),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?e.exports=n:(o(n,r),r.Buffer=s),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)}},{buffer:84}],224:[function(t,e,r){"use strict";var n=t("safe-buffer").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=f,this.end=l,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 f(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 l(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):""}r.StringDecoder=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<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):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}},{"safe-buffer":223}],225:[function(t,e,r){arguments[4][224][0].apply(r,arguments)},{dup:224,"safe-buffer":192}],226:[function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(t){i.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}})),i.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,function(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.args))}))},e.exports=i},{}],227:[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})(t)}var i;"undefined"!=typeof window?i=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),i=void 0):i=self;var o=t("component-emitter"),s=t("fast-safe-stringify"),a=t("./request-base"),u=t("./is-object"),c=t("./response-base"),f=t("./agent-base");function l(){}e.exports=function(t,e){return"function"==typeof e?new r.Request("GET",t).end(e):1===arguments.length?new r.Request("GET",t):new r.Request(t,e)};var h=r=e.exports;r.Request=v,h.getXHR=function(){if(i.XMLHttpRequest&&(!i.location||"file:"!==i.location.protocol||!i.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var d="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function p(t){if(!u(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&m(e,r,t[r]);return e.join("&")}function m(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){m(t,e,r)}));else if(u(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&m(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function g(t){for(var e,r,n={},i=t.split("&"),o=0,s=i.length;o<s;++o)-1===(r=(e=i[o]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function b(t){return/[/+]json($|[^-\w])/.test(t)}function y(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,i,o=t.split(/\r?\n/),s={},a=0,u=o.length;a<u;++a)-1!==(e=(r=o[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),i=d(r.slice(e+1)),s[n]=i);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function v(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new y(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}function w(t,e,r){var n=h("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}h.serializeObject=p,h.parseString=g,h.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},h.serialize={"application/x-www-form-urlencoded":p,"application/json":s},h.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},c(y.prototype),y.prototype._parseBody=function(t){var e=h.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&b(this.type)&&(e=h.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},y.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},h.Response=y,o(v.prototype),a(v.prototype),v.prototype.type=function(t){return this.set("Content-Type",h.types[t]||t),this},v.prototype.accept=function(t){return this.set("Accept",h.types[t]||t),this},v.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var i=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,i)},v.prototype.query=function(t){return"string"!=typeof t&&(t=p(t)),t&&this._query.push(t),this},v.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},v.prototype._getFormData=function(){return this._formData||(this._formData=new i.FormData),this._formData},v.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},v.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},v.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},v.prototype.ca=v.prototype.agent,v.prototype.buffer=v.prototype.ca,v.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},v.prototype.pipe=v.prototype.write,v.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},v.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||l,this._finalizeQueryString(),this._end()},v.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},v.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=h.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||h.serialize[i?i.split(";")[0]:""];!o&&b(i)&&(o=h.serialize["application/json"]),o&&(r=o(r))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&e.setRequestHeader(s,this.header[s]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},h.agent=function(){return new f},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){f.prototype[t.toLowerCase()]=function(e,r){var n=new h.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),f.prototype.del=f.prototype.delete,h.get=function(t,e,r){var n=h("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},h.head=function(t,e,r){var n=h("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},h.options=function(t,e,r){var n=h("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},h.del=w,h.delete=w,h.patch=function(t,e,r){var n=h("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},h.post=function(t,e,r){var n=h("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},h.put=function(t,e,r){var n=h("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},{"./agent-base":226,"./is-object":228,"./request-base":229,"./response-base":230,"component-emitter":86,"fast-safe-stringify":123}],228:[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})(t)}e.exports=function(t){return null!==t&&"object"===n(t)}},{}],229:[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})(t)}var i=t("./is-object");function o(t){if(t)return function(t){for(var e in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,e)&&(t[e]=o.prototype[e]);return t}(t)}e.exports=o,o.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},o.prototype.parse=function(t){return this._parser=t,this},o.prototype.responseType=function(t){return this._responseType=t,this},o.prototype.serialize=function(t){return this._serializer=t,this},o.prototype.timeout=function(t){if(!t||"object"!==n(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},o.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var s=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];o.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&s.includes(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},o.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},o.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},o.prototype.catch=function(t){return this.then(void 0,t)},o.prototype.use=function(t){return t(this),this},o.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},o.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},o.prototype.get=function(t){return this._header[t.toLowerCase()]},o.prototype.getHeader=o.prototype.get,o.prototype.set=function(t,e){if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},o.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},o.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},o.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},o.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},o.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},o.prototype.redirects=function(t){return this._maxRedirects=t,this},o.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},o.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},o.prototype.send=function(t){var e=i(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&i(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},o.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},o.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},o.prototype._appendQueryString=function(){console.warn("Unsupported")},o.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},o.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},{"./is-object":228}],230:[function(t,e,r){"use strict";var n=t("./utils");function i(t){if(t)return function(t){for(var e in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,e)&&(t[e]=i.prototype[e]);return t}(t)}e.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(this[i]=r[i]);this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t}},{"./utils":231}],231:[function(t,e,r){"use strict";r.type=function(t){return t.split(/ *; */).shift()},r.params=function(t){return t.split(/ *; */).reduce((function(t,e){var r=e.split(/ *= */),n=r.shift(),i=r.shift();return n&&i&&(t[n]=i),t}),{})},r.parseLinks=function(t){return t.split(/ *, */).reduce((function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t}),{})},r.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},{}],232:[function(t,e,r){(function(e,n){(function(){var i=t("process/browser.js").nextTick,o=Function.prototype.apply,s=Array.prototype.slice,a={},u=0;function c(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new c(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new c(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"==typeof e?e:function(t){var e=u++,n=!(arguments.length<2)&&s.call(arguments,1);return a[e]=!0,i((function(){a[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"==typeof n?n:function(t){delete a[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":166,timers:232}],233:[function(t,e,n){(function(t){(function(){function r(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],234:[function(t,e,r){var n;try{n=t("es5-ext/global")}catch(t){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var i=n.WebSocket||n.MozWebSocket,o=t("./version");function s(t,e){return e?new i(t,e):new i(t)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(t){Object.defineProperty(s,t,{get:function(){return i[t]}})})),e.exports={w3cwebsocket:i?s:null,version:o}},{"./version":235,"es5-ext/global":120}],235:[function(t,e,r){e.exports=t("../package.json").version},{"../package.json":236}],236:[function(t,e,r){e.exports={_args:[["websocket@1.0.32","/Volumes/Extreme_SSD/github.com/conflux-chain/js-conflux-sdk"]],_from:"websocket@1.0.32",_id:"websocket@1.0.32",_inBundle:!1,_integrity:"sha512-i4yhcllSP4wrpoPMU2N0TQ/q0O94LRG/eUQjEAamRltjQ1oT1PFFKOG4i877OlJgCG8rw6LrrowJp+TYCEWF7Q==",_location:"/websocket",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"websocket@1.0.32",name:"websocket",escapedName:"websocket",rawSpec:"1.0.32",saveSpec:null,fetchSpec:"1.0.32"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/websocket/-/websocket-1.0.32.tgz",_spec:"1.0.32",_where:"/Volumes/Extreme_SSD/github.com/conflux-chain/js-conflux-sdk",author:{name:"Brian McKelvey",email:"theturtle32@gmail.com",url:"https://github.com/theturtle32"},browser:"lib/browser.js",bugs:{url:"https://github.com/theturtle32/WebSocket-Node/issues"},config:{verbose:!1},contributors:[{name:"Iñaki Baz Castillo",email:"ibc@aliax.net",url:"http://dev.sipdoc.net"}],dependencies:{bufferutil:"^4.0.1",debug:"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2",yaeti:"^0.0.6"},description:"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",devDependencies:{"buffer-equal":"^1.0.0",gulp:"^4.0.2","gulp-jshint":"^2.0.4",jshint:"^2.0.0","jshint-stylish":"^2.2.1",tape:"^4.9.1"},directories:{lib:"./lib"},engines:{node:">=4.0.0"},homepage:"https://github.com/theturtle32/WebSocket-Node",keywords:["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],license:"Apache-2.0",main:"index",name:"websocket",repository:{type:"git",url:"git+https://github.com/theturtle32/WebSocket-Node.git"},scripts:{gulp:"gulp",test:"tape test/unit/*.js"},version:"1.0.32"}},{}],237:[function(t,e,r){e.exports={name:"js-conflux-sdk",description:"JavaScript Conflux Software Development Kit",version:"1.6.0",license:"LGPL-3.0",author:"Haizhou@conflux-chain.org",repository:"https://github.com/Conflux-Chain/js-conflux-sdk.git",keywords:["conflux","sdk"],main:"src/index.js",types:"./types/index.d.ts",browser:"dist/js-conflux-sdk.umd.min.js","browserify-browser":{secp256k1:"secp256k1/elliptic","./src/util/jsbi":"jsbi"},files:["dist","mock","src","types"],browserslit:"cover 99.5%",dependencies:{"@babel/runtime":"^7.8.4","big.js":"^5.2.2","@conflux-dev/conflux-address-js":"^1.0.0",keccak:"^2.0.0",lodash:"^4.17.19","scrypt-js":"^3.0.1",secp256k1:"^3.7.1",superagent:"^5.1.0",websocket:"^1.0.31"},devDependencies:{"@babel/core":"^7.8.4","@babel/plugin-transform-runtime":"^7.8.3","@babel/preset-env":"^7.8.4","@geekberry/jsdoc-to-md":"0.0.8","@types/node":"^14.0.23","babel-plugin-lodash":"^3.3.4",babelify:"^10.0.0",browserify:"^16.5.1",concurrently:"^5.1.0",eslint:"^7.12.0","eslint-config-airbnb-base":"^14.0.0","eslint-plugin-import":"^2.18.2",exorcist:"^1.0.1","fs-extra":"^8.1.0",jest:"26.6.0",jsbi:"^3.1.4","minify-stream":"^2.0.1","mold-source-map":"^0.4.0",solc:"^0.6.10"},resolutions:{"tinyify/acorn-node/acorn":"7.1.1","eslint/espree/acorn":"7.1.1","tinyify/unassertify/unassert/acorn":"7.1.1","**/minimist":"^1.2.3","**/kind-of":"^6.0.3","**/elliptic":"^6.5.3","**/lodash":"^4.17.20","**/babel-jest":"^26.6.0","jest/jest-cli/jest-config/jest-environment-jsdom/jsdom/acorn-globals/acorn":"6.4.1"},scripts:{eslint:"eslint ./src ./test ./mock",build:"node scripts/build-frontend.js",document:"node scripts/document.js",prepublishOnly:"npm run build",test:"jest --coverage",react:"npm run build & cd react & yarn build & yarn start"}}},{}],238:[function(t,e,r){"use strict";var n=t("./util/jsbi");n.prototype.toJSON=function(){return this.toString()};var i=n.leftShift(n.BigInt(1),n.BigInt(256)),o=n.subtract(i,n.BigInt(1));e.exports={WORD_BYTES:32,WORD_CHARS:64,UINT_BOUND:i,MAX_UINT:o,EPOCH_NUMBER:{LATEST_MINED:"latest_mined",LATEST_STATE:"latest_state",LATEST_CONFIRMED:"latest_confirmed",LATEST_CHECKPOINT:"latest_checkpoint",EARLIEST:"earliest"},MIN_GAS_PRICE:1,TRANSACTION_GAS:21e3,TRANSACTION_STORAGE_LIMIT:0,TESTNET_ID:1,MAINNET_ID:1029,ZERO_ADDRESS_HEX:"0x0000000000000000000000000000000000000000"}},{"./util/jsbi":142}],239:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/objectWithoutProperties")),o=n(t("@babel/runtime/regenerator")),s=n(t("@babel/runtime/helpers/asyncToGenerator")),a=n(t("@babel/runtime/helpers/classCallCheck")),u=n(t("@babel/runtime/helpers/createClass")),c=t("./CONST"),f=t("./util").assert,l=t("./util/format"),h=t("./provider"),d=t("./wallet"),p=t("./contract"),m=t("./contract/internal"),g=t("./contract/standard").CRC20_ABI,b=t("./subscribe/PendingTransaction"),y=t("./subscribe/Subscription"),v=t("../package.json"),w=function(){var t,e,r,n,w,_,A,E,S,M,x,k,T,I,C,R,B,N,O,P,D,L,U,j,F,q,z,H,K,G,W,V,$,X,Y,J,Z,Q,tt,et,rt,nt,it,ot,st,at,ut;function ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.defaultGasPrice,r=t.defaultGasRatio,n=void 0===r?1.1:r,o=t.defaultStorageRatio,s=void 0===o?1.1:o,u=t.networkId,c=t.useHexAddressInParameter,f=void 0!==c&&c,l=(0,i.default)(t,["defaultGasPrice","defaultGasRatio","defaultStorageRatio","networkId","useHexAddressInParameter"]);(0,a.default)(this,ct),this.version=v.version,this.provider=h(l),this.wallet=new d,this.defaultGasPrice=e,this.defaultGasRatio=n,this.defaultStorageRatio=s,this.sendRawTransaction=this._decoratePendingTransaction(this.sendRawTransaction),this.sendTransaction=this._decoratePendingTransaction(this.sendTransaction),u&&(this.networkId=u,this.wallet.setNetworkId(u)),this.useHexAddressInParameter=f}return(0,u.default)(ct,null,[{key:"create",value:(t=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=new ct(e),!e.networkId){t.next=3;break}return t.abrupt("return",r);case 3:return t.next=5,r.updateNetworkId();case 5:return t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})}]),(0,u.default)(ct,[{key:"_decoratePendingTransaction",value:function(t){var e=this;return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return new b(e,t.bind(this),n)}}},{key:"_formatAddress",value:function(t){return this.networkId||console.warn("Conflux address: networkId is not set properly, please set it"),this.useHexAddressInParameter?l.hexAddress(t):l.address(t,this.networkId)}},{key:"_formatCallTx",value:function(t){return l.callTxAdvance(this.networkId,this.useHexAddressInParameter)(t)}},{key:"_formatGetLogs",value:function(t){return l.getLogsAdvance(this.networkId,this.useHexAddressInParameter)(t)}},{key:"Contract",value:function(t){return new p(t,this)}},{key:"InternalContract",value:function(t){var e=m[t];return f(e,'can not find internal contract named "'.concat(t,'"')),this.Contract(e)}},{key:"CRC20",value:function(t){return this.Contract({address:t,abi:g})}},{key:"close",value:function(){this.provider.close()}},{key:"updateNetworkId",value:(ut=(0,s.default)(o.default.mark((function t(){var e,r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getStatus();case 2:e=t.sent,r=e.networkId,this.networkId=r,this.wallet.setNetworkId(this.networkId);case 6:case"end":return t.stop()}}),t,this)}))),function(){return ut.apply(this,arguments)})},{key:"getClientVersion",value:(at=(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_clientVersion"));case 1:case"end":return t.stop()}}),t,this)}))),function(){return at.apply(this,arguments)})},{key:"getSupplyInfo",value:(st=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getSupplyInfo",l.epochNumber.$or(void 0)(e));case 2:return r=t.sent,t.abrupt("return",l.supplyInfo(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return st.apply(this,arguments)})},{key:"getStatus",value:(ot=(0,s.default)(o.default.mark((function t(){var e;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getStatus");case 2:return e=t.sent,t.abrupt("return",l.status(e));case 4:case"end":return t.stop()}}),t,this)}))),function(){return ot.apply(this,arguments)})},{key:"getGasPrice",value:(it=(0,s.default)(o.default.mark((function t(){var e;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_gasPrice");case 2:return e=t.sent,t.abrupt("return",l.bigUInt(e));case 4:case"end":return t.stop()}}),t,this)}))),function(){return it.apply(this,arguments)})},{key:"getInterestRate",value:(nt=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getInterestRate",l.epochNumber.$or(void 0)(e));case 2:return r=t.sent,t.abrupt("return",l.bigUInt(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return nt.apply(this,arguments)})},{key:"getAccumulateInterestRate",value:(rt=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getAccumulateInterestRate",l.epochNumber.$or(void 0)(e));case 2:return r=t.sent,t.abrupt("return",l.bigUInt(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return rt.apply(this,arguments)})},{key:"getAccount",value:(et=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getAccount",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.account(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return et.apply(this,arguments)})},{key:"getBalance",value:(tt=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getBalance",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.bigUInt(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return tt.apply(this,arguments)})},{key:"getStakingBalance",value:(Q=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getStakingBalance",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.bigUInt(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return Q.apply(this,arguments)})},{key:"getNextNonce",value:(Z=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getNextNonce",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.bigUInt(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return Z.apply(this,arguments)})},{key:"getAdmin",value:(J=(0,s.default)(o.default.mark((function t(e,r){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_getAdmin",this._formatAddress(e),l.epochNumber.$or(void 0)(r)));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return J.apply(this,arguments)})},{key:"getVoteList",value:(Y=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getVoteList",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.voteList(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return Y.apply(this,arguments)})},{key:"getDepositList",value:(X=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getDepositList",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.depositList(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return X.apply(this,arguments)})},{key:"getEpochNumber",value:($=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_epochNumber",l.epochNumber.$or(void 0)(e));case 2:return r=t.sent,t.abrupt("return",l.uInt(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return $.apply(this,arguments)})},{key:"getBlockByEpochNumber",value:(V=(0,s.default)(o.default.mark((function t(e){var r,n,i=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]&&i[1],t.next=3,this.provider.call("cfx_getBlockByEpochNumber",l.epochNumber(e),l.boolean(r));case 3:return n=t.sent,t.abrupt("return",l.block.$or(null)(n));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return V.apply(this,arguments)})},{key:"getBlockByBlockNumber",value:(W=(0,s.default)(o.default.mark((function t(e){var r,n,i=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]&&i[1],t.next=3,this.provider.call("cfx_getBlockByBlockNumber",l.bigUIntHex(e),l.boolean(r));case 3:return n=t.sent,t.abrupt("return",l.block.$or(null)(n));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return W.apply(this,arguments)})},{key:"getBlocksByEpochNumber",value:(G=(0,s.default)(o.default.mark((function t(e){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_getBlocksByEpoch",l.epochNumber(e)));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return G.apply(this,arguments)})},{key:"getBlockRewardInfo",value:(K=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getBlockRewardInfo",l.epochNumber(e));case 2:return r=t.sent,t.abrupt("return",l.rewardInfo(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return K.apply(this,arguments)})},{key:"getBestBlockHash",value:(H=(0,s.default)(o.default.mark((function t(){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_getBestBlockHash"));case 1:case"end":return t.stop()}}),t,this)}))),function(){return H.apply(this,arguments)})},{key:"getBlockByHash",value:(z=(0,s.default)(o.default.mark((function t(e){var r,n,i=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>1&&void 0!==i[1]&&i[1],t.next=3,this.provider.call("cfx_getBlockByHash",l.blockHash(e),l.boolean(r));case 3:return n=t.sent,t.abrupt("return",l.block.$or(null)(n));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return z.apply(this,arguments)})},{key:"getBlockByHashWithPivotAssumption",value:(q=(0,s.default)(o.default.mark((function t(e,r,n){var i;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getBlockByHashWithPivotAssumption",l.blockHash(e),l.blockHash(r),l.epochNumber(n));case 2:return i=t.sent,t.abrupt("return",l.block(i));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return q.apply(this,arguments)})},{key:"getConfirmationRiskByHash",value:(F=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getConfirmationRiskByHash",l.blockHash(e));case 2:return r=t.sent,t.abrupt("return",l.fixed64.$or(null)(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return F.apply(this,arguments)})},{key:"getTransactionByHash",value:(j=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getTransactionByHash",l.transactionHash(e));case 2:return r=t.sent,t.abrupt("return",l.transaction.$or(null)(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return j.apply(this,arguments)})},{key:"getTransactionReceipt",value:(U=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getTransactionReceipt",l.transactionHash(e));case 2:return r=t.sent,t.abrupt("return",l.receipt.$or(null)(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:"sendRawTransaction",value:(L=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_sendRawTransaction",l.hex(e));case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return L.apply(this,arguments)})},{key:"_signTransaction",value:(D=(0,s.default)(o.default.mark((function t(e){var r,n,i,s,a,u,f,h;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.wallet.get("".concat(e.from));case 2:if(r=t.sent,void 0!==e.nonce){t.next=7;break}return t.next=6,this.getNextNonce(r);case 6:e.nonce=t.sent;case 7:if(void 0!==e.chainId){t.next=12;break}return t.next=10,this.getStatus();case 10:n=t.sent,e.chainId=n.chainId;case 12:if(void 0!==e.epochHeight){t.next=16;break}return t.next=15,this.getEpochNumber();case 15:e.epochHeight=t.sent;case 16:if(void 0!==e.gasPrice){t.next=25;break}if(void 0!==this.defaultGasPrice){t.next=24;break}return t.next=20,this.getGasPrice();case 20:i=t.sent,e.gasPrice=0===Number(i)?c.MIN_GAS_PRICE:i,t.next=25;break;case 24:e.gasPrice=this.defaultGasPrice;case 25:if(void 0!==e.gas&&void 0!==e.storageLimit){t.next=40;break}if(!e.data){t.next=36;break}return t.next=29,this.estimateGasAndCollateral(e);case 29:u=t.sent,f=u.gasUsed,h=u.storageCollateralized,s=l.big(f).times(this.defaultGasRatio).toFixed(0),a=l.big(h).times(this.defaultStorageRatio).toFixed(0),t.next=38;break;case 36:s=c.TRANSACTION_GAS,a=c.TRANSACTION_STORAGE_LIMIT;case 38:void 0===e.gas&&(e.gas=s),void 0===e.storageLimit&&(e.storageLimit=a);case 40:return t.abrupt("return",r.signTransaction(e));case 41:case"end":return t.stop()}}),t,this)}))),function(t){return D.apply(this,arguments)})},{key:"sendTransaction",value:(P=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.wallet.has("".concat(e.from))){t.next=5;break}return t.next=3,this._signTransaction(e);case 3:return n=t.sent,t.abrupt("return",this.sendRawTransaction(n.serialize()));case 5:return t.abrupt("return",this.provider.call("cfx_sendTransaction",this._formatCallTx(e),r));case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return P.apply(this,arguments)})},{key:"getCode",value:(O=(0,s.default)(o.default.mark((function t(e,r){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_getCode",this._formatAddress(e),l.epochNumber.$or(void 0)(r)));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return O.apply(this,arguments)})},{key:"getStorageAt",value:(N=(0,s.default)(o.default.mark((function t(e,r,n){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_getStorageAt",this._formatAddress(e),l.hex64(r),l.epochNumber.$or(void 0)(n)));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return N.apply(this,arguments)})},{key:"getStorageRoot",value:(B=(0,s.default)(o.default.mark((function t(e,r){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_getStorageRoot",this._formatAddress(e),l.epochNumber.$or(void 0)(r)));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return B.apply(this,arguments)})},{key:"getSponsorInfo",value:(R=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getSponsorInfo",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.sponsorInfo(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return R.apply(this,arguments)})},{key:"getAccountPendingInfo",value:(C=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getAccountPendingInfo",this._formatAddress(e));case 2:return r=t.sent,t.abrupt("return",l.accountPendingInfo(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return C.apply(this,arguments)})},{key:"getCollateralForStorage",value:(I=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getCollateralForStorage",this._formatAddress(e),l.epochNumber.$or(void 0)(r));case 2:return n=t.sent,t.abrupt("return",l.bigUInt(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return I.apply(this,arguments)})},{key:"call",value:(T=(0,s.default)(o.default.mark((function t(e,r){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.provider.call("cfx_call",this._formatCallTx(e),l.epochNumber.$or(void 0)(r));case 3:return t.abrupt("return",t.sent);case 6:throw t.prev=6,t.t0=t.catch(0),p.decodeError(t.t0);case 9:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(t,e){return T.apply(this,arguments)})},{key:"estimateGasAndCollateral",value:(k=(0,s.default)(o.default.mark((function t(e,r){var n;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.provider.call("cfx_estimateGasAndCollateral",this._formatCallTx(e),l.epochNumber.$or(void 0)(r));case 3:return n=t.sent,t.abrupt("return",l.estimate(n));case 7:throw t.prev=7,t.t0=t.catch(0),p.decodeError(t.t0);case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t,e){return k.apply(this,arguments)})},{key:"getLogs",value:(x=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e.blockHashes||void 0===e.fromEpoch&&void 0===e.toEpoch){t.next=2;break}throw new Error("OverrideError, do not use `blockHashes` with `fromEpoch` or `toEpoch`, cause only `blockHashes` will take effect");case 2:return t.next=4,this.provider.call("cfx_getLogs",this._formatGetLogs(e));case 4:return r=t.sent,t.abrupt("return",l.logs(r));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return x.apply(this,arguments)})},{key:"traceBlock",value:(M=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("trace_block",l.blockHash(e));case 2:return r=t.sent,t.abrupt("return",l.blockTraces(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return M.apply(this,arguments)})},{key:"traceTransaction",value:(S=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("trace_transaction",l.transactionHash(e));case 2:return r=t.sent,t.abrupt("return",l.traces(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return S.apply(this,arguments)})},{key:"traceFilter",value:(E=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("trace_filter",l.traceFilter(e));case 2:return r=t.sent,t.abrupt("return",l.traces(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return E.apply(this,arguments)})},{key:"getEpochReceipts",value:(A=(0,s.default)(o.default.mark((function t(e){var r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider.call("cfx_getEpochReceipts",l.epochNumber(e));case 2:return r=t.sent,t.abrupt("return",l.epochReceipts(r));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return A.apply(this,arguments)})},{key:"subscribe",value:(_=(0,s.default)(o.default.mark((function t(e){var r,n,i,s,a=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=a.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=a[s];return t.abrupt("return",(r=this.provider).call.apply(r,["cfx_subscribe",e].concat(i)));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return _.apply(this,arguments)})},{key:"subscribeEpochs",value:(w=(0,s.default)(o.default.mark((function t(){var e,r,n,i=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:c.EPOCH_NUMBER.LATEST_MINED,t.next=3,this.subscribe("epochs",e);case 3:return r=t.sent,n=new y(r),this.provider.on(r,(function(t){n.emit("data",l.epoch(t))})),t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)}))),function(){return w.apply(this,arguments)})},{key:"subscribeNewHeads",value:(n=(0,s.default)(o.default.mark((function t(){var e,r;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.subscribe("newHeads");case 2:return e=t.sent,r=new y(e),this.provider.on(e,(function(t){r.emit("data",l.head(t))})),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"subscribeLogs",value:(r=(0,s.default)(o.default.mark((function t(){var e,r,n,i,s,a=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:{},r=e.address,n=e.topics,t.next=3,this.subscribe("logs",this._formatGetLogs({address:r,topics:n}));case 3:return i=t.sent,s=new y(i),this.provider.on(i,(function(t){t.revertTo?s.emit("revert",l.revert(t)):s.emit("data",l.log(t))})),t.abrupt("return",s);case 7:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"unsubscribe",value:(e=(0,s.default)(o.default.mark((function t(e){return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.provider.call("cfx_unsubscribe","".concat(e)));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),ct}();e.exports=w},{"../package.json":237,"./CONST":238,"./contract":259,"./contract/internal":263,"./contract/standard":271,"./provider":277,"./subscribe/PendingTransaction":278,"./subscribe/Subscription":279,"./util":284,"./util/format":283,"./wallet":293,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/regenerator":30}],240:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/construct")),o=n(t("@babel/runtime/helpers/toConsumableArray")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=n(t("@babel/runtime/helpers/inherits")),c=n(t("@babel/runtime/helpers/possibleConstructorReturn")),f=n(t("@babel/runtime/helpers/getPrototypeOf")),l=n(t("@babel/runtime/helpers/wrapNativeSuper"));var h=t("./util/format"),d=function(t){(0,u.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,f.default)(t);if(e){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}(r);function r(t){return(0,s.default)(this,r),e.call(this,h.bigUInt(t).toString(10))}return(0,a.default)(r,null,[{key:"fromCFX",value:function(t){return new this(h.big(t).times(1e18).toFixed())}},{key:"fromGDrip",value:function(t){return new this(h.big(t).times(1e9).toFixed())}}]),(0,a.default)(r,[{key:"toCFX",value:function(){return h.big(this).div(1e18).toFixed()}},{key:"toGDrip",value:function(){return h.big(this).div(1e9).toFixed()}}]),r}((0,l.default)(String));e.exports=new Proxy(d,{apply:function(t,e,r){return(0,i.default)(d,(0,o.default)(r))}})},{"./util/format":283,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/construct":7,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/toConsumableArray":26,"@babel/runtime/helpers/wrapNativeSuper":29}],241:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=t("./util/sign"),a=s.keccak256,u=s.ecdsaSign,c=s.ecdsaRecover,f=s.publicKeyToAddress,l=t("./util/format"),h=function(){function t(e){(0,i.default)(this,t),this.message=e}return(0,o.default)(t,null,[{key:"sign",value:function(t,e){var n=u(l.hexBuffer(e),l.hexBuffer(t)),i=n.r,o=n.s,s=n.v,a=r.concat([i,o,l.hexBuffer(s)]);return l.hex(a)}},{key:"recover",value:function(t,e){var r=l.hexBuffer(t),n=r.slice(0,32),i=r.slice(32,64),o=r[64],s=c(l.hexBuffer(e),{r:n,s:i,v:o});return l.publicKey(s)}}]),(0,o.default)(t,[{key:"sign",value:function(e,r){return this.signature=t.sign(e,this.hash),this.networkId=r,this}},{key:"hash",get:function(){return l.hex(a(r.from(this.message)))}},{key:"from",get:function(){try{var e=t.recover(this.signature,this.hash);return l.address(f(l.hexBuffer(e)),this.networkId)}catch(t){return}}},{key:"r",get:function(){try{return this.signature.slice(0,66)}catch(t){return}}},{key:"s",get:function(){try{return"0x".concat(this.signature.slice(66,130))}catch(t){return}}},{key:"v",get:function(){try{return parseInt(this.signature.slice(130,132),16)}catch(t){return}}}]),t}();e.exports=h}).call(this)}).call(this,t("buffer").Buffer)},{"./util/format":283,"./util/sign":289,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,buffer:84}],242:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=t("./util/sign"),a=s.keccak256,u=s.ecdsaSign,c=s.ecdsaRecover,f=s.privateKeyToAddress,l=t("./util/rlp"),h=t("./util/format"),d=function(){function t(e){var r=e.from,n=e.nonce,o=e.gasPrice,s=e.gas,a=e.to,u=e.value,c=e.storageLimit,f=e.epochHeight,l=e.chainId,h=e.data,d=e.v,p=e.r,m=e.s;(0,i.default)(this,t),this.from=r,this.nonce=n,this.gasPrice=o,this.gas=s,this.to=a,this.value=u,this.storageLimit=c,this.epochHeight=f,this.chainId=l,this.data=h,this.v=d,this.r=p,this.s=m}return(0,o.default)(t,[{key:"sign",value:function(t,e){var r=h.hexBuffer(t),n=f(r),i=u(a(this.encode(!1)),r),o=i.r,s=i.s,c=i.v;return this.from=h.address(n,e),this.r=h.hex(o),this.s=h.hex(s),this.v=c,this}},{key:"recover",value:function(){var t=c(a(this.encode(!1)),{r:h.hexBuffer(this.r),s:h.hexBuffer(this.s),v:h.uInt(this.v)});return h.publicKey(t)}},{key:"encode",value:function(t){var e=h.signTx(this),r=e.nonce,n=e.gasPrice,i=e.gas,o=e.to,s=e.value,a=e.storageLimit,u=e.epochHeight,c=e.chainId,f=e.data,d=e.v,p=e.r,m=e.s,g=t?[[r,n,i,o,s,a,u,c,f],d,p,m]:[r,n,i,o,s,a,u,c,f];return l.encode(g)}},{key:"serialize",value:function(){return h.hex(this.encode(!0))}},{key:"hash",get:function(){try{return h.hex(a(this.encode(!0)))}catch(t){return}}}]),t}();e.exports=d},{"./util/format":283,"./util/rlp":288,"./util/sign":289,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13}],243:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass"));function s(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var u=t("lodash"),c=t("./ContractABI"),f=t("./method/ContractConstructor"),l=t("./method/ContractMethod"),h=t("./method/ContractMethodOverride"),d=t("./event/ContractEvent"),p=t("./event/ContractEventOverride"),m=function(){function t(e,r){var n=this,o=e.abi,s=e.address,a=e.bytecode;(0,i.default)(this,t),this._feedAddressNetId(o,r);var m=u.groupBy(o,"type");this.abi=new c(this),this.address=s,this.constructor=new f(u.first(m.constructor),a,this,r);var g=u.map(m.function,(function(t){return new l(t,n,r)}));u.forEach(u.groupBy(g,"name"),(function(t,e){n[e]=1===t.length?u.first(t):new h(t,n,r),t.forEach((function(t){n[t.type]=t,n[t.signature]=t}))}));var b=u.map(m.event,(function(t){return new d(t,n,r)}));u.forEach(u.groupBy(b,"name"),(function(t,e){n[e]=1===t.length?u.first(t):new p(t,n,r),t.forEach((function(t){n[t.type]=t,n[t.signature]=t}))}))}return(0,o.default)(t,[{key:"_feedAddressNetId",value:function(t,e){if(t&&e&&e.networkId){var r,n=s(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;["function","event","constructor"].indexOf(i.type)>=0&&(i.inputs&&o(i.inputs),i.outputs&&o(i.outputs))}}catch(t){n.e(t)}finally{n.f()}}function o(t){var r,n=s(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;"address"===i.type&&(i.networkId=e.networkId),"tuple"===i.type&&o(i.components)}}catch(t){n.e(t)}finally{n.f()}}}}]),t}();e.exports=m},{"./ContractABI":244,"./event/ContractEvent":255,"./event/ContractEventOverride":256,"./method/ContractConstructor":264,"./method/ContractMethod":265,"./method/ContractMethodOverride":266,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,lodash:149}],244:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/toConsumableArray")),o=n(t("@babel/runtime/helpers/classCallCheck")),s=n(t("@babel/runtime/helpers/createClass")),a=function(){function t(e){(0,o.default)(this,t),this.contract=e}return(0,s.default)(t,[{key:"decodeData",value:function(t){var e=this.contract[t.slice(0,10)]||this.contract.constructor,r=e.decodeData(t);if(r)return{name:e.name,fullName:e.fullName,type:e.type,signature:e.signature,array:(0,i.default)(r),object:r.toObject()}}},{key:"decodeLog",value:function(t){var e=this.contract[t.topics[0]];if(e){var r=e.decodeLog(t);return{name:e.name,fullName:e.fullName,type:e.type,signature:e.signature,array:(0,i.default)(r),object:r.toObject()}}}}]),t}();e.exports=a},{"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/toConsumableArray":26}],245:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/helpers/objectWithoutProperties")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=n(t("@babel/runtime/helpers/inherits")),c=n(t("@babel/runtime/helpers/possibleConstructorReturn")),f=n(t("@babel/runtime/helpers/getPrototypeOf"));function l(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 h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d=t("../../util").alignBuffer,p=t("../../util/format"),m=function(t){(0,u.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,f.default)(t);if(e){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}(r);function r(t){var n,i=t.type,a=(0,o.default)(t,["type"]);return(0,s.default)(this,r),(n=e.call(this,h(h({},a),{},{type:i}))).networkId=a.networkId,n}return(0,a.default)(r,null,[{key:"from",value:function(t){var e=t.type,r=(0,o.default)(t,["type"]);if("address"===e)return new this(h(h({},r),{},{type:e}))}}]),(0,a.default)(r,[{key:"encode",value:function(t){return d(p.hexBuffer(p.hexAddress(t)))}},{key:"decode",value:function(t){var e=t.read(40);return(e.startsWith("1")||e.startsWith("0")||e.startsWith("8"))&&this.networkId?p.address("0x".concat(e),this.networkId):p.hexAddress("0x".concat(e))}}]),r}(t("./BaseCoder"));e.exports=m},{"../../util":284,"../../util/format":283,"./BaseCoder":247,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22}],246:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/typeof")),o=n(t("@babel/runtime/helpers/defineProperty")),s=n(t("@babel/runtime/helpers/slicedToArray")),a=n(t("@babel/runtime/helpers/objectWithoutProperties")),u=n(t("@babel/runtime/helpers/classCallCheck")),c=n(t("@babel/runtime/helpers/createClass")),f=n(t("@babel/runtime/helpers/inherits")),l=n(t("@babel/runtime/helpers/possibleConstructorReturn")),h=n(t("@babel/runtime/helpers/getPrototypeOf"));function d(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 p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){(0,o.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var m=t("lodash"),g=t("../../util").assert,b=t("../../util/format"),y=t("./BaseCoder"),v=t("./IntegerCoder").uIntCoder,w=t("./TupleCoder"),_=w.pack,A=w.unpack,E=function(t){(0,f.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,h.default)(t);if(e){var i=(0,h.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}(n);function n(t){var r,i=t.name,o=t.coder,s=t.size;return(0,u.default)(this,n),void 0!==s&&g(Number.isInteger(s)&&0<s,{message:"invalid size",expect:"integer && >0",got:s,coder:{name:i}}),(r=e.call(this,{name:i})).type="".concat(o.type,"[").concat(s>0?s:"","]"),r.size=s,r.coder=o,r.dynamic=Boolean(void 0===s)||o.dynamic,r}return(0,c.default)(n,null,[{key:"from",value:function(t,e){var r=t.type,n=t.components,i=(0,a.default)(t,["type","components"]),o=r.match(/^(.*)\[([0-9]*)]$/);if(o){var u=(0,s.default)(o,3),c=u[1],f=u[2];return new this(p(p({},i),{},{coder:e({type:c,components:n}),size:f?parseInt(f,10):void 0}))}}}]),(0,c.default)(n,[{key:"encode",value:function(t){var e=this;g(Array.isArray(t),{message:"unexpected type",expect:"array",got:(0,i.default)(t),coder:this}),void 0!==this.size&&g(t.length===this.size,{message:"length not match",expect:this.size,got:t.length,coder:this});var n=m.range(t.length).map((function(){return e.coder})),o=_(n,t);return void 0===this.size&&(o=r.concat([v.encode(t.length),o])),o}},{key:"decode",value:function(t){var e=this,r=this.size;void 0===r&&(r=b.uInt(v.decode(t)));var n=m.range(r).map((function(){return e.coder}));return A(n,t)}},{key:"encodeTopic",value:function(t){try{return b.hex64(t)}catch(t){throw new Error("not supported encode array to index")}}},{key:"decodeTopic",value:function(t){return t}}]),n}(y);e.exports=E}).call(this)}).call(this,t("buffer").Buffer)},{"../../util":284,"../../util/format":283,"./BaseCoder":247,"./IntegerCoder":250,"./TupleCoder":253,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/slicedToArray":24,"@babel/runtime/helpers/typeof":27,buffer:84,lodash:149}],247:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=t("../../util/HexStream"),a=function(){function t(e){var r=e.type,n=e.name;(0,i.default)(this,t),this.type=r,this.name=n,this.dynamic=!1}return(0,o.default)(t,null,[{key:"from",value:function(t){}}]),(0,o.default)(t,[{key:"encode",value:function(t){throw new Error("".concat(this.constructor.name,".encode not implemented"))}},{key:"decode",value:function(t){throw new Error("".concat(this.constructor.name,".decode not implemented"))}},{key:"encodeTopic",value:function(t){return this.encode(t)}},{key:"decodeTopic",value:function(t){var e=new s(t);return this.decode(e)}}]),t}();e.exports=a},{"../../util/HexStream":280,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13}],248:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/helpers/objectWithoutProperties")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/get")),u=n(t("@babel/runtime/helpers/createClass")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf"));function h(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 d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=t("lodash"),m=t("../../util").assert,g=t("../../util/jsbi"),b=function(t){(0,c.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}(r);function r(t){var n,i=t.type,o=t.name;return(0,s.default)(this,r),(n=e.call(this,{name:o})).type=i,n}return(0,u.default)(r,null,[{key:"from",value:function(t){var e=t.type,r=(0,o.default)(t,["type"]);if("bool"===e)return new this(d(d({},r),{},{type:e}))}}]),(0,u.default)(r,[{key:"encode",value:function(t){return m(p.isBoolean(t),{message:"unexpected type",expect:"boolean",got:t,coder:this}),(0,a.default)((0,l.default)(r.prototype),"encode",this).call(this,t?1:0)}},{key:"decode",value:function(t){return g.notEqual((0,a.default)((0,l.default)(r.prototype),"decode",this).call(this,t),g.BigInt(0))}}]),r}(t("./IntegerCoder"));e.exports=b},{"../../util":284,"../../util/jsbi":142,"./IntegerCoder":250,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/get":10,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22,lodash:149}],249:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/helpers/slicedToArray")),s=n(t("@babel/runtime/helpers/objectWithoutProperties")),a=n(t("@babel/runtime/helpers/classCallCheck")),u=n(t("@babel/runtime/helpers/createClass")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf"));function h(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 d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=t("../../CONST").WORD_BYTES,m=t("../../util"),g=m.assert,b=m.alignBuffer,y=t("../../util/format"),v=t("../../util/sign"),w=t("./BaseCoder"),_=t("./IntegerCoder").uIntCoder,A=function(t){(0,c.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}(n);function n(t){var r,i=t.name,o=t.size;return(0,a.default)(this,n),void 0!==o&&g(Number.isInteger(o)&&o<=p,{message:"invalid size",expect:"integer && <=".concat(p),got:o,coder:{name:i}}),(r=e.call(this,{name:i})).type="bytes".concat(o>0?o:""),r.size=o,r.dynamic=Boolean(void 0===o),r}return(0,u.default)(n,null,[{key:"from",value:function(t){var e=t.type,r=(0,s.default)(t,["type"]),n=e.match(/^bytes([0-9]*)$/);if(n){var i=(0,o.default)(n,2)[1];return new this(d(d({},r),{},{size:i?parseInt(i,10):void 0}))}}}]),(0,u.default)(n,[{key:"encode",value:function(t){t=y.bytes(t),void 0!==this.size&&this.size!==t.length&&(t.length<this.size?t=r.concat([t,r.alloc(this.size-t.length)]):g(!1,{message:"length not match",expect:this.size,got:t.length,coder:this}));var e=b(t,!0);return void 0===this.size&&(e=r.concat([_.encode(t.length),e])),e}},{key:"decode",value:function(t){var e=this.size;return void 0===e&&(e=y.uInt(_.decode(t))),r.from(t.read(2*e,!0),"hex")}},{key:"encodeTopic",value:function(t){return g(r.isBuffer(t),{message:"value type error",expect:r.name,got:t.constructor.name,coder:this}),v.keccak256(t)}},{key:"decodeTopic",value:function(t){return t}}]),n}(w);e.exports=A}).call(this)}).call(this,t("buffer").Buffer)},{"../../CONST":238,"../../util":284,"../../util/format":283,"../../util/sign":289,"./BaseCoder":247,"./IntegerCoder":250,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/slicedToArray":24,buffer:84}],250:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/helpers/slicedToArray")),s=n(t("@babel/runtime/helpers/objectWithoutProperties")),a=n(t("@babel/runtime/helpers/classCallCheck")),u=n(t("@babel/runtime/helpers/createClass")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf"));function h(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 d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=t("../../CONST").UINT_BOUND,m=t("../../util"),g=m.assert,b=m.alignBuffer,y=t("../../util/format"),v=t("../../util/jsbi"),w=function(t){(0,c.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}(r);function r(t){var n,i=t.name,o=t.type,s=t.signed,u=void 0!==s&&s,c=t.bits,f=void 0===c?256:c;return(0,a.default)(this,r),g(Number.isInteger(f)&&0<f&&f<=256&&f%8==0,{message:"invalid bits",expect:"integer && 0<bits<=256 && bits%8==0",got:f,coder:{name:i,type:o,signed:u}}),(n=e.call(this,{name:i})).type="".concat(o).concat(f),n.signed=u,n.size=f/8,n.bound=v.leftShift(v.BigInt(1),v.BigInt(f-(n.signed?1:0))),n}return(0,u.default)(r,null,[{key:"from",value:function(t){var e=t.type,r=(0,s.default)(t,["type"]),n=e.match(/^(int|uint)([0-9]*)$/);if(n){var i=(0,o.default)(n,3),a=i[1],u=i[2];return new this(d(d({},r),{},{type:a,signed:!a.startsWith("u"),bits:u?parseInt(u,10):void 0}))}}}]),(0,u.default)(r,[{key:"encode",value:function(t){var e=y.bigInt(t),r=e;return this.signed&&v.LT(e,v.BigInt(0))&&(r=v.add(e,this.bound),e=v.add(e,p)),g(v.LE(v.BigInt(0),r)&&v.LT(r,this.bound),{message:"bound error",expect:"0<= && <".concat(this.bound),got:r.toString(),coder:this,value:t}),b(y.hexBuffer(e))}},{key:"decode",value:function(t){var e=v.BigInt("0x".concat(t.read(2*this.size)));if(this.signed&&v.GE(e,this.bound)){var r=v.leftShift(v.BigInt(1),v.BigInt(8*this.size));e=v.subtract(e,r)}return v.BigInt(e)}}]),r}(t("./BaseCoder"));e.exports=w,e.exports.uIntCoder=new w({type:"uint"})},{"../../CONST":238,"../../util":284,"../../util/format":283,"../../util/jsbi":142,"./BaseCoder":247,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/slicedToArray":24}],251:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/helpers/objectWithoutProperties")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=n(t("@babel/runtime/helpers/inherits")),c=n(t("@babel/runtime/helpers/possibleConstructorReturn")),f=n(t("@babel/runtime/helpers/getPrototypeOf"));function l(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 h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d=t("../../util").assert,p=function(t){(0,u.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,f.default)(t);if(e){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}(n);function n(){return(0,s.default)(this,n),e.apply(this,arguments)}return(0,a.default)(n,[{key:"encode",value:function(t){return d(null===t,{message:"unexpected type",expect:null,got:t,coder:this}),r.from("")}},{key:"decode",value:function(){return null}}],[{key:"from",value:function(t){var e=t.type,r=(0,o.default)(t,["type"]);if(""===e)return new this(h(h({},r),{},{type:"null"}))}}]),n}(t("./BaseCoder"));e.exports=p}).call(this)}).call(this,t("buffer").Buffer)},{"../../util":284,"./BaseCoder":247,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22,buffer:84}],252:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/helpers/objectWithoutProperties")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/get")),u=n(t("@babel/runtime/helpers/createClass")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf"));function h(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 d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=t("lodash"),m=t("../../util").assert,g=function(t){(0,c.default)(n,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}(n);function n(t){var r,i=t.type,o=t.name;return(0,s.default)(this,n),(r=e.call(this,{name:o,size:void 0})).type=i,r}return(0,u.default)(n,null,[{key:"from",value:function(t){var e=t.type,r=(0,o.default)(t,["type"]);if("string"===e)return new this(d(d({},r),{},{type:e}))}}]),(0,u.default)(n,[{key:"encode",value:function(t){return m(p.isString(t),{message:"value type error",expect:"string",got:t.constructor.name,coder:this}),(0,a.default)((0,l.default)(n.prototype),"encode",this).call(this,r.from(t))}},{key:"decode",value:function(t){return(0,a.default)((0,l.default)(n.prototype),"decode",this).call(this,t).toString()}},{key:"encodeTopic",value:function(t){return m(p.isString(t),{message:"value type error",expect:"string",got:t.constructor.name,coder:this}),(0,a.default)((0,l.default)(n.prototype),"encodeTopic",this).call(this,r.from(t))}}]),n}(t("./BytesCoder"));e.exports=g}).call(this)}).call(this,t("buffer").Buffer)},{"../../util":284,"./BytesCoder":249,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/get":10,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22,buffer:84,lodash:149}],253:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/construct")),o=n(t("@babel/runtime/helpers/typeof")),s=n(t("@babel/runtime/helpers/toConsumableArray")),a=n(t("@babel/runtime/helpers/defineProperty")),u=n(t("@babel/runtime/helpers/objectWithoutProperties")),c=n(t("@babel/runtime/helpers/createClass")),f=n(t("@babel/runtime/helpers/slicedToArray")),l=n(t("@babel/runtime/helpers/classCallCheck")),h=n(t("@babel/runtime/helpers/inherits")),d=n(t("@babel/runtime/helpers/possibleConstructorReturn")),p=n(t("@babel/runtime/helpers/getPrototypeOf")),m=n(t("@babel/runtime/helpers/wrapNativeSuper"));function g(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 b(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?g(Object(r),!0).forEach((function(e){(0,a.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,p.default)(t);if(e){var i=(0,p.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,d.default)(this,r)}}var v=t("lodash"),w=t("../../CONST").WORD_BYTES,_=t("../../util").assert,A=t("../../util/format"),E=t("../../util/namedTuple"),S=t("./BaseCoder"),M=t("./IntegerCoder").uIntCoder,x=function(t){(0,h.default)(r,t);var e=y(r);function r(){return(0,l.default)(this,r),e.apply(this,arguments)}return r}((0,m.default)(Number));function k(t,e){var n=0,i=[],o=[];return v.zip(t,e).forEach((function(t){var e=(0,f.default)(t,2),r=e[0],s=e[1],a=r.encode(s);r.dynamic?(n+=w,i.push(new x(o.length)),o.push(a)):(n+=a.length,i.push(a))})),i.forEach((function(t,e){t instanceof x&&(i[e]=M.encode(n),n+=o[t].length)})),r.concat([].concat(i,o))}function T(t,e){var r=e.index,n=t.map((function(t){if(t.dynamic){var n=A.uInt(M.decode(e));return new x(r+2*n)}return t.decode(e)}));return v.zip(t,n).forEach((function(t,r){var i=(0,f.default)(t,2),o=i[0],s=i[1];s instanceof x&&(_(Number(s)===e.index,{message:"stream.index error",expect:s,got:e.index,coder:o,stream:e}),n[r]=o.decode(e))})),n}var I=function(t){(0,h.default)(r,t);var e=y(r);function r(t){var n,i=t.name,o=t.coders;return(0,l.default)(this,r),(n=e.call(this,{name:i})).type="(".concat(o.map((function(t){return t.type})).join(","),")"),n.size=o.length,n.coders=o,n.dynamic=v.some(o,(function(t){return t.dynamic})),n.names=o.map((function(t,e){return t.name||"".concat(e)})),n.NamedTuple=E.apply(void 0,(0,s.default)(n.names)),n}return(0,c.default)(r,null,[{key:"from",value:function(t,e){var r=t.type,n=t.components,i=(0,u.default)(t,["type","components"]);if("tuple"===r)return new this(b(b({},i),{},{coders:n.map(e)}))}}]),(0,c.default)(r,[{key:"encode",value:function(t){return v.isPlainObject(t)&&(t=this.NamedTuple.fromObject(t)),_(Array.isArray(t),{message:"unexpected type",expect:"array",got:(0,o.default)(t),coder:this}),_(t.length===this.size,{message:"length not match",expect:this.size,got:t.length,coder:this}),k(this.coders,t)}},{key:"decode",value:function(t){var e=T(this.coders,t);return(0,i.default)(this.NamedTuple,(0,s.default)(e))}},{key:"encodeTopic",value:function(t){try{return A.hex64(t)}catch(t){throw new Error("not supported encode tuple to index")}}},{key:"decodeTopic",value:function(t){return t}}]),r}(S);e.exports=I,e.exports.pack=k,e.exports.unpack=T}).call(this)}).call(this,t("buffer").Buffer)},{"../../CONST":238,"../../util":284,"../../util/format":283,"../../util/namedTuple":285,"./BaseCoder":247,"./IntegerCoder":250,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/construct":7,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/slicedToArray":24,"@babel/runtime/helpers/toConsumableArray":26,"@babel/runtime/helpers/typeof":27,"@babel/runtime/helpers/wrapNativeSuper":29,buffer:84,lodash:149}],254:[function(t,e,r){"use strict";var n=t("../../util").assert,i=t("./BaseCoder"),o=t("./NullCoder"),s=t("./AddressCoder"),a=t("./IntegerCoder"),u=t("./BoolCoder"),c=t("./BytesCoder"),f=t("./StringCoder"),l=t("./TupleCoder"),h=t("./ArrayCoder");function d(t){var e=h.from(t,d)||l.from(t,d)||s.from(t)||a.from(t)||f.from(t)||c.from(t)||u.from(t)||o.from(t);return n(e instanceof i,{message:"can not found matched coder",component:t}),e}e.exports={valueCoder:d,formatType:function(t){var e=t.name,r=t.inputs;return"".concat(e,"(").concat(r.map((function(t){return d(t).type})).join(","),")")},formatFullName:function(t){var e=t.name,r=t.inputs;return"".concat(e,"(").concat(r.map((function(t){return"".concat(d(t).type," ").concat(t.indexed?"indexed ":"").concat(t.name)})).join(", "),")")}}},{"../../util":284,"./AddressCoder":245,"./ArrayCoder":246,"./BaseCoder":247,"./BoolCoder":248,"./BytesCoder":249,"./IntegerCoder":250,"./NullCoder":251,"./StringCoder":252,"./TupleCoder":253}],255:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/toConsumableArray")),o=n(t("@babel/runtime/helpers/classCallCheck")),s=n(t("@babel/runtime/helpers/createClass")),a=n(t("@babel/runtime/helpers/assertThisInitialized")),u=n(t("@babel/runtime/helpers/inherits")),c=n(t("@babel/runtime/helpers/possibleConstructorReturn")),f=n(t("@babel/runtime/helpers/getPrototypeOf"));var l=t("../../util/callable"),h=t("./EventCoder"),d=t("./LogFilter"),p=function(t){(0,u.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,f.default)(t);if(e){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}(r);function r(t,n,i){var s;return(0,o.default)(this,r),(s=e.call(this,t)).contract=n,s.conflux=i,(0,c.default)(s,l((0,a.default)(s),s.call.bind((0,a.default)(s))))}return(0,s.default)(r,[{key:"call",value:function(){for(var t=this.contract.address,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var o=[this.signature].concat((0,i.default)(this.encodeTopics(r)));return new d({address:t,topics:o},this)}}]),r}(h);e.exports=p},{"../../util/callable":282,"./EventCoder":257,"./LogFilter":258,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/toConsumableArray":26}],256:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=t("lodash"),a=t("../../util/callable"),u=function(){function t(e,r,n){return(0,i.default)(this,t),this.signatureToEvent=s.keyBy(e,"signature"),this.contract=r,this.conflux=n,a(this,this.call.bind(this))}return(0,o.default)(t,[{key:"call",value:function(){for(var t,e=[],r=[],n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];for(var s=0,a=Object.values(this.signatureToEvent);s<a.length;s++){var u=a[s];try{t=u.apply(void 0,i),e.push(u.type)}catch(t){r.push(u.type)}}if(!e.length)throw new Error('can not match override "'.concat(r.join(","),'" with args (').concat(i.join(","),")"));if(e.length>1)throw new Error('can not determine override "'.concat(e.join("|"),'" with args (').concat(i.join(","),")"));return t}},{key:"decodeLog",value:function(t){var e=t.topics[0];return this.signatureToEvent[e].decodeLog(t)}}]),t}();e.exports=u},{"../../util/callable":282,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,lodash:149}],257:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/construct")),o=n(t("@babel/runtime/helpers/toConsumableArray")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=t("../../util").assert,c=t("../../util/format"),f=t("../../util/HexStream"),l=t("../../util/namedTuple"),h=t("../abi"),d=h.formatType,p=h.formatFullName,m=h.valueCoder,g=function(){function t(e){var r=e.anonymous,n=e.name,i=e.inputs,a=void 0===i?[]:i;(0,s.default)(this,t),this.anonymous=r,this.name=n,this.fullName=p({name:n,inputs:a}),this.type=d({name:n,inputs:a}),this.signature=c.keccak256(this.type),this.inputs=a,this.inputCoders=a.map(m),this.dataCoder=m({type:"tuple",components:a.filter((function(t){return!t.indexed}))}),this.NamedTuple=l.apply(void 0,(0,o.default)(a.map((function(t,e){return t.name||"".concat(e)}))))}return(0,a.default)(t,[{key:"encodeTopics",value:function(t){var e=this;u(t.length===this.inputs.length,{message:"length not match",expect:this.inputs.length,got:t.length,coder:this.fullName});var r=[];return this.inputs.forEach((function(n,i){if(n.indexed){var o=e.inputCoders[i],s=t[i];r.push(null===s?null:c.hex(o.encodeTopic(s)))}})),r}},{key:"decodeLog",value:function(t){var e=this,r=t.topics,n=t.data;u(this.anonymous||r[0]===this.signature,{message:"decodeLog unexpected topic",expect:this.signature,got:r[0],coder:this.fullName});var s=new f(n||"0x"),a=this.dataCoder.decode(s);u(s.eof(),{message:"hex length to large",expect:"".concat(s.string.length),got:s.index,coder:this.fullName});var c=this.anonymous?0:1,l=this.inputs.map((function(t,n){if(t.indexed){var i=e.inputCoders[n],o=r[c++];return i.decodeTopic(o)}return a[t.name||n]}));return(0,i.default)(this.NamedTuple,(0,o.default)(l))}}]),t}();e.exports=g},{"../../util":284,"../../util/HexStream":280,"../../util/format":283,"../../util/namedTuple":285,"../abi":254,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/construct":7,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/toConsumableArray":26}],258:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/defineProperty")),s=n(t("@babel/runtime/helpers/asyncToGenerator")),a=n(t("@babel/runtime/helpers/classCallCheck")),u=n(t("@babel/runtime/helpers/createClass"));function c(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 f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){(0,o.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=function(){function t(e,r){var n=e.address,i=e.topics;(0,a.default)(this,t),this.address=n,this.topics=i,Reflect.defineProperty(this,"event",{value:r})}var e,r;return(0,u.default)(t,[{key:"getLogs",value:(r=(0,s.default)(i.default.mark((function t(){var e,r,n=this,o=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,this.event.conflux.getLogs(f(f({},this),e));case 3:return(r=t.sent).forEach((function(t){t.arguments=n.event.decodeLog(t)})),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"subscribeLogs",value:(e=(0,s.default)(i.default.mark((function t(){var e,r,n=this,o=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=o.length>0&&void 0!==o[0]?o[0]:{},t.next=3,this.event.conflux.subscribeLogs(f(f({},this),e));case 3:return(r=t.sent).on("data",(function(t){t.arguments=n.event.decodeLog(t)})),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}();e.exports=l},{"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/regenerator":30}],259:[function(t,e,r){"use strict";var n=t("./Contract"),i=new(t("./method/ErrorCoder"));e.exports=n,e.exports.decodeError=function(t){return i.decodeError(t)}},{"./Contract":243,"./method/ErrorCoder":267}],260:[function(t,e,r){e.exports={address:"0x0888000000000000000000000000000000000000",abi:[{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"destroy",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"getAdmin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"},{internalType:"address",name:"newAdmin",type:"address"}],name:"setAdmin",outputs:[],stateMutability:"nonpayable",type:"function"}]}},{}],261:[function(t,e,r){e.exports={address:"0x0888000000000000000000000000000000000001",abi:[{inputs:[{internalType:"address[]",name:"",type:"address[]"}],name:"addPrivilege",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"},{internalType:"address[]",name:"addresses",type:"address[]"}],name:"addPrivilegeByAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"getSponsorForCollateral",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"getSponsorForGas",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"getSponsoredBalanceForCollateral",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"getSponsoredBalanceForGas",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"getSponsoredGasFeeUpperBound",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"isAllWhitelisted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"},{internalType:"address",name:"user",type:"address"}],name:"isWhitelisted",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"",type:"address[]"}],name:"removePrivilege",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"},{internalType:"address[]",name:"addresses",type:"address[]"}],name:"removePrivilegeByAdmin",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"}],name:"setSponsorForCollateral",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractAddr",type:"address"},{internalType:"uint256",name:"upperBound",type:"uint256"}],name:"setSponsorForGas",outputs:[],stateMutability:"payable",type:"function"}]}},{}],262:[function(t,e,r){e.exports={address:"0x0888000000000000000000000000000000000002",abi:[{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getLockedStakingBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getStakingBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"},{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getVotePower",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"unlockBlockNumber",type:"uint256"}],name:"voteLock",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"}]}},{}],263:[function(t,e,r){"use strict";var n=t("./AdminControl.json"),i=t("./SponsorWhitelistControl.json"),o=t("./Staking.json");e.exports={AdminControl:n,SponsorWhitelistControl:i,Staking:o}},{"./AdminControl.json":260,"./SponsorWhitelistControl.json":261,"./Staking.json":262}],264:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=n(t("@babel/runtime/helpers/get")),a=n(t("@babel/runtime/helpers/inherits")),u=n(t("@babel/runtime/helpers/possibleConstructorReturn")),c=n(t("@babel/runtime/helpers/getPrototypeOf"));var f=t("lodash"),l=t("./ContractMethod"),h=t("../../CONST").WORD_CHARS,d=function(t){(0,a.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,c.default)(t);if(e){var i=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}(r);function r(t,n,o,s){var a;return(0,i.default)(this,r),(a=e.call(this,f.defaults(t,{name:"constructor",inputs:[]}),o,s)).signature="",a.bytecode=n,a.decodeOutputs=function(t){return t},a}return(0,o.default)(r,[{key:"call",value:function(){var t;if(!this.bytecode)throw new Error("bytecode is empty");for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var o=(t=(0,s.default)((0,c.default)(r.prototype),"call",this)).call.apply(t,[this].concat(n));return o.to=null,o}},{key:"encodeData",value:function(t){return"".concat(this.bytecode).concat((0,s.default)((0,c.default)(r.prototype),"encodeData",this).call(this,t))}},{key:"decodeData",value:function(t){for(var e=h;e<=t.length;e+=h)try{return(0,s.default)((0,c.default)(r.prototype),"decodeData",this).call(this,t.slice(-e))}catch(t){}}}]),r}(l);e.exports=d},{"../../CONST":238,"./ContractMethod":265,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":10,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,lodash:149}],265:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=n(t("@babel/runtime/helpers/assertThisInitialized")),a=n(t("@babel/runtime/helpers/inherits")),u=n(t("@babel/runtime/helpers/possibleConstructorReturn")),c=n(t("@babel/runtime/helpers/getPrototypeOf"));var f=t("../../util/callable"),l=t("./MethodTransaction"),h=function(t){(0,a.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,c.default)(t);if(e){var i=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}(r);function r(t,n,o){var a;return(0,i.default)(this,r),(a=e.call(this,t)).contract=n,a.conflux=o,(0,u.default)(a,f((0,s.default)(a),a.call.bind((0,s.default)(a))))}return(0,o.default)(r,[{key:"call",value:function(){for(var t=this.contract.address,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=this.encodeData(r);return new l({to:t,data:i},this)}}]),r}(t("./FunctionCoder"));e.exports=h},{"../../util/callable":282,"./FunctionCoder":268,"./MethodTransaction":269,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22}],266:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=t("lodash"),a=t("../../util/callable"),u=function(){function t(e,r,n){return(0,i.default)(this,t),this.signatureToMethod=s.keyBy(e,"signature"),this.contract=r,this.conflux=n,a(this,this.call.bind(this))}return(0,o.default)(t,[{key:"call",value:function(){for(var t,e=[],r=[],n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];for(var s=0,a=Object.values(this.signatureToMethod);s<a.length;s++){var u=a[s];try{t=u.apply(void 0,i),e.push(u.type)}catch(t){r.push(u.type)}}if(!e.length)throw new Error('can not match override "'.concat(r.join("|"),'" with args (').concat(i.join(","),")"));if(e.length>1)throw new Error('can not determine override "'.concat(e.join("|"),'" with args (').concat(i.join(","),")"));return t}},{key:"decodeData",value:function(t){var e=t.slice(0,10);return this.signatureToMethod[e].decodeData(t)}}]),t}();e.exports=u},{"../../util/callable":282,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,lodash:149}],267:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=n(t("@babel/runtime/helpers/inherits")),a=n(t("@babel/runtime/helpers/possibleConstructorReturn")),u=n(t("@babel/runtime/helpers/getPrototypeOf"));var c=function(t){(0,s.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,u.default)(t);if(e){var i=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}(r);function r(){return(0,i.default)(this,r),e.call(this,{name:"Error",inputs:[{type:"string",name:"message"}]})}return(0,o.default)(r,[{key:"decodeError",value:function(t){try{var e=this.decodeData(t.data).message;return new Error(e)}catch(e){return t}}}]),r}(t("./FunctionCoder"));e.exports=c},{"./FunctionCoder":268,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22}],268:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=t("../../util").assert,a=t("../../util/format"),u=t("../../util/HexStream"),c=t("../abi"),f=c.formatType,l=c.formatFullName,h=c.valueCoder,d=function(){function t(e){var r=e.name,n=e.inputs,o=void 0===n?[]:n,s=e.outputs,u=void 0===s?[]:s,c=e.stateMutability,d=void 0===c?"nonpayable":c;(0,i.default)(this,t),this.name=r,this.fullName=l({name:r,inputs:o}),this.type=f({name:r,inputs:o}),this.signature=a.keccak256(this.type).slice(0,10),this.stateMutability=d,this.inputCoder=h({type:"tuple",components:o}),this.outputCoder=h({type:"tuple",components:u})}return(0,o.default)(t,[{key:"encodeData",value:function(t){var e=a.hex(this.inputCoder.encode(t));return"".concat(this.signature).concat(e.substring(2))}},{key:"decodeData",value:function(t){var e=t.slice(0,this.signature.length);s(e===this.signature,{message:"decodeData unexpected signature",expect:this.signature,got:e,coder:this.fullName});var r=t.slice(this.signature.length),n=new u(r),i=this.inputCoder.decode(n);return s(n.eof(),{message:"hex length to large",expect:"".concat(n.string.length),got:n.index,coder:this.fullName}),i}},{key:"decodeOutputs",value:function(t){var e=new u(t),r=this.outputCoder.decode(e);return s(e.eof(),{message:"hex length to large",expect:"".concat(e.string.length),got:e.index,coder:this.fullName}),r.length<=1?r[0]:r}}]),t}();e.exports=d},{"../../util":284,"../../util/HexStream":280,"../../util/format":283,"../abi":254,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13}],269:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/asyncToGenerator")),s=n(t("@babel/runtime/helpers/defineProperty")),a=n(t("@babel/runtime/helpers/classCallCheck")),u=n(t("@babel/runtime/helpers/createClass")),c=n(t("@babel/runtime/helpers/assertThisInitialized")),f=n(t("@babel/runtime/helpers/inherits")),l=n(t("@babel/runtime/helpers/possibleConstructorReturn")),h=n(t("@babel/runtime/helpers/getPrototypeOf"));function d(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 p(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){(0,s.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,h.default)(t);if(e){var i=(0,h.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}var g=function(t){(0,f.default)(d,t);var e,r,n,s,l,h=m(d);function d(t,e){var r;return(0,a.default)(this,d),r=h.call(this,t),Reflect.defineProperty((0,c.default)(r),"method",{value:e}),r}return(0,u.default)(d,[{key:"sendTransaction",value:function(t,e){return this.method.conflux.sendTransaction(p(p({},this),t),e)}},{key:"estimateGasAndCollateral",value:(l=(0,o.default)(i.default.mark((function t(e,r){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.method.conflux.estimateGasAndCollateral(p(p({},this),e),r));case 1:case"end":return t.stop()}}),t,this)}))),function(t,e){return l.apply(this,arguments)})},{key:"call",value:(s=(0,o.default)(i.default.mark((function t(e,r){var n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.method.conflux.call(p(p({},this),e),r);case 2:return n=t.sent,t.abrupt("return",this.method.decodeOutputs(n));case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return s.apply(this,arguments)})},{key:"then",value:(n=(0,o.default)(i.default.mark((function t(e,r){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.t0=e,t.next=4,this.call();case 4:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 8:return t.prev=8,t.t2=t.catch(0),t.abrupt("return",r(t.t2));case 11:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t,e){return n.apply(this,arguments)})},{key:"catch",value:(r=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.then((function(t){return t}),e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"finally",value:(e=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this;case 3:return t.abrupt("return",t.sent);case 4:return t.prev=4,t.next=7,e();case 7:return t.finish(4);case 8:case"end":return t.stop()}}),t,this,[[0,,4,8]])}))),function(t){return e.apply(this,arguments)})}]),d}(t("../../Transaction"));e.exports=g},{"../../Transaction":242,"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/regenerator":30}],270:[function(t,e,r){e.exports={abi:[{inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}]}},{}],271:[function(t,e,r){"use strict";var n=t("./crc20.json").abi;e.exports={CRC20_ABI:n}},{"./crc20.json":270}],272:[function(t,e,r){"use strict";var n=t("./CONST"),i=t("./Conflux"),o=t("./contract"),s=t("./wallet"),a=t("./Transaction"),u=t("./Message"),c=t("./Drip"),f=t("./provider"),l=t("./util/sign"),h=t("./util/format"),d=t("./wallet/PrivateKeyAccount"),p=t("./util/address"),m=t("./util/providerWrapper");e.exports={CONST:n,Conflux:i,Contract:o,Wallet:s,Transaction:a,Message:u,Drip:c,providerFactory:f,sign:l,format:h,PrivateKeyAccount:d,address:p,providerWrapper:m}},{"./CONST":238,"./Conflux":239,"./Drip":240,"./Message":241,"./Transaction":242,"./contract":259,"./provider":277,"./util/address":281,"./util/format":283,"./util/providerWrapper":287,"./util/sign":289,"./wallet":293,"./wallet/PrivateKeyAccount":291}],273:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/regenerator")),s=n(t("@babel/runtime/helpers/asyncToGenerator")),a=n(t("@babel/runtime/helpers/classCallCheck")),u=n(t("@babel/runtime/helpers/createClass")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf"));function h(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 d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=t("events"),m=t("./RPCError"),g=function(t){(0,c.default)(i,t);var e,r,n=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}(i);function i(t){var e,r=t.url,o=t.timeout,s=void 0===o?3e5:o,u=t.logger,c=void 0===u?{info:function(){},error:function(){}}:u;return(0,a.default)(this,i),(e=n.call(this)).url=r,e.timeout=s,e.logger=c,e}return(0,u.default)(i,[{key:"requestId",value:function(){return"".concat(Date.now().toString(16)).concat(Math.random().toString(16).slice(2))}},{key:"request",value:function(){throw new Error("NotImplementError: ".concat(this.constructor.name,".request not implement."))}},{key:"requestBatch",value:function(){throw new Error("NotImplementError: ".concat(this.constructor.name,".requestBatch not implement."))}},{key:"call",value:(r=(0,s.default)(o.default.mark((function t(e){var r,n,i,s,a,u,c,f,l=arguments;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r=Date.now(),n=l.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=l[s];return a={jsonrpc:"2.0",id:this.requestId(),method:e,params:i},t.next=5,this.request(a);case 5:if(u=t.sent,c=u.result,!(f=u.error)){t.next=13;break}throw this.logger.error({data:a,error:f,duration:Date.now()-r}),new m(f,{method:e,params:i});case 13:this.logger.info({data:a,result:c,duration:Date.now()-r});case 14:return t.abrupt("return",c);case 15:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"batch",value:(e=(0,s.default)(o.default.mark((function t(e){var r,n,i,s=this;return o.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.length){t.next=2;break}return t.abrupt("return",[]);case 2:return r=Date.now(),n=e.map((function(t){return d({jsonrpc:"2.0",id:s.requestId()},t)})),t.next=6,this.requestBatch(n);case 6:return i=t.sent,this.logger.info({dataArray:n,returnArray:i,duration:Date.now()-r}),t.abrupt("return",i.map((function(t,r){var n=t.result,i=t.error;return i?new m(i,e[r]):n})));case 9:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"close",value:function(){}}]),i}(p);e.exports=g,e.exports.RPCError=m},{"./RPCError":275,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/regenerator":30,events:121}],274:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/asyncToGenerator")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=n(t("@babel/runtime/helpers/inherits")),c=n(t("@babel/runtime/helpers/possibleConstructorReturn")),f=n(t("@babel/runtime/helpers/getPrototypeOf"));function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,f.default)(t);if(e){var i=(0,f.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,c.default)(this,r)}}var h=t("superagent"),d=function(t){(0,u.default)(c,t);var e,r,n=l(c);function c(){return(0,s.default)(this,c),n.apply(this,arguments)}return(0,a.default)(c,[{key:"request",value:(r=(0,o.default)(i.default.mark((function t(e){var r,n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.post(this.url).send(e).timeout(this.timeout);case 2:return r=t.sent,n=r.body,t.abrupt("return",n||{});case 5:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"requestBatch",value:(e=(0,o.default)(i.default.mark((function t(e){var r,n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.post(this.url).send(e).timeout(this.timeout);case 2:return r=t.sent,n=r.body,t.abrupt("return",n||[]);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),c}(t("./BaseProvider"));e.exports=d},{"./BaseProvider":273,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/regenerator":30,superagent:227}],275:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/assertThisInitialized")),s=n(t("@babel/runtime/helpers/inherits")),a=n(t("@babel/runtime/helpers/possibleConstructorReturn")),u=n(t("@babel/runtime/helpers/getPrototypeOf"));var c=function(t){(0,s.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,u.default)(t);if(e){var i=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}(r);function r(t){var n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.default)(this,r),f(t,s),n=e.call(this,t),Object.assign((0,o.default)(n),t),n}return r}((0,n(t("@babel/runtime/helpers/wrapNativeSuper")).default)(Error));function f(t,e){t.message.match("0x prefix is missing")?t.data="You should connect a node with version 1.1.1 or pass a valid hex value":"Method not found"===t.message&&"cfx_sendTransaction"===e.method&&(t.data="Please use cfx.wallet.addPrivateKey() to add a account before call cfx.sendTransaction()")}e.exports=c},{"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/wrapNativeSuper":29}],276:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/asyncToGenerator")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=n(t("@babel/runtime/helpers/get")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf"));function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}var d=t("websocket").w3cwebsocket,p=t("./BaseProvider"),m=t("../util").awaitTimeout,g=function(t){(0,c.default)(g,t);var e,r,n,f,p=h(g);function g(t){var e;return(0,s.default)(this,g),(e=p.call(this,t)).websocketOptions=t,e.client=null,e.on("message",(function(t){var r=JSON.parse(t);Array.isArray(r)?r.forEach((function(t){return e._onData(t)})):e._onData(r)})),e}return(0,a.default)(g,[{key:"_connect",value:function(t){var e=this,r=t.url,n=t.protocols,i=t.origin,o=t.headers,s=t.requestOptions,a=t.clientConfig;return new Promise((function(t,u){var c=new d(r,n,i,o,s,a);c.onopen=function(){return t(c)},c.onerror=function(){return u(new Error('connect to "'.concat(r,'" failed')))},c.onmessage=function(t){var r=t.data;return e.emit("message",r)},c.onclose=function(t){var r=t.code,n=t.reason;return e.emit("close",r,n)}}))}},{key:"_onData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.id,r=t.params,n=(r=void 0===r?{}:r).subscription,i=r.result;e?this.emit(e,t):n&&this.emit(n,i)}},{key:"_awaitId",value:function(t){var e=this;return new Promise((function(r,n){var i=function(r,i){e.removeAllListeners(t),n(new Error(i))};e.once("close",i),e.once(t,(function(t){e.removeListener("close",i),r(t)}))}))}},{key:"_send",value:(f=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==this.client){t.next=12;break}return this.client=!1,t.prev=2,t.next=5,this._connect(this.websocketOptions);case 5:this.client=t.sent,t.next=12;break;case 8:throw t.prev=8,t.t0=t.catch(2),this.client=null,t.t0;case 12:if(!1!==this.client){t.next=17;break}return t.next=15,new Promise((function(t){return setTimeout(t,1)}));case 15:t.next=12;break;case 17:return t.abrupt("return",this.client.send(e));case 18:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return f.apply(this,arguments)})},{key:"request",value:(n=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._send(JSON.stringify(e));case 2:return t.next=4,m(this._awaitId(e.id),this.timeout);case 4:if(t.t0=t.sent,t.t0){t.next=7;break}t.t0={};case 7:return t.abrupt("return",t.t0);case 8:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"requestBatch",value:(r=(0,o.default)(i.default.mark((function t(e){var r=this;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._send(JSON.stringify(e));case 2:return t.abrupt("return",Promise.all(e.map(function(){var t=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",m(r._awaitId(e.id),r.timeout));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"close",value:(e=(0,o.default)(i.default.mark((function t(){var e=this;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((0,u.default)((0,l.default)(g.prototype),"close",this).call(this),null!==this.client){t.next=3;break}return t.abrupt("return");case 3:if(!1!==this.client){t.next=8;break}return t.next=6,new Promise((function(t){return setTimeout(t,1)}));case 6:t.next=3;break;case 8:return this.client.close(),t.next=11,new Promise((function(t){return e.once("close",t)}));case 11:this.client=null;case 12:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),g}(p);e.exports=g},{"../util":284,"./BaseProvider":273,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":10,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/regenerator":30,websocket:234}],277:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/defineProperty")),o=n(t("@babel/runtime/helpers/objectWithoutProperties"));function s(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 a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){(0,i.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var u=t("lodash"),c=t("./BaseProvider"),f=t("./HttpProvider"),l=t("./WebSocketProvider");e.exports=function(t){var e=t.url,r=(0,o.default)(t,["url"]);if(!e)return new c(r);if(u.startsWith(e,"http"))return new f(a({url:e},r));if(u.startsWith(e,"ws"))return new l(a({url:e},r));throw new Error("Invalid provider options")}},{"./BaseProvider":273,"./HttpProvider":274,"./WebSocketProvider":276,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/objectWithoutProperties":20,lodash:149}],278:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/toConsumableArray")),s=n(t("@babel/runtime/helpers/asyncToGenerator")),a=n(t("@babel/runtime/helpers/classCallCheck")),u=n(t("@babel/runtime/helpers/createClass"));function c(t){return new Promise((function(e){return setTimeout(e,t)}))}var f=function(){function t(e,r,n){(0,a.default)(this,t),this.conflux=e,this.func=r,this.args=n,this.promise=void 0}var e,r,n,f,l,h,d;return(0,u.default)(t,[{key:"then",value:(d=(0,s.default)(i.default.mark((function t(e,r){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.promise=this.promise||this.func.apply(this,(0,o.default)(this.args)),t.prev=1,t.t0=e,t.next=5,this.promise;case 5:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 9:return t.prev=9,t.t2=t.catch(1),t.abrupt("return",r(t.t2));case 12:case"end":return t.stop()}}),t,this,[[1,9]])}))),function(t,e){return d.apply(this,arguments)})},{key:"catch",value:(h=(0,s.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.then((function(t){return t}),e));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)})},{key:"finally",value:(l=(0,s.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this;case 3:return t.abrupt("return",t.sent);case 4:return t.prev=4,t.next=7,e();case 7:return t.finish(4);case 8:case"end":return t.stop()}}),t,this,[[0,,4,8]])}))),function(t){return l.apply(this,arguments)})},{key:"get",value:(f=(0,s.default)(i.default.mark((function t(){var e,r,n,o,s=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=s.length>0&&void 0!==s[0]?s[0]:{},r=e.delay,n=void 0===r?0:r,t.next=3,c(n);case 3:return t.next=5,this;case 5:return o=t.sent,t.abrupt("return",this.conflux.getTransactionByHash(o));case 7:case"end":return t.stop()}}),t,this)}))),function(){return f.apply(this,arguments)})},{key:"mined",value:(n=(0,s.default)(i.default.mark((function t(){var e,r,n,o,s,a,u,f,l,h=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=h.length>0&&void 0!==h[0]?h[0]:{},r=e.delta,n=void 0===r?1e3:r,o=e.timeout,s=void 0===o?6e4:o,a=Date.now(),t.next=4,this;case 4:u=t.sent,f=a;case 6:if(!(f<a+s)){t.next=17;break}return t.next=9,this.get();case 9:if(!(l=t.sent)||!l.blockHash){t.next=12;break}return t.abrupt("return",l);case 12:return t.next=14,c(f+n-Date.now());case 14:f=Date.now(),t.next=6;break;case 17:throw new Error('wait transaction "'.concat(u,'" mined timeout after ').concat(Date.now()-a," ms"));case 18:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"executed",value:(r=(0,s.default)(i.default.mark((function t(){var e,r,n,o,s,a,u,f,l,h=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=h.length>0&&void 0!==h[0]?h[0]:{},r=e.delta,n=void 0===r?1e3:r,o=e.timeout,s=void 0===o?3e5:o,a=Date.now(),t.next=4,this;case 4:u=t.sent,f=a;case 6:if(!(f<a+s)){t.next=19;break}return t.next=9,this.conflux.getTransactionReceipt(u);case 9:if(!(l=t.sent)){t.next=14;break}if(0===l.outcomeStatus){t.next=13;break}throw new Error('transaction "'.concat(u,'" executed failed, outcomeStatus ').concat(l.outcomeStatus));case 13:return t.abrupt("return",l);case 14:return t.next=16,c(f+n-Date.now());case 16:f=Date.now(),t.next=6;break;case 19:throw new Error('wait transaction "'.concat(u,'" executed timeout after ').concat(Date.now()-a," ms"));case 20:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"confirmed",value:(e=(0,s.default)(i.default.mark((function t(){var e,r,n,o,s,a,u,f,l,h,d,p=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=p.length>0&&void 0!==p[0]?p[0]:{},r=e.delta,n=void 0===r?1e3:r,o=e.timeout,s=void 0===o?18e5:o,a=e.threshold,u=void 0===a?1e-8:a,f=Date.now(),t.next=4,this;case 4:l=t.sent,h=f;case 6:if(!(h<f+s)){t.next=20;break}return t.next=9,this.executed({delta:n,timeout:s});case 9:return d=t.sent,t.next=12,this.conflux.getConfirmationRiskByHash(d.blockHash);case 12:if(!(t.sent<=u)){t.next=15;break}return t.abrupt("return",d);case 15:return t.next=17,c(h+n-Date.now());case 17:h=Date.now(),t.next=6;break;case 20:throw new Error('wait transaction "'.concat(l,'" confirmed timeout after ').concat(Date.now()-f," ms"));case 21:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}();e.exports=f},{"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/toConsumableArray":26,"@babel/runtime/regenerator":30}],279:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=n(t("@babel/runtime/helpers/inherits")),a=n(t("@babel/runtime/helpers/possibleConstructorReturn")),u=n(t("@babel/runtime/helpers/getPrototypeOf"));var c=function(t){(0,s.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,u.default)(t);if(e){var i=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}(r);function r(t){var n;return(0,i.default)(this,r),(n=e.call(this)).id=t,n}return(0,o.default)(r,[{key:"toString",value:function(){return this.id}}]),r}(t("events"));e.exports=c},{"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,events:121}],280:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=t("./index").assert,a=t("../CONST").WORD_CHARS,u=function(){function t(e){(0,i.default)(this,t),this.string=e,this.index=e.startsWith("0x")?2:0}return(0,o.default)(t,[{key:"eof",value:function(){return this.index>=this.string.length}},{key:"read",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];s(Number.isInteger(t)&&0<=t,{message:"invalid length",expect:"integer && >= 0",got:t,stream:this});var r=Math.ceil(t/a)*a,n=e?this.string.substr(this.index,t):this.string.substr(this.index+(r-t),t);return s(n.length===t,{message:"length not match",expect:t,got:n.length,stream:this}),this.index+=r,n}}]),t}();e.exports=u},{"../CONST":238,"./index":284,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13}],281:[function(t,e,r){"use strict";var n=t("lodash"),i=t("@conflux-dev/conflux-address-js"),o=i.encode,s=i.decode,a=t("./sign").checksumAddress;function u(t){return s(t)}function c(t){if(!n.isString(t))return!1;var e=t.toLowerCase().split(":");if(2!==e.length&&3!==e.length)return!1;var r=e[0];return"cfx"===r||"cfxtest"===r||r.startsWith("net")&&/^([1-9]\d*)$/.test(r.slice(3))}e.exports={encodeCfxAddress:function(t,e){return o(t,e,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},decodeCfxAddress:u,verifyCfxAddress:function(t){return u(t.toLowerCase()),!0},isValidCfxAddress:function(t){if(!n.isString(t))return!1;try{return u(t.toLowerCase()),!0}catch(t){return!1}},hasNetworkPrefix:c,ethChecksumAddress:function(t){return a(t)},simplifyCfxAddress:function(t){if(!n.isString(t)||!c(t))throw new Error("invalid base32 address");var e=t.toLocaleLowerCase().split(":");return 3!==e.length?t:"".concat(e[0],":").concat(e[2])},ethAddressToCfxAddress:function(t){return"0x1".concat(t.toLowerCase().slice(3))}}},{"./sign":289,"@conflux-dev/conflux-address-js":34,lodash:149}],282:[function(t,e,r){"use strict";var n=t("lodash");e.exports=function(t,e){if(!n.isFunction(e))throw new Error("except to be function");return new Proxy(e,{getPrototypeOf:function(){return Object.getPrototypeOf(t)},getOwnPropertyDescriptor:function(e,r){return Object.getOwnPropertyDescriptor(t,r)},has:function(e,r){return Reflect.has(t,r)},get:function(e,r){return Reflect.get(t,r)},set:function(e,r,n){return Reflect.set(t,r,n)},deleteProperty:function(e,r){return Reflect.deleteProperty(t,r)},defineProperty:function(e,r,n){return Reflect.defineProperty(t,r,n)},enumerate:function(){return Reflect.enumerate(t)},ownKeys:function(){return Reflect.ownKeys(t)}})}},{lodash:149}],283:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault")(t("@babel/runtime/helpers/toConsumableArray")),i=t("big.js"),o=t("lodash"),s=t("../CONST"),a=t("./jsbi"),u=t("./parser"),c=t("./sign"),f=t("./address"),l=new Proxy((function(){}),{apply:function(t,e,r){return u.apply(void 0,(0,n.default)(r))}});function h(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o.isObject(t)&&f.hasNetworkPrefix(t.toString())&&(t=t.toString()),o.isString(t)&&f.hasNetworkPrefix(t)){var n=f.decodeCfxAddress(t);t=n.hexAddress,e=e||n.netId}if(20!==(t=l.hexBuffer(t)).length)throw new Error('not match "hex40"');if(!e)throw new Error("expected parameter: networkId");return f.encodeCfxAddress(t,e,r)}l.any=l((function(t){return t})),l.uInt=l((function(t){if(null===t)throw new Error("".concat(t,' not match "number"'));return r.isBuffer(t)&&(t="0x".concat(t.toString("hex"))),Number(t)})).$validate((function(t){return Number.isSafeInteger(t)&&t>=0}),"uint"),l.bigInt=l((function(t){if(Number.isInteger(t)||"bigint"==typeof t||t instanceof a)return a.BigInt(t);if(o.isBoolean(t))throw new Error("".concat(t,' not match "BigInt"'));if(r.isBuffer(t))throw new Error("".concat(t,' not match "BigInt"'));return t="".concat(t).replace(/^(-?\d+)(.0+)?$/,"$1"),a.BigInt(t)})),l.bigUInt=l.bigInt.$validate((function(t){return t>=0}),"bigUInt"),l.bigUIntHex=l.bigUInt.$after((function(t){return"0x".concat(t.toString(16))})),l.big=l((function(t){return/^0[xob]/i.test(t)&&(t=a.BigInt(t)),new i(t)})),l.fixed64=l.big.$after((function(t){return Number(t.div(s.MAX_UINT))})),l.epochNumber=l.bigUIntHex.$or(s.EPOCH_NUMBER.LATEST_MINED).$or(s.EPOCH_NUMBER.LATEST_STATE).$or(s.EPOCH_NUMBER.LATEST_CONFIRMED).$or(s.EPOCH_NUMBER.LATEST_CHECKPOINT).$or(s.EPOCH_NUMBER.EARLIEST),l.hex=l((function(t){var e;if(e=o.isString(t)?t.toLowerCase():Number.isInteger(t)||"bigint"==typeof t||t instanceof a?"0x".concat(t.toString(16)):r.isBuffer(t)?"0x".concat(t.toString("hex")):o.isBoolean(t)?t?"0x01":"0x00":null===t?"0x":"".concat(t),!/^0x[0-9a-f]*$/.test(e))throw new Error("".concat(t,' not match "hex"'));return e.length%2?"0x0".concat(e.slice(2)):e})),l.hex40=l.hex.$validate((function(t){return 42===t.length}),"hex40"),l.address=l(h),l.netAddress=function(t){return l((function(e){return h(e,t)}))},l.hexAddress=l.hex40.$before((function(t){if(o.isString(t)&&f.hasNetworkPrefix(t)&&(t=f.decodeCfxAddress(t).hexAddress),o.isString(t)&&42!==t.length)throw new Error('not match "hex40"');if(o.isString(t)&&t!==t.toLowerCase()&&t!==t.toUpperCase()&&t!==c.checksumAddress(t))throw new Error('address "'.concat(t,'" checksum error'));return t})),l.checksumAddress=l.hex40.$after(c.checksumAddress),l.hex64=l.hex.$validate((function(t){return 66===t.length}),"hex64"),l.blockHash=l.hex64,l.transactionHash=l.hex64,l.privateKey=l.hex64,l.publicKey=l.hex.$validate((function(t){return 130===t.length}),"publicKey"),l.hexBuffer=l.hex.$after((function(t){return r.from(t.substr(2),"hex")})),l.bytes=l((function(t){return r.isBuffer(t)?t:r.from(t)})),l.boolean=l.any.$validate(o.isBoolean,"boolean"),l.keccak256=l.bytes.$after(c.keccak256).$after(l.hex),l.getLogs=l({limit:l.bigUIntHex,offset:l.bigUIntHex,fromEpoch:l.epochNumber,toEpoch:l.epochNumber,fromBlock:l.bigUIntHex,toBlock:l.bigUIntHex,blockHashes:l.blockHash.$or([l.blockHash]),address:l.address.$or([l.address]),topics:l([l.hex64.$or([l.hex64]).$or(null)])},{pick:!0}),l.getLogsAdvance=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?l.hexAddress:l.netAddress(t);return l({limit:l.bigUIntHex,offset:l.bigUIntHex,fromEpoch:l.epochNumber,toEpoch:l.epochNumber,fromBlock:l.bigUIntHex,toBlock:l.bigUIntHex,blockHashes:l.blockHash.$or([l.blockHash]),address:e.$or([e]),topics:l([l.hex64.$or([l.hex64]).$or(null)])},{pick:!0})},l.signTx=l({nonce:l.bigUInt.$after(l.hexBuffer),gasPrice:l.bigUInt.$after(l.hexBuffer),gas:l.bigUInt.$after(l.hexBuffer),to:l(l.hexAddress.$or(null).$default(null)).$after(l.hexBuffer),value:l.bigUInt.$default(0).$after(l.hexBuffer),storageLimit:l.bigUInt.$after(l.hexBuffer),epochHeight:l.uInt.$after(l.hexBuffer),chainId:l.uInt.$default(0).$after(l.hexBuffer),data:l.hex.$default("0x").$after(l.hexBuffer),r:l.bigUInt.$after(l.hexBuffer).$or(void 0),s:l.bigUInt.$after(l.hexBuffer).$or(void 0),v:l.uInt.$after(l.hexBuffer).$or(void 0)},{strict:!0,pick:!0}),l.callTx=l({from:l.address,nonce:l.bigUIntHex,gasPrice:l.bigUIntHex,gas:l.bigUIntHex,to:l.address.$or(null),value:l.bigUIntHex,storageLimit:l.bigUIntHex,epochHeight:l.bigUIntHex,chainId:l.bigUIntHex,data:l.hex},{pick:!0}),l.callTxAdvance=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?l.hexAddress:l.netAddress(t);return l({from:e,nonce:l.bigUIntHex,gasPrice:l.bigUIntHex,gas:l.bigUIntHex,to:e.$or(null),value:l.bigUIntHex,storageLimit:l.bigUIntHex,epochHeight:l.bigUIntHex,chainId:l.bigUIntHex,data:l.hex},{pick:!0})},l.status=l({networkId:l.uInt,chainId:l.uInt,epochNumber:l.uInt,blockNumber:l.uInt,pendingTxNumber:l.uInt,latestCheckpoint:l.uInt.$or(null),latestConfirmed:l.uInt.$or(null),latestState:l.uInt.$or(null)}),l.account=l({accumulatedInterestReturn:l.bigUInt,balance:l.bigUInt,collateralForStorage:l.bigUInt,nonce:l.bigUInt,stakingBalance:l.bigUInt}),l.estimate=l({gasUsed:l.bigUInt,gasLimit:l.bigUInt,storageCollateralized:l.bigUInt}),l.transaction=l({nonce:l.bigUInt,gasPrice:l.bigUInt,gas:l.bigUInt,value:l.bigUInt,storageLimit:l.bigUInt,epochHeight:l.uInt,chainId:l.uInt,v:l.uInt,status:l.uInt.$or(null),transactionIndex:l.uInt.$or(null)}),l.block=l({epochNumber:l.uInt.$or(null),blame:l.uInt,height:l.uInt,size:l.uInt,timestamp:l.uInt,gasLimit:l.bigUInt,gasUsed:l.bigUInt.$or(null).$or(void 0),difficulty:l.bigUInt,transactions:[l.transaction.$or(l.transactionHash)]}),l.receipt=l({index:l.uInt,epochNumber:l.uInt,outcomeStatus:l.uInt.$or(null),gasUsed:l.bigUInt,gasFee:l.bigUInt,storageCollateralized:l.bigUInt,storageReleased:[{collaterals:l.bigUInt}]}),l.epochReceipts=l([[l.receipt]]).$or(null),l.log=l({epochNumber:l.uInt,logIndex:l.uInt,transactionIndex:l.uInt,transactionLogIndex:l.uInt}),l.logs=l([l.log]),l.supplyInfo=l({totalCirculating:l.bigUInt,totalIssued:l.bigUInt,totalStaking:l.bigUInt,totalCollateral:l.bigUInt}),l.sponsorInfo=l({sponsorBalanceForCollateral:l.bigUInt,sponsorBalanceForGas:l.bigUInt,sponsorGasBound:l.bigUInt}),l.rewardInfo=l([{baseReward:l.bigUInt,totalReward:l.bigUInt,txFee:l.bigUInt}]),l.voteList=l([{amount:l.bigUInt}]),l.depositList=l([{amount:l.bigUInt,accumulatedInterestRate:l.bigUInt}]),l.head=l({difficulty:l.bigUInt,epochNumber:l.uInt.$or(null),gasLimit:l.bigUInt,height:l.uInt,timestamp:l.uInt}),l.revert=l({revertTo:l.uInt}),l.epoch=l({epochNumber:l.uInt}),l.action=l({action:{from:l.any,to:l.any,value:l.bigUInt,gas:l.bigUInt,gasLeft:l.bigUInt,input:l.hex,init:l.hex,returnData:l.hex,callType:l.any,outcome:l.uInt,addr:l.any},epochNumber:l.bigUInt,epochHash:l.hex,blockHash:l.hex,transactionHash:l.hex,transactionPosition:l.bigUInt,type:l.any},{pick:!0}),l.txTraces=l({traces:[l.action],transactionPosition:l.bigUInt}),l.blockTraces=l({transactionTraces:[l.txTraces],epochNumber:l.bigUInt}).$or(null),l.traces=l([l.action]).$or(null),l.traceFilter=l({fromEpoch:l.epochNumber.$or(null),toEpoch:l.epochNumber.$or(null),blockHashes:l([l.blockHash]).$or(null),after:l.bigUIntHex.$or(null),count:l.bigUIntHex.$or(null),actionTypes:l([l.any]).$or(null)}),l.accountPendingInfo=l({localNonce:l.bigUInt,pendingCount:l.bigUInt,pendingNonce:l.bigUInt}),e.exports=l}).call(this)}).call(this,t("buffer").Buffer)},{"../CONST":238,"./address":281,"./jsbi":142,"./parser":286,"./sign":289,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/toConsumableArray":26,"big.js":50,buffer:84,lodash:149}],284:[function(t,e,r){(function(r){(function(){"use strict";var n=t("lodash"),i=t("../CONST").WORD_BYTES;e.exports={assert:function(t,e){if(!t)throw n.isPlainObject(e)&&(e=JSON.stringify(e)),new Error(e)},alignBuffer:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=i-t.length%i;return 0<n&&n<i&&(t=e?r.concat([t,r.alloc(n)]):r.concat([r.alloc(n),t])),t},awaitTimeout:function(t,e){return new Promise((function(r,n){var i=new Error("Timeout after ".concat(e," ms")),o=setTimeout((function(){return n(i)}),e);t.then(r).catch(n).finally((function(){return clearTimeout(o)}))}))}}}).call(this)}).call(this,t("buffer").Buffer)},{"../CONST":238,buffer:84,lodash:149}],285:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/construct")),o=n(t("@babel/runtime/helpers/toConsumableArray")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=n(t("@babel/runtime/helpers/assertThisInitialized")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf")),h=n(t("@babel/runtime/helpers/wrapNativeSuper"));function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}e.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n={};e.forEach((function(t,e){n[t]=e}));var l=function(t){(0,c.default)(l,t);var r=d(l);function l(){var t;(0,s.default)(this,l);for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return t=r.call.apply(r,[this].concat(i)),(0,f.default)(t,new Proxy((0,u.default)(t),{has:function(e,r){return void 0!==n[r]||r in(0,u.default)(t)},get:function(e,r){var i=n[r];return void 0===i?t[r]:t[i]},set:function(){throw new Error("can not change element to a NamedTuple")},deleteProperty:function(){throw new Error("can not delete element to a NamedTuple")}}))}return(0,a.default)(l,[{key:"toObject",value:function(){var t=this,r={};return e.forEach((function(e){r[e]=t[e]})),r}}],[{key:"fromObject",value:function(t){return(0,i.default)(this,(0,o.default)(e.map((function(e){return t[e]}))))}},{key:"name",get:function(){return"NamedTuple(".concat(e.join(","),")")}}]),l}((0,h.default)(Array));return l}},{"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/construct":7,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/toConsumableArray":26,"@babel/runtime/helpers/wrapNativeSuper":29}],286:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/typeof")),o=n(t("@babel/runtime/helpers/defineProperty")),s=n(t("@babel/runtime/helpers/toConsumableArray")),a=n(t("@babel/runtime/helpers/createClass")),u=n(t("@babel/runtime/helpers/classCallCheck")),c=n(t("@babel/runtime/helpers/assertThisInitialized")),f=n(t("@babel/runtime/helpers/inherits")),l=n(t("@babel/runtime/helpers/possibleConstructorReturn")),h=n(t("@babel/runtime/helpers/getPrototypeOf")),d=n(t("@babel/runtime/helpers/wrapNativeSuper"));function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function m(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 g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?m(Object(r),!0).forEach((function(e){(0,o.default)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var b=t("lodash"),y=function(t){(0,f.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,h.default)(t);if(e){var i=(0,h.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,l.default)(this,r)}}(r);function r(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.default)(this,r),(n=e.call(this)).message=t,Object.assign((0,c.default)(n),i),n}return r}((0,d.default)(Error)),v=function(){function t(e){(0,u.default)(this,t),this.arguments=e,this.path=[]}return(0,a.default)(t,[{key:"child",value:function(e){var r=new t(this.arguments);return r.path=[].concat((0,s.default)(this.path),[e]),r}},{key:"error",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new y('path="'.concat(this.path.join("."),'", ').concat(t),g(g({},this),e))}}]),t}();function w(t){function e(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=this instanceof v?this:new v(arguments);try{return t.call.apply(t,[i].concat(r))}catch(t){throw new y(t.message,t)}}return e.constructor=w,e.$before=_,e.$parse=E,e.$default=A,e.$after=S,e.$validate=M,e.$or=x,e}function _(t){var e=this;return w((function(){var r;try{r=t.apply(void 0,arguments)}catch(t){throw this.error(t.message)}return e.call(this,r)}))}function A(t){return _.call(this,(function(e){return void 0===e?t:e}))}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.isString;return _.call(this,(function(r){return e(r)?t(r):r}))}function S(t){var e=this;return w((function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var o=e.call.apply(e,[this].concat(n));try{return t(o)}catch(t){throw this.error(t.message)}}))}function M(t,e){return S.call(this,(function(r){if(!t(r))throw new Error("".concat(r,' do not match "').concat(e||t.name||"$validate",'"'));return r}))}function x(t){var e=[this,w.from(t)];return w((function(t){var r,n=[],i=function(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;try{return o.call(this,t)}catch(t){n.push(t)}}}catch(t){i.e(t)}finally{i.f()}var s=n.map((function(t){return t.or?t.or:t})),a=b.flattenDeep(s).map((function(t){return"(".concat(t.message,")")})).join(" or ");throw new y("not match any ".concat(a),{or:s})}))}w.fromArray=function(t,e){var r=w.from(t.length?t[0]:function(t){return t},e);return w((function(t){var e=this;if(!Array.isArray(t))throw this.error("expected array, got ".concat((0,i.default)(t)));return t.map((function(t,n){return r.call(e.child(n),t)}))}))},w.fromObject=function(t,e){var r=e.strict,n=e.pick,o=b.mapValues(t,(function(t){return w.from(t,e)}));return w((function(t){var e=this;if(!b.isObject(t))throw this.error("expected plain object, got ".concat((0,i.default)(t)));var s=b.mapValues(o,(function(n,i){var o=b.get(t,i);if(void 0!==o||r)return n.call(e.child(i),o)}));return n?b.pickBy(s,(function(t){return void 0!==t})):g(g({},t),s)}))},w.fromFunction=function(t){return t.constructor===w?t:w((function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];try{return t.apply(void 0,r)}catch(e){throw this.error("".concat(t.name,"(").concat(r.join(","),"), ").concat(e.message))}}))},w.fromValue=function(t){return w((function(e){if(e!==t)throw this.error("expected to be ".concat(t,", got ").concat(e));return e}))},w.from=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(t)?w.fromArray(t,e):b.isPlainObject(t)?w.fromObject(t,e):b.isFunction(t)?w.fromFunction(t):w.fromValue(t)},e.exports=w.from},{"@babel/runtime/helpers/assertThisInitialized":4,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/toConsumableArray":26,"@babel/runtime/helpers/typeof":27,"@babel/runtime/helpers/wrapNativeSuper":29,lodash:149}],287:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/asyncToGenerator")),s=t("../Transaction"),a=t("../CONST").MIN_GAS_PRICE,u=t("./sign"),c=t("./format");function f(t){return{r:t.slice(0,66),s:"0x".concat(t.slice(66,130)),v:Number("0x".concat(t.slice(130,132)))-27}}function l(t){return h.apply(this,arguments)}function h(){return(h=(0,o.default)(i.default.mark((function t(e){var r,n,o,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new s(e),n=c.hex(u.keccak256(r.encode(!1))),t.next=4,ethereum.request({method:"eth_sign",params:[ethereum.selectedAddress,n]});case 4:return o=t.sent,a=f(o),r.r=a.r,r.s=a.s,r.v=a.v,t.abrupt("return",r.serialize());case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function d(t,e){return p.apply(this,arguments)}function p(){return(p=(0,o.default)(i.default.mark((function t(e,r){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.chainId){t.next=4;break}return t.next=3,r({method:"eth_chainId"});case 3:e.chainId=t.sent;case 4:if(e.gasPrice||(e.gasPrice=a),e.nonce){t.next=9;break}return t.next=8,r({method:"eth_getTransactionCount",params:[e.from]});case 8:e.nonce=t.sent;case 9:if(e.epochHeight){t.next=13;break}return t.next=12,r({method:"eth_blockNumber",params:[]});case 12:e.epochHeight=t.sent;case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(t,e){return g.apply(this,arguments)}function g(){return(g=(0,o.default)(i.default.mark((function t(e,r){var n,o,s,u,f,l;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.chainId){t.next=6;break}return t.next=3,r("cfx_getStatus");case 3:n=t.sent,o=n.chainId,e.chainId=o;case 6:if(e.gas&&e.storageLimit){t.next=18;break}if(s=Number(e.chainId),!isNaN(s)){t.next=10;break}throw new Error("Invalid chainId");case 10:return e=c.callTxAdvance()(e),t.next=13,r("cfx_estimateGasAndCollateral",e);case 13:u=t.sent,f=u.gasLimit,l=u.storageCollateralized,e.gas||(e.gas=f),e.storageLimit||(e.storageLimit=l);case 18:if(e.gasPrice||(e.gasPrice=a),e.nonce){t.next=23;break}return t.next=22,r("cfx_getNextNonce",e.from);case 22:e.nonce=t.sent;case 23:if(e.epochHeight){t.next=27;break}return t.next=26,r("cfx_epochNumber");case 26:e.epochHeight=t.sent;case 27:return t.abrupt("return",e);case 28:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.exports={wrapEthereum:function(t){if("undefined"==typeof ethereum)throw new Error("MetaMask is not installed!");var e=t.request;function r(){return(r=(0,o.default)(i.default.mark((function t(r){var n,o,s,a;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.method,o=r.params,"eth_sendTransaction"===n){t.next=3;break}return t.abrupt("return",e(r));case 3:if((s=o[0]).gas&&s.storageLimit){t.next=6;break}throw new Error("'gas' and 'storageLimit' field is needed");case 6:return t.next=8,d(s,e);case 8:return t.next=10,l(s);case 10:return a=t.sent,t.abrupt("return",e({method:"eth_sendRawTransaction",params:[a]}));case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}t.request=function(t){return r.apply(this,arguments)}.bind(t)},wrapConflux:function(t){if("undefined"==typeof ethereum)throw new Error("MetaMask is not installed!");var e=t.call.bind(t);function r(){return(r=(0,o.default)(i.default.mark((function t(r){var n,o,s,a,u,c=arguments;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=c.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=c[s];if("cfx_sendTransaction"===r){t.next=3;break}return t.abrupt("return",e.apply(void 0,[r].concat(o)));case 3:return a=o[0],t.next=6,m(a,e);case 6:return a=t.sent,t.next=9,l(a);case 9:return u=t.sent,t.abrupt("return",e("cfx_sendRawTransaction",u));case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}t.call=function(t){return r.apply(this,arguments)}.bind(t)}}},{"../CONST":238,"../Transaction":242,"./format":283,"./sign":289,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/regenerator":30}],288:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault")(t("@babel/runtime/helpers/toConsumableArray"));function i(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.concat(e.map((function(t){if(r.isBuffer(t))return t;if(Number.isSafeInteger(t)&&t>=0){var e=t.toString(16);return r.from(e.length%2?"0".concat(e):e,"hex")}throw new Error("invalid value, expect unsigned integer or buffer, got ".concat(t))})))}function o(t,e){if(t<=55)return i(t+e);var r=i(t);return i(e+55+r.length,r)}e.exports={encode:function t(e){if(r.isBuffer(e))return function(t){return 1===t.length&&0===t[0]&&(t=r.from("")),1===t.length&&t[0]<128?t:i(o(t.length,128),t)}(e);if(Array.isArray(e))return s=e,a=i.apply(void 0,(0,n.default)(s.map(t))),i(o(a.length,192),a);var s,a;throw new Error("invalid value, expect buffer or array, got ".concat(e))}}}).call(this)}).call(this,t("buffer").Buffer)},{"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/toConsumableArray":26,buffer:84}],289:[function(t,e,r){(function(r){(function(){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/typeof")),o=n(t("@babel/runtime/helpers/slicedToArray")),s=t("crypto"),a=t("keccak"),u=t("secp256k1"),c=t("scrypt-js").syncScrypt;function f(t){return a("keccak256").update(t).digest()}function l(t){return s.randomBytes(t)}function h(t){return u.publicKeyCreate(t,!1).slice(1)}function d(t){var e=f(t).slice(-20);return e[0]=15&e[0]|16,e}function p(t){return d(h(t))}e.exports={keccak256:f,checksumAddress:function(t){var e=t.toLowerCase().replace("0x",""),n=f(r.from(e)).toString("hex"),i=Object.entries(e).map((function(t){var e=(0,o.default)(t,2),r=e[0],i=e[1];return parseInt(n[r],16)>=8?i.toUpperCase():i}));return"0x".concat(i.join(""))},randomBuffer:l,randomPrivateKey:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l(32);if(!r.isBuffer(t)||32!==t.length)throw new Error('entropy must be 32 length Buffer, got "'.concat((0,i.default)(t),'"'));var e=f(r.concat([l(32),t]));return f(r.concat([l(32),e,l(32)]))},privateKeyToPublicKey:h,publicKeyToAddress:d,privateKeyToAddress:p,ecdsaSign:function(t,e){var r=u.sign(t,e);return{r:r.signature.slice(0,32),s:r.signature.slice(32,64),v:r.recovery}},ecdsaRecover:function(t,e){var n=e.r,i=e.s,o=e.v,s=u.recover(t,r.concat([n,i]),o);return u.publicKeyConvert(s,!1).slice(1)},encrypt:function(t,e){var n=l(32),i=l(16);e=r.from(e);var o=c(e,n,8192,8,1,32),a=s.createCipheriv("aes-128-ctr",o.slice(0,16),i).update(t),u=f(r.concat([o.slice(16,32),a])),h=p(t);return{version:3,id:[4,2,2,2,6].map(l).map((function(t){return t.toString("hex")})).join("-"),address:h.toString("hex"),crypto:{ciphertext:a.toString("hex"),cipherparams:{iv:i.toString("hex")},cipher:"aes-128-ctr",kdf:"scrypt",kdfparams:{dklen:32,salt:n.toString("hex"),n:8192,r:8,p:1},mac:u.toString("hex")}}},decrypt:function(t,e){var n=t.version,i=t.crypto,o=i.ciphertext,a=i.cipherparams.iv,u=i.cipher,l=i.kdf,h=i.kdfparams,d=h.dklen,p=h.salt,m=h.n,g=h.r,b=h.p,y=i.mac;if(3!==n)throw new Error("Not a valid V3 wallet");if("scrypt"!==l)throw new Error('Unsupported kdf "'.concat(l,'", only support "scrypt"'));e=r.from(e),o=r.from(o,"hex"),a=r.from(a,"hex"),p=r.from(p,"hex"),y=r.from(y,"hex");var v=c(e,p,m,g,b,d);if(!f(r.concat([v.slice(16,32),o])).equals(y))throw new Error("Key derivation failed, possibly wrong password!");return s.createDecipheriv(u,v.slice(0,16),a).update(o)}}}).call(this)}).call(this,t("buffer").Buffer)},{"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/slicedToArray":24,"@babel/runtime/helpers/typeof":27,buffer:84,crypto:93,keccak:143,"scrypt-js":194,secp256k1:195}],290:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/asyncToGenerator")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/createClass")),u=t("../Transaction"),c=t("../Message"),f=function(){function t(e){(0,s.default)(this,t),this.address=e}var e,r;return(0,a.default)(t,[{key:"signTransaction",value:(r=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new u(e));case 1:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})},{key:"signMessage",value:(e=(0,o.default)(i.default.mark((function t(e){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new c(e));case 1:case"end":return t.stop()}}),t)}))),function(t){return e.apply(this,arguments)})},{key:"toString",value:function(){return this.address}},{key:"toJSON",value:function(){return this.address}}]),t}();e.exports=f},{"../Message":241,"../Transaction":242,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/regenerator":30}],291:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/regenerator")),o=n(t("@babel/runtime/helpers/asyncToGenerator")),s=n(t("@babel/runtime/helpers/classCallCheck")),a=n(t("@babel/runtime/helpers/get")),u=n(t("@babel/runtime/helpers/createClass")),c=n(t("@babel/runtime/helpers/inherits")),f=n(t("@babel/runtime/helpers/possibleConstructorReturn")),l=n(t("@babel/runtime/helpers/getPrototypeOf"));function h(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,l.default)(t);if(e){var i=(0,l.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,f.default)(this,r)}}var d=t("../util").assert,p=t("../util/format"),m=t("../util/sign"),g=function(t){(0,c.default)(f,t);var e,r,n=h(f);function f(t,e){var r;(0,s.default)(this,f);var i=p.hexBuffer(t),o=m.privateKeyToPublicKey(i),a=m.publicKeyToAddress(o);return(r=n.call(this,p.address(a,e))).publicKey=p.publicKey(o),r.privateKey=p.privateKey(i),r.networkId=e,r}return(0,u.default)(f,null,[{key:"random",value:function(t,e){return new this(m.randomPrivateKey(void 0===t?void 0:p.hexBuffer(t)),e)}},{key:"decrypt",value:function(t,e,r){return new this(m.decrypt(t,e),r)}}]),(0,u.default)(f,[{key:"encrypt",value:function(t){return m.encrypt(p.hexBuffer(this.privateKey),t)}},{key:"signTransaction",value:(r=(0,o.default)(i.default.mark((function t(e){var r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,a.default)((0,l.default)(f.prototype),"signTransaction",this).call(this,e);case 2:return(r=t.sent).sign(this.privateKey,this.networkId),d(r.from===this.address,{message:"Invalid sign transaction.from",expected:this.address,got:r.from}),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"signMessage",value:(e=(0,o.default)(i.default.mark((function t(e){var r;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,a.default)((0,l.default)(f.prototype),"signMessage",this).call(this,e);case 2:return(r=t.sent).sign(this.privateKey,this.networkId),d(r.from===this.address,{message:"Invalid sign message.from",expected:this.address,got:r.from}),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),f}(t("./Account"));e.exports=g},{"../util":284,"../util/format":283,"../util/sign":289,"./Account":290,"@babel/runtime/helpers/asyncToGenerator":5,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":10,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/regenerator":30}],292:[function(t,e,r){"use strict";var n=t("@babel/runtime/helpers/interopRequireDefault"),i=n(t("@babel/runtime/helpers/classCallCheck")),o=n(t("@babel/runtime/helpers/createClass")),s=n(t("@babel/runtime/helpers/get")),a=n(t("@babel/runtime/helpers/inherits")),u=n(t("@babel/runtime/helpers/possibleConstructorReturn")),c=n(t("@babel/runtime/helpers/getPrototypeOf")),f=n(t("@babel/runtime/helpers/wrapNativeSuper"));var l=t("../util").assert,h=t("../util/format"),d=t("./Account"),p=t("./PrivateKeyAccount"),m=function(t){(0,a.default)(r,t);var e=function(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,c.default)(t);if(e){var i=(0,c.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,u.default)(this,r)}}(r);function r(t){var n;return(0,i.default)(this,r),(n=e.call(this)).networkId=t,n}return(0,o.default)(r,[{key:"setNetworkId",value:function(t){this.networkId=t}},{key:"has",value:function(t){try{return t=h.address(t,this.networkId),(0,s.default)((0,c.default)(r.prototype),"has",this).call(this,t)}catch(t){return!1}}},{key:"delete",value:function(t){try{return t=h.address(t,this.networkId),(0,s.default)((0,c.default)(r.prototype),"delete",this).call(this,t)}catch(t){return!1}}},{key:"clear",value:function(){return(0,s.default)((0,c.default)(r.prototype),"clear",this).call(this)}},{key:"set",value:function(t,e){return t=h.address(t,this.networkId),l(!this.has(t),'Wallet already has account "'.concat(t,'"')),l(e instanceof d,"value not instance of Account, got ".concat(e)),(0,s.default)((0,c.default)(r.prototype),"set",this).call(this,t,e)}},{key:"get",value:function(t){t=h.address(t,this.networkId);var e=(0,s.default)((0,c.default)(r.prototype),"get",this).call(this,t);return l(e instanceof d,'can not found Account by "'.concat(t,'"')),e}},{key:"addPrivateKey",value:function(t){this.networkId||console.warn("wallet.addPrivateKey: networkId is not set properly, please set it");var e=new p(t,this.networkId);return this.set(e.address,e),e}},{key:"addRandom",value:function(t){var e=p.random(t,this.networkId);return this.set(e.address,e),e}},{key:"addKeystore",value:function(t,e){var r=p.decrypt(t,e,this.networkId);return this.set(r.address,r),r}}]),r}((0,f.default)(Map));e.exports=m},{"../util":284,"../util/format":283,"./Account":290,"./PrivateKeyAccount":291,"@babel/runtime/helpers/classCallCheck":6,"@babel/runtime/helpers/createClass":8,"@babel/runtime/helpers/get":10,"@babel/runtime/helpers/getPrototypeOf":11,"@babel/runtime/helpers/inherits":12,"@babel/runtime/helpers/interopRequireDefault":13,"@babel/runtime/helpers/possibleConstructorReturn":22,"@babel/runtime/helpers/wrapNativeSuper":29}],293:[function(t,e,r){"use strict";e.exports=t("./Wallet")},{"./Wallet":292}]},{},[272])(272)},583:(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,f=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="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],b=["hex","buffer","arrayBuffer","array","digest"],y={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!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 v=function(t,e,r){return function(n){return new O(t,e,t).update(n)[r]()}},w=function(t,e,r){return function(n,i){return new O(t,e,i).update(n)[r]()}},_=function(t,e,r){return function(e,n,i,o){return x["cshake"+t].update(e,n,i,o)[r]()}},A=function(t,e,r){return function(e,n,i,o){return x["kmac"+t].update(e,n,i,o)[r]()}},E=function(t,e,r,n){for(var i=0;i<b.length;++i){var o=b[i];t[o]=e(r,n,o)}return t},S=function(t,e){var r=v(t,e,"hex");return r.create=function(){return new O(t,e,t)},r.update=function(t){return r.create().update(t)},E(r,v,t,e)},M=[{name:"keccak",padding:[1,256,65536,16777216],bits:m,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:m,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(t,e){var r=w(t,e,"hex");return r.create=function(r){return new O(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},E(r,w,t,e)}},{name:"cshake",padding:h,bits:g,createMethod:function(t,e){var r=y[t],n=_(t,0,"hex");return n.create=function(n,i,o){return i||o?new O(t,e,n).bytepad([i,o],r):x["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},E(n,_,t,e)}},{name:"kmac",padding:h,bits:g,createMethod:function(t,e){var r=y[t],n=A(t,0,"hex");return n.create=function(n,i,o){return new P(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},E(n,A,t,e)}}],x={},k=[],T=0;T<M.length;++T)for(var I=M[T],C=I.bits,R=0;R<C.length;++R){var B=I.name+"_"+C[R];if(k.push(B),x[B]=I.createMethod(C[R],I.padding),"sha3"!==I.name){var N=I.name+C[R];k.push(N),x[N]=x[B]}}function O(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>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 P(t,e,r){O.call(this,t,e,r)}O.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(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&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,l=0,h=this.s;l<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(e)for(n=this.start;l<u&&n<a;++l)s[n>>2]|=t[l]<<d[3&n++];else for(n=this.start;l<u&&n<a;++l)(o=t.charCodeAt(l))<128?s[n>>2]|=o<<d[3&n++]:o<2048?(s[n>>2]|=(192|o>>6)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]):o<55296||o>=57344?(s[n>>2]|=(224|o>>12)<<d[3&n++],s[n>>2]|=(128|o>>6&63)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),s[n>>2]|=(240|o>>18)<<d[3&n++],s[n>>2]|=(128|o>>12&63)<<d[3&n++],s[n>>2]|=(128|o>>6&63)<<d[3&n++],s[n>>2]|=(128|63&o)<<d[3&n++]);if(this.lastByteIndex=n,n>=a){for(this.start=n-a,this.block=s[c],n=0;n<c;++n)h[n]^=s[n];D(h),this.reset=!0}else this.start=n}return this},O.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},O.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(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&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<t.length;++s){var a=t.charCodeAt(s);a<128?n+=1:a<2048?n+=2:a<55296||a>=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(t),n},O.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];D(n)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<e&&s<n;++o,++s)t=r[o],a+=l[t>>4&15]+l[15&t]+l[t>>12&15]+l[t>>8&15]+l[t>>20&15]+l[t>>16&15]+l[t>>28&15]+l[t>>24&15];s%e==0&&(D(r),o=0)}return i&&(t=r[o],a+=l[t>>4&15]+l[15&t],i>1&&(a+=l[t>>12&15]+l[t>>8&15]),i>2&&(a+=l[t>>20&15]+l[t>>16&15])),a},O.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<n;){for(o=0;o<e&&s<n;++o,++s)u[s]=r[o];s%e==0&&D(r)}return i&&(u[o]=r[o],t=t.slice(0,a)),t},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,u=[];a<i;){for(s=0;s<r&&a<i;++s,++a)t=a<<2,e=n[s],u[t]=255&e,u[t+1]=e>>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&D(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},P.prototype=new O,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var D=function(t){var e,r,n,i,o,s,a,u,c,f,l,h,d,m,g,b,y,v,w,_,A,E,S,M,x,k,T,I,C,R,B,N,O,P,D,L,U,j,F,q,z,H,K,G,W,V,$,X,Y,J,Z,Q,tt,et,rt,nt,it,ot,st,at,ut,ct,ft;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],f=t[6]^t[16]^t[26]^t[36]^t[46],l=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^(f<<1|l>>>31),r=a^(l<<1|f>>>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=f^(i<<1|o>>>31),r=l^(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,$=t[10]<<4|t[11]>>>28,I=t[20]<<3|t[21]>>>29,C=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,P=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,X=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,R=t[33]<<13|t[32]>>>19,B=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,v=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,J=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,N=t[45]<<29|t[44]>>>3,O=t[44]<<29|t[45]>>>3,M=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,j=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,A=t[37]<<21|t[36]>>>11,Q=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,k=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,q=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~b&v,t[1]=g^~y&w,t[10]=M^~k&I,t[11]=x^~T&C,t[20]=P^~L&j,t[21]=D^~U&F,t[30]=G^~V&X,t[31]=W^~$&Y,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=b^~v&_,t[3]=y^~w&A,t[12]=k^~I&R,t[13]=T^~C&B,t[22]=L^~j&q,t[23]=U^~F&z,t[32]=V^~X&J,t[33]=$^~Y&Z,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=v^~_&E,t[5]=w^~A&S,t[14]=I^~R&N,t[15]=C^~B&O,t[24]=j^~q&H,t[25]=F^~z&K,t[34]=X^~J&Q,t[35]=Y^~Z&tt,t[44]=ot^~at&ct,t[45]=st^~ut&ft,t[6]=_^~E&m,t[7]=A^~S&g,t[16]=R^~N&M,t[17]=B^~O&x,t[26]=q^~H&P,t[27]=z^~K&D,t[36]=J^~Q&G,t[37]=Z^~tt&W,t[46]=at^~ct&et,t[47]=ut^~ft&rt,t[8]=E^~m&b,t[9]=S^~g&y,t[18]=N^~M&k,t[19]=O^~x&T,t[28]=H^~P&L,t[29]=K^~D&U,t[38]=Q^~G&V,t[39]=tt^~W&$,t[48]=ct^~et&nt,t[49]=ft^~rt&it,t[0]^=p[n],t[1]^=p[n+1]};if(u)t.exports=x;else{for(T=0;T<k.length;++T)s[k[T]]=x[k[T]];c&&(void 0===(n=function(){return x}.call(e,r,e,t))||(t.exports=n))}}()},9757:(t,e,r)=>{var n;!function(){"use strict";var e="input is invalid type",i="object"==typeof window,o=i?window:{};o.JS_SHA512_NO_WINDOW&&(i=!1);var s=!i&&"object"==typeof self;!o.JS_SHA512_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?o=r.g:s&&(o=self);var a=!o.JS_SHA512_NO_COMMON_JS&&t.exports,u=r.amdO,c=!o.JS_SHA512_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),l=[-2147483648,8388608,32768,128],h=[24,16,8,0],d=[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],p=["hex","array","digest","arrayBuffer"],m=[];!o.JS_SHA512_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!c||!o.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var g=function(t,e){return function(r){return new w(e,!0).update(r)[t]()}},b=function(t){var e=g("hex",t);e.create=function(){return new w(t)},e.update=function(t){return e.create().update(t)};for(var r=0;r<p.length;++r){var n=p[r];e[n]=g(n,t)}return e},y=function(t,e){return function(r,n){return new _(r,e,!0).update(n)[t]()}},v=function(t){var e=y("hex",t);e.create=function(e){return new _(e,t)},e.update=function(t,r){return e.create(t).update(r)};for(var r=0;r<p.length;++r){var n=p[r];e[n]=y(n,t)}return e};function w(t,e){e?(m[0]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=m[16]=m[17]=m[18]=m[19]=m[20]=m[21]=m[22]=m[23]=m[24]=m[25]=m[26]=m[27]=m[28]=m[29]=m[30]=m[31]=m[32]=0,this.blocks=m):this.blocks=[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],384==t?(this.h0h=3418070365,this.h0l=3238371032,this.h1h=1654270250,this.h1l=914150663,this.h2h=2438529370,this.h2l=812702999,this.h3h=355462360,this.h3l=4144912697,this.h4h=1731405415,this.h4l=4290775857,this.h5h=2394180231,this.h5l=1750603025,this.h6h=3675008525,this.h6l=1694076839,this.h7h=1203062813,this.h7l=3204075428):256==t?(this.h0h=573645204,this.h0l=4230739756,this.h1h=2673172387,this.h1l=3360449730,this.h2h=596883563,this.h2l=1867755857,this.h3h=2520282905,this.h3l=1497426621,this.h4h=2519219938,this.h4l=2827943907,this.h5h=3193839141,this.h5l=1401305490,this.h6h=721525244,this.h6l=746961066,this.h7h=246885852,this.h7l=2177182882):224==t?(this.h0h=2352822216,this.h0l=424955298,this.h1h=1944164710,this.h1l=2312950998,this.h2h=502970286,this.h2l=855612546,this.h3h=1738396948,this.h3l=1479516111,this.h4h=258812777,this.h4l=2077511080,this.h5h=2011393907,this.h5l=79989058,this.h6h=1067287976,this.h6l=1780299464,this.h7h=286451373,this.h7l=2446758561):(this.h0h=1779033703,this.h0l=4089235720,this.h1h=3144134277,this.h1l=2227873595,this.h2h=1013904242,this.h2l=4271175723,this.h3h=2773480762,this.h3l=1595750129,this.h4h=1359893119,this.h4l=2917565137,this.h5h=2600822924,this.h5l=725511199,this.h6h=528734635,this.h6l=4215389547,this.h7h=1541459225,this.h7l=327033209),this.bits=t,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1}function _(t,r,n){var i,o=typeof t;if("string"!==o){if("object"!==o)throw new Error(e);if(null===t)throw new Error(e);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(e);i=!0}var s=t.length;if(!i){for(var a,u=[],f=(s=t.length,0),l=0;l<s;++l)(a=t.charCodeAt(l))<128?u[f++]=a:a<2048?(u[f++]=192|a>>6,u[f++]=128|63&a):a<55296||a>=57344?(u[f++]=224|a>>12,u[f++]=128|a>>6&63,u[f++]=128|63&a):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++l)),u[f++]=240|a>>18,u[f++]=128|a>>12&63,u[f++]=128|a>>6&63,u[f++]=128|63&a);t=u}t.length>128&&(t=new w(r,!0).update(t).array());var h=[],d=[];for(l=0;l<128;++l){var p=t[l]||0;h[l]=92^p,d[l]=54^p}w.call(this,r,n),this.update(d),this.oKeyPad=h,this.inner=!0,this.sharedMemory=n}w.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(c&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||c&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,s=0,a=t.length,u=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=u[16]=u[17]=u[18]=u[19]=u[20]=u[21]=u[22]=u[23]=u[24]=u[25]=u[26]=u[27]=u[28]=u[29]=u[30]=u[31]=u[32]=0),r)for(o=this.start;s<a&&o<128;++s)u[o>>2]|=t[s]<<h[3&o++];else for(o=this.start;s<a&&o<128;++s)(i=t.charCodeAt(s))<128?u[o>>2]|=i<<h[3&o++]:i<2048?(u[o>>2]|=(192|i>>6)<<h[3&o++],u[o>>2]|=(128|63&i)<<h[3&o++]):i<55296||i>=57344?(u[o>>2]|=(224|i>>12)<<h[3&o++],u[o>>2]|=(128|i>>6&63)<<h[3&o++],u[o>>2]|=(128|63&i)<<h[3&o++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++s)),u[o>>2]|=(240|i>>18)<<h[3&o++],u[o>>2]|=(128|i>>12&63)<<h[3&o++],u[o>>2]|=(128|i>>6&63)<<h[3&o++],u[o>>2]|=(128|63&i)<<h[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=128?(this.block=u[32],this.start=o-128,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[32]=this.block,t[e>>2]|=l[3&e],this.block=t[32],e>=112&&(this.hashed||this.hash(),t[0]=this.block,t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=t[16]=t[17]=t[18]=t[19]=t[20]=t[21]=t[22]=t[23]=t[24]=t[25]=t[26]=t[27]=t[28]=t[29]=t[30]=t[31]=t[32]=0),t[30]=this.hBytes<<3|this.bytes>>>29,t[31]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var t,e,r,n,i,o,s,a,u,c,f,l,h,p,m,g,b,y,v,w,_,A,E,S,M,x=this.h0h,k=this.h0l,T=this.h1h,I=this.h1l,C=this.h2h,R=this.h2l,B=this.h3h,N=this.h3l,O=this.h4h,P=this.h4l,D=this.h5h,L=this.h5l,U=this.h6h,j=this.h6l,F=this.h7h,q=this.h7l,z=this.blocks;for(t=32;t<160;t+=2)e=((w=z[t-30])>>>1|(_=z[t-29])<<31)^(w>>>8|_<<24)^w>>>7,r=(_>>>1|w<<31)^(_>>>8|w<<24)^(_>>>7|w<<25),n=((w=z[t-4])>>>19|(_=z[t-3])<<13)^(_>>>29|w<<3)^w>>>6,i=(_>>>19|w<<13)^(w>>>29|_<<3)^(_>>>6|w<<26),w=z[t-32],_=z[t-31],u=((A=z[t-14])>>>16)+(w>>>16)+(e>>>16)+(n>>>16)+((a=(65535&A)+(65535&w)+(65535&e)+(65535&n)+((s=((E=z[t-13])>>>16)+(_>>>16)+(r>>>16)+(i>>>16)+((o=(65535&E)+(65535&_)+(65535&r)+(65535&i))>>>16))>>>16))>>>16),z[t]=u<<16|65535&a,z[t+1]=s<<16|65535&o;var H=x,K=k,G=T,W=I,V=C,$=R,X=B,Y=N,J=O,Z=P,Q=D,tt=L,et=U,rt=j,nt=F,it=q;for(g=G&V,b=W&$,t=0;t<160;t+=8)e=(H>>>28|K<<4)^(K>>>2|H<<30)^(K>>>7|H<<25),r=(K>>>28|H<<4)^(H>>>2|K<<30)^(H>>>7|K<<25),n=(J>>>14|Z<<18)^(J>>>18|Z<<14)^(Z>>>9|J<<23),i=(Z>>>14|J<<18)^(Z>>>18|J<<14)^(J>>>9|Z<<23),y=(c=H&G)^H&V^g,v=(f=K&W)^K&$^b,S=J&Q^~J&et,M=Z&tt^~Z&rt,w=z[t],_=z[t+1],w=(u=((A=d[t])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(nt>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&nt)+((s=((E=d[t+1])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(it>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&it))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,nt=(u=(X>>>16)+(w>>>16)+((a=(65535&X)+(65535&w)+((s=(Y>>>16)+(_>>>16)+((o=(65535&Y)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,it=s<<16|65535&o,e=((X=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|(Y=s<<16|65535&o)<<4)^(Y>>>2|X<<30)^(Y>>>7|X<<25),r=(Y>>>28|X<<4)^(X>>>2|Y<<30)^(X>>>7|Y<<25),n=(nt>>>14|it<<18)^(nt>>>18|it<<14)^(it>>>9|nt<<23),i=(it>>>14|nt<<18)^(it>>>18|nt<<14)^(nt>>>9|it<<23),y=(l=X&H)^X&G^c,v=(h=Y&K)^Y&W^f,S=nt&J^~nt&Q,M=it&Z^~it&tt,w=z[t+2],_=z[t+3],w=(u=((A=d[t+2])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(et>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&et)+((s=((E=d[t+3])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(rt>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&rt))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,et=(u=(V>>>16)+(w>>>16)+((a=(65535&V)+(65535&w)+((s=($>>>16)+(_>>>16)+((o=(65535&$)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,rt=s<<16|65535&o,e=((V=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|($=s<<16|65535&o)<<4)^($>>>2|V<<30)^($>>>7|V<<25),r=($>>>28|V<<4)^(V>>>2|$<<30)^(V>>>7|$<<25),n=(et>>>14|rt<<18)^(et>>>18|rt<<14)^(rt>>>9|et<<23),i=(rt>>>14|et<<18)^(rt>>>18|et<<14)^(et>>>9|rt<<23),y=(p=V&X)^V&H^l,v=(m=$&Y)^$&K^h,S=et&nt^~et&J,M=rt&it^~rt&Z,w=z[t+4],_=z[t+5],w=(u=((A=d[t+4])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(Q>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&Q)+((s=((E=d[t+5])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(tt>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&tt))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,Q=(u=(G>>>16)+(w>>>16)+((a=(65535&G)+(65535&w)+((s=(W>>>16)+(_>>>16)+((o=(65535&W)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,tt=s<<16|65535&o,e=((G=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a)>>>28|(W=s<<16|65535&o)<<4)^(W>>>2|G<<30)^(W>>>7|G<<25),r=(W>>>28|G<<4)^(G>>>2|W<<30)^(G>>>7|W<<25),n=(Q>>>14|tt<<18)^(Q>>>18|tt<<14)^(tt>>>9|Q<<23),i=(tt>>>14|Q<<18)^(tt>>>18|Q<<14)^(Q>>>9|tt<<23),y=(g=G&V)^G&X^p,v=(b=W&$)^W&Y^m,S=Q&et^~Q&nt,M=tt&rt^~tt&it,w=z[t+6],_=z[t+7],w=(u=((A=d[t+6])>>>16)+(w>>>16)+(S>>>16)+(n>>>16)+(J>>>16)+((a=(65535&A)+(65535&w)+(65535&S)+(65535&n)+(65535&J)+((s=((E=d[t+7])>>>16)+(_>>>16)+(M>>>16)+(i>>>16)+(Z>>>16)+((o=(65535&E)+(65535&_)+(65535&M)+(65535&i)+(65535&Z))>>>16))>>>16))>>>16))<<16|65535&a,_=s<<16|65535&o,A=(u=(y>>>16)+(e>>>16)+((a=(65535&y)+(65535&e)+((s=(v>>>16)+(r>>>16)+((o=(65535&v)+(65535&r))>>>16))>>>16))>>>16))<<16|65535&a,E=s<<16|65535&o,J=(u=(H>>>16)+(w>>>16)+((a=(65535&H)+(65535&w)+((s=(K>>>16)+(_>>>16)+((o=(65535&K)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,Z=s<<16|65535&o,H=(u=(A>>>16)+(w>>>16)+((a=(65535&A)+(65535&w)+((s=(E>>>16)+(_>>>16)+((o=(65535&E)+(65535&_))>>>16))>>>16))>>>16))<<16|65535&a,K=s<<16|65535&o;u=(x>>>16)+(H>>>16)+((a=(65535&x)+(65535&H)+((s=(k>>>16)+(K>>>16)+((o=(65535&k)+(65535&K))>>>16))>>>16))>>>16),this.h0h=u<<16|65535&a,this.h0l=s<<16|65535&o,u=(T>>>16)+(G>>>16)+((a=(65535&T)+(65535&G)+((s=(I>>>16)+(W>>>16)+((o=(65535&I)+(65535&W))>>>16))>>>16))>>>16),this.h1h=u<<16|65535&a,this.h1l=s<<16|65535&o,u=(C>>>16)+(V>>>16)+((a=(65535&C)+(65535&V)+((s=(R>>>16)+($>>>16)+((o=(65535&R)+(65535&$))>>>16))>>>16))>>>16),this.h2h=u<<16|65535&a,this.h2l=s<<16|65535&o,u=(B>>>16)+(X>>>16)+((a=(65535&B)+(65535&X)+((s=(N>>>16)+(Y>>>16)+((o=(65535&N)+(65535&Y))>>>16))>>>16))>>>16),this.h3h=u<<16|65535&a,this.h3l=s<<16|65535&o,u=(O>>>16)+(J>>>16)+((a=(65535&O)+(65535&J)+((s=(P>>>16)+(Z>>>16)+((o=(65535&P)+(65535&Z))>>>16))>>>16))>>>16),this.h4h=u<<16|65535&a,this.h4l=s<<16|65535&o,u=(D>>>16)+(Q>>>16)+((a=(65535&D)+(65535&Q)+((s=(L>>>16)+(tt>>>16)+((o=(65535&L)+(65535&tt))>>>16))>>>16))>>>16),this.h5h=u<<16|65535&a,this.h5l=s<<16|65535&o,u=(U>>>16)+(et>>>16)+((a=(65535&U)+(65535&et)+((s=(j>>>16)+(rt>>>16)+((o=(65535&j)+(65535&rt))>>>16))>>>16))>>>16),this.h6h=u<<16|65535&a,this.h6l=s<<16|65535&o,u=(F>>>16)+(nt>>>16)+((a=(65535&F)+(65535&nt)+((s=(q>>>16)+(it>>>16)+((o=(65535&q)+(65535&it))>>>16))>>>16))>>>16),this.h7h=u<<16|65535&a,this.h7l=s<<16|65535&o},w.prototype.hex=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,s=this.h3h,a=this.h3l,u=this.h4h,c=this.h4l,l=this.h5h,h=this.h5l,d=this.h6h,p=this.h6l,m=this.h7h,g=this.h7l,b=this.bits,y=f[t>>28&15]+f[t>>24&15]+f[t>>20&15]+f[t>>16&15]+f[t>>12&15]+f[t>>8&15]+f[t>>4&15]+f[15&t]+f[e>>28&15]+f[e>>24&15]+f[e>>20&15]+f[e>>16&15]+f[e>>12&15]+f[e>>8&15]+f[e>>4&15]+f[15&e]+f[r>>28&15]+f[r>>24&15]+f[r>>20&15]+f[r>>16&15]+f[r>>12&15]+f[r>>8&15]+f[r>>4&15]+f[15&r]+f[n>>28&15]+f[n>>24&15]+f[n>>20&15]+f[n>>16&15]+f[n>>12&15]+f[n>>8&15]+f[n>>4&15]+f[15&n]+f[i>>28&15]+f[i>>24&15]+f[i>>20&15]+f[i>>16&15]+f[i>>12&15]+f[i>>8&15]+f[i>>4&15]+f[15&i]+f[o>>28&15]+f[o>>24&15]+f[o>>20&15]+f[o>>16&15]+f[o>>12&15]+f[o>>8&15]+f[o>>4&15]+f[15&o]+f[s>>28&15]+f[s>>24&15]+f[s>>20&15]+f[s>>16&15]+f[s>>12&15]+f[s>>8&15]+f[s>>4&15]+f[15&s];return b>=256&&(y+=f[a>>28&15]+f[a>>24&15]+f[a>>20&15]+f[a>>16&15]+f[a>>12&15]+f[a>>8&15]+f[a>>4&15]+f[15&a]),b>=384&&(y+=f[u>>28&15]+f[u>>24&15]+f[u>>20&15]+f[u>>16&15]+f[u>>12&15]+f[u>>8&15]+f[u>>4&15]+f[15&u]+f[c>>28&15]+f[c>>24&15]+f[c>>20&15]+f[c>>16&15]+f[c>>12&15]+f[c>>8&15]+f[c>>4&15]+f[15&c]+f[l>>28&15]+f[l>>24&15]+f[l>>20&15]+f[l>>16&15]+f[l>>12&15]+f[l>>8&15]+f[l>>4&15]+f[15&l]+f[h>>28&15]+f[h>>24&15]+f[h>>20&15]+f[h>>16&15]+f[h>>12&15]+f[h>>8&15]+f[h>>4&15]+f[15&h]),512==b&&(y+=f[d>>28&15]+f[d>>24&15]+f[d>>20&15]+f[d>>16&15]+f[d>>12&15]+f[d>>8&15]+f[d>>4&15]+f[15&d]+f[p>>28&15]+f[p>>24&15]+f[p>>20&15]+f[p>>16&15]+f[p>>12&15]+f[p>>8&15]+f[p>>4&15]+f[15&p]+f[m>>28&15]+f[m>>24&15]+f[m>>20&15]+f[m>>16&15]+f[m>>12&15]+f[m>>8&15]+f[m>>4&15]+f[15&m]+f[g>>28&15]+f[g>>24&15]+f[g>>20&15]+f[g>>16&15]+f[g>>12&15]+f[g>>8&15]+f[g>>4&15]+f[15&g]),y},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var t=this.h0h,e=this.h0l,r=this.h1h,n=this.h1l,i=this.h2h,o=this.h2l,s=this.h3h,a=this.h3l,u=this.h4h,c=this.h4l,f=this.h5h,l=this.h5l,h=this.h6h,d=this.h6l,p=this.h7h,m=this.h7l,g=this.bits,b=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s];return g>=256&&b.push(a>>24&255,a>>16&255,a>>8&255,255&a),g>=384&&b.push(u>>24&255,u>>16&255,u>>8&255,255&u,c>>24&255,c>>16&255,c>>8&255,255&c,f>>24&255,f>>16&255,f>>8&255,255&f,l>>24&255,l>>16&255,l>>8&255,255&l),512==g&&b.push(h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,p>>24&255,p>>16&255,p>>8&255,255&p,m>>24&255,m>>16&255,m>>8&255,255&m),b},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var t=this.bits,e=new ArrayBuffer(t/8),r=new DataView(e);return r.setUint32(0,this.h0h),r.setUint32(4,this.h0l),r.setUint32(8,this.h1h),r.setUint32(12,this.h1l),r.setUint32(16,this.h2h),r.setUint32(20,this.h2l),r.setUint32(24,this.h3h),t>=256&&r.setUint32(28,this.h3l),t>=384&&(r.setUint32(32,this.h4h),r.setUint32(36,this.h4l),r.setUint32(40,this.h5h),r.setUint32(44,this.h5l)),512==t&&(r.setUint32(48,this.h6h),r.setUint32(52,this.h6l),r.setUint32(56,this.h7h),r.setUint32(60,this.h7l)),e},w.prototype.clone=function(){var t=new w(this.bits,!1);return this.copyTo(t),t},w.prototype.copyTo=function(t){var e=0,r=["h0h","h0l","h1h","h1l","h2h","h2l","h3h","h3l","h4h","h4l","h5h","h5l","h6h","h6l","h7h","h7l","start","bytes","hBytes","finalized","hashed","lastByteIndex"];for(e=0;e<r.length;++e)t[r[e]]=this[r[e]];for(e=0;e<this.blocks.length;++e)t.blocks[e]=this.blocks[e]},_.prototype=new w,_.prototype.finalize=function(){if(w.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();w.call(this,this.bits,this.sharedMemory),this.update(this.oKeyPad),this.update(t),w.prototype.finalize.call(this)}},_.prototype.clone=function(){var t=new _([],this.bits,!1);this.copyTo(t),t.inner=this.inner;for(var e=0;e<this.oKeyPad.length;++e)t.oKeyPad[e]=this.oKeyPad[e];return t};var A=b(512);A.sha512=A,A.sha384=b(384),A.sha512_256=b(256),A.sha512_224=b(224),A.sha512.hmac=v(512),A.sha384.hmac=v(384),A.sha512_256.hmac=v(256),A.sha512_224.hmac=v(224),a?t.exports=A:(o.sha512=A.sha512,o.sha384=A.sha384,o.sha512_256=A.sha512_256,o.sha512_224=A.sha512_224,u&&(void 0===(n=function(){return A}.call(A,r,A,t))||(t.exports=n)))}()},9721:function(t){t.exports=function(){"use strict";var t=Math.imul,e=Math.clz32,r=Math.abs,n=Math.max,i=Math.floor;class o extends Array{constructor(t,e){if(super(t),this.sign=e,t>o.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(t){var e=Number.isFinite;if("number"==typeof t){if(0===t)return o.__zero();if(o.__isOneDigitInt(t))return 0>t?o.__oneDigit(-t,!0):o.__oneDigit(t,!1);if(!e(t)||i(t)!==t)throw new RangeError("The number "+t+" cannot be converted to BigInt because it is not an integer");return o.__fromDouble(t)}if("string"==typeof t){const e=o.__fromString(t);if(null===e)throw new SyntaxError("Cannot convert "+t+" to a BigInt");return e}if("boolean"==typeof t)return!0===t?o.__oneDigit(1,!1):o.__zero();if("object"==typeof t){if(t.constructor===o)return t;const e=o.__toPrimitive(t);return o.BigInt(e)}throw new TypeError("Cannot convert "+t+" to a BigInt")}toDebugString(){const t=["BigInt["];for(const e of this)t.push((e?(e>>>0).toString(16):e)+", ");return t.push("]"),t.join("")}toString(t=10){if(2>t||36<t)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":0==(t&t-1)?o.__toStringBasePowerOfTwo(this,t):o.__toStringGeneric(this,t,!1)}static toNumber(t){const e=t.length;if(0===e)return 0;if(1===e){const e=t.__unsignedDigit(0);return t.sign?-e:e}const r=t.__digit(e-1),n=o.__clz30(r),i=30*e-n;if(1024<i)return t.sign?-1/0:1/0;let s=i-1,a=r,u=e-1;const c=n+3;let f=32===c?0:a<<c;f>>>=12;const l=c-12;let h=12<=c?0:a<<20+c,d=20+c;for(0<l&&0<u&&(u--,a=t.__digit(u),f|=a>>>30-l,h=a<<l+2,d=l+2);0<d&&0<u;)u--,a=t.__digit(u),h|=30<=d?a<<d-30:a>>>30-d,d-=30;const p=o.__decideRounding(t,d,u,a);if((1===p||0===p&&1==(1&h))&&(h=h+1>>>0,0===h&&(f++,0!=f>>>20&&(f=0,s++,1023<s))))return t.sign?-1/0:1/0;const m=t.sign?-2147483648:0;return s=s+1023<<20,o.__kBitConversionInts[1]=m|s|f,o.__kBitConversionInts[0]=h,o.__kBitConversionDouble[0]}static unaryMinus(t){if(0===t.length)return t;const e=t.__copy();return e.sign=!t.sign,e}static bitwiseNot(t){return t.sign?o.__absoluteSubOne(t).__trim():o.__absoluteAddOne(t,!0)}static exponentiate(t,e){if(e.sign)throw new RangeError("Exponent must be positive");if(0===e.length)return o.__oneDigit(1,!1);if(0===t.length)return t;if(1===t.length&&1===t.__digit(0))return t.sign&&0==(1&e.__digit(0))?o.unaryMinus(t):t;if(1<e.length)throw new RangeError("BigInt too big");let r=e.__unsignedDigit(0);if(1===r)return t;if(r>=o.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===t.length&&2===t.__digit(0)){const e=1+(0|r/30),n=t.sign&&0!=(1&r),i=new o(e,n);i.__initializeDigits();const s=1<<r%30;return i.__setDigit(e-1,s),i}let n=null,i=t;for(0!=(1&r)&&(n=t),r>>=1;0!==r;r>>=1)i=o.multiply(i,i),0!=(1&r)&&(n=null===n?i:o.multiply(n,i));return n}static multiply(t,e){if(0===t.length)return t;if(0===e.length)return e;let r=t.length+e.length;30<=t.__clzmsd()+e.__clzmsd()&&r--;const n=new o(r,t.sign!==e.sign);n.__initializeDigits();for(let r=0;r<t.length;r++)o.__multiplyAccumulate(e,t.__digit(r),n,r);return n.__trim()}static divide(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(t,e))return o.__zero();const r=t.sign!==e.sign,n=e.__unsignedDigit(0);let i;if(1===e.length&&32767>=n){if(1===n)return r===t.sign?t:o.unaryMinus(t);i=o.__absoluteDivSmall(t,n,null)}else i=o.__absoluteDivLarge(t,e,!0,!1);return i.sign=r,i.__trim()}static remainder(t,e){if(0===e.length)throw new RangeError("Division by zero");if(0>o.__absoluteCompare(t,e))return t;const r=e.__unsignedDigit(0);if(1===e.length&&32767>=r){if(1===r)return o.__zero();const e=o.__absoluteModSmall(t,r);return 0===e?o.__zero():o.__oneDigit(e,t.sign)}const n=o.__absoluteDivLarge(t,e,!1,!0);return n.sign=t.sign,n.__trim()}static add(t,e){const r=t.sign;return r===e.sign?o.__absoluteAdd(t,e,r):0<=o.__absoluteCompare(t,e)?o.__absoluteSub(t,e,r):o.__absoluteSub(e,t,!r)}static subtract(t,e){const r=t.sign;return r===e.sign?0<=o.__absoluteCompare(t,e)?o.__absoluteSub(t,e,r):o.__absoluteSub(e,t,!r):o.__absoluteAdd(t,e,r)}static leftShift(t,e){return 0===e.length||0===t.length?t:e.sign?o.__rightShiftByAbsolute(t,e):o.__leftShiftByAbsolute(t,e)}static signedRightShift(t,e){return 0===e.length||0===t.length?t:e.sign?o.__leftShiftByAbsolute(t,e):o.__rightShiftByAbsolute(t,e)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(t,e){return 0>o.__compareToBigInt(t,e)}static lessThanOrEqual(t,e){return 0>=o.__compareToBigInt(t,e)}static greaterThan(t,e){return 0<o.__compareToBigInt(t,e)}static greaterThanOrEqual(t,e){return 0<=o.__compareToBigInt(t,e)}static equal(t,e){if(t.sign!==e.sign)return!1;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t.__digit(r)!==e.__digit(r))return!1;return!0}static notEqual(t,e){return!o.equal(t,e)}static bitwiseAnd(t,e){if(!t.sign&&!e.sign)return o.__absoluteAnd(t,e).__trim();if(t.sign&&e.sign){const r=n(t.length,e.length)+1;let i=o.__absoluteSubOne(t,r);const s=o.__absoluteSubOne(e);return i=o.__absoluteOr(i,s,i),o.__absoluteAddOne(i,!0,i).__trim()}return t.sign&&([t,e]=[e,t]),o.__absoluteAndNot(t,o.__absoluteSubOne(e)).__trim()}static bitwiseXor(t,e){if(!t.sign&&!e.sign)return o.__absoluteXor(t,e).__trim();if(t.sign&&e.sign){const r=n(t.length,e.length),i=o.__absoluteSubOne(t,r),s=o.__absoluteSubOne(e);return o.__absoluteXor(i,s,i).__trim()}const r=n(t.length,e.length)+1;t.sign&&([t,e]=[e,t]);let i=o.__absoluteSubOne(e,r);return i=o.__absoluteXor(i,t,i),o.__absoluteAddOne(i,!0,i).__trim()}static bitwiseOr(t,e){const r=n(t.length,e.length);if(!t.sign&&!e.sign)return o.__absoluteOr(t,e).__trim();if(t.sign&&e.sign){let n=o.__absoluteSubOne(t,r);const i=o.__absoluteSubOne(e);return n=o.__absoluteAnd(n,i,n),o.__absoluteAddOne(n,!0,n).__trim()}t.sign&&([t,e]=[e,t]);let i=o.__absoluteSubOne(e,r);return i=o.__absoluteAndNot(i,t,i),o.__absoluteAddOne(i,!0,i).__trim()}static asIntN(t,e){if(0===e.length)return e;if(0>(t=i(t)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===t)return o.__zero();if(t>=o.__kMaxLengthBits)return e;const r=0|(t+29)/30;if(e.length<r)return e;const n=e.__unsignedDigit(r-1),s=1<<(t-1)%30;if(e.length===r&&n<s)return e;if((n&s)!==s)return o.__truncateToNBits(t,e);if(!e.sign)return o.__truncateAndSubFromPowerOfTwo(t,e,!0);if(0==(n&s-1)){for(let n=r-2;0<=n;n--)if(0!==e.__digit(n))return o.__truncateAndSubFromPowerOfTwo(t,e,!1);return e.length===r&&n===s?e:o.__truncateToNBits(t,e)}return o.__truncateAndSubFromPowerOfTwo(t,e,!1)}static asUintN(t,e){if(0===e.length)return e;if(0>(t=i(t)))throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===t)return o.__zero();if(e.sign){if(t>o.__kMaxLengthBits)throw new RangeError("BigInt too big");return o.__truncateAndSubFromPowerOfTwo(t,e,!1)}if(t>=o.__kMaxLengthBits)return e;const r=0|(t+29)/30;if(e.length<r)return e;const n=t%30;if(e.length==r){if(0===n)return e;if(0==e.__digit(r-1)>>>n)return e}return o.__truncateToNBits(t,e)}static ADD(t,e){if(t=o.__toPrimitive(t),e=o.__toPrimitive(e),"string"==typeof t)return"string"!=typeof e&&(e=e.toString()),t+e;if("string"==typeof e)return t.toString()+e;if(t=o.__toNumeric(t),e=o.__toNumeric(e),o.__isBigInt(t)&&o.__isBigInt(e))return o.add(t,e);if("number"==typeof t&&"number"==typeof e)return t+e;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(t,e){return o.__compare(t,e,0)}static LE(t,e){return o.__compare(t,e,1)}static GT(t,e){return o.__compare(t,e,2)}static GE(t,e){return o.__compare(t,e,3)}static EQ(t,e){for(;;){if(o.__isBigInt(t))return o.__isBigInt(e)?o.equal(t,e):o.EQ(e,t);if("number"==typeof t){if(o.__isBigInt(e))return o.__equalToNumber(e,t);if("object"!=typeof e)return t==e;e=o.__toPrimitive(e)}else if("string"==typeof t){if(o.__isBigInt(e))return null!==(t=o.__fromString(t))&&o.equal(t,e);if("object"!=typeof e)return t==e;e=o.__toPrimitive(e)}else if("boolean"==typeof t){if(o.__isBigInt(e))return o.__equalToNumber(e,+t);if("object"!=typeof e)return t==e;e=o.__toPrimitive(e)}else if("symbol"==typeof t){if(o.__isBigInt(e))return!1;if("object"!=typeof e)return t==e;e=o.__toPrimitive(e)}else{if("object"!=typeof t)return t==e;if("object"==typeof e&&e.constructor!==o)return t==e;t=o.__toPrimitive(t)}}}static NE(t,e){return!o.EQ(t,e)}static __zero(){return new o(0,!1)}static __oneDigit(t,e){const r=new o(1,e);return r.__setDigit(0,t),r}__copy(){const t=new o(this.length,this.sign);for(let e=0;e<this.length;e++)t[e]=this[e];return t}__trim(){let t=this.length,e=this[t-1];for(;0===e;)t--,e=this[t-1],this.pop();return 0===t&&(this.sign=!1),this}__initializeDigits(){for(let t=0;t<this.length;t++)this[t]=0}static __decideRounding(t,e,r,n){if(0<e)return-1;let i;if(0>e)i=-e-1;else{if(0===r)return-1;r--,n=t.__digit(r),i=29}let o=1<<i;if(0==(n&o))return-1;if(o-=1,0!=(n&o))return 1;for(;0<r;)if(r--,0!==t.__digit(r))return 1;return 0}static __fromDouble(t){o.__kBitConversionDouble[0]=t;const e=(2047&o.__kBitConversionInts[1]>>>20)-1023,r=1+(0|e/30),n=new o(r,0>t);let i=1048575&o.__kBitConversionInts[1]|1048576,s=o.__kBitConversionInts[0];const a=e%30;let u,c=0;if(20>a){const t=20-a;c=t+32,u=i>>>t,i=i<<32-t|s>>>t,s<<=32-t}else if(20===a)c=32,u=i,i=s,s=0;else{const t=a-20;c=32-t,u=i<<t|s>>>32-t,i=s<<t,s=0}n.__setDigit(r-1,u);for(let t=r-2;0<=t;t--)0<c?(c-=30,u=i>>>2,i=i<<30|s>>>2,s<<=30):u=0,n.__setDigit(t,u);return n.__trim()}static __isWhitespace(t){return!!(13>=t&&9<=t)||(159>=t?32==t:131071>=t?160==t||5760==t:196607>=t?10>=(t&=131071)||40==t||41==t||47==t||95==t||4096==t:65279==t)}static __fromString(t,e=0){let r=0;const n=t.length;let i=0;if(i===n)return o.__zero();let s=t.charCodeAt(i);for(;o.__isWhitespace(s);){if(++i===n)return o.__zero();s=t.charCodeAt(i)}if(43===s){if(++i===n)return null;s=t.charCodeAt(i),r=1}else if(45===s){if(++i===n)return null;s=t.charCodeAt(i),r=-1}if(0===e){if(e=10,48===s){if(++i===n)return o.__zero();if(s=t.charCodeAt(i),88===s||120===s){if(e=16,++i===n)return null;s=t.charCodeAt(i)}else if(79===s||111===s){if(e=8,++i===n)return null;s=t.charCodeAt(i)}else if(66===s||98===s){if(e=2,++i===n)return null;s=t.charCodeAt(i)}}}else if(16===e&&48===s){if(++i===n)return o.__zero();if(s=t.charCodeAt(i),88===s||120===s){if(++i===n)return null;s=t.charCodeAt(i)}}if(0!=r&&10!==e)return null;for(;48===s;){if(++i===n)return o.__zero();s=t.charCodeAt(i)}const a=n-i;let u=o.__kMaxBitsPerChar[e],c=o.__kBitsPerCharTableMultiplier-1;if(a>1073741824/u)return null;const f=u*a+c>>>o.__kBitsPerCharTableShift,l=new o(0|(f+29)/30,!1),h=10>e?e:10,d=10<e?e-10:0;if(0==(e&e-1)){u>>=o.__kBitsPerCharTableShift;const e=[],r=[];let a=!1;do{let o=0,c=0;for(;;){let e;if(s-48>>>0<h)e=s-48;else{if(!((32|s)-97>>>0<d)){a=!0;break}e=(32|s)-87}if(c+=u,o=o<<u|e,++i===n){a=!0;break}if(s=t.charCodeAt(i),30<c+u)break}e.push(o),r.push(c)}while(!a);o.__fillFromParts(l,e,r)}else{l.__initializeDigits();let r=!1,a=0;do{let f=0,p=1;for(;;){let o;if(s-48>>>0<h)o=s-48;else{if(!((32|s)-97>>>0<d)){r=!0;break}o=(32|s)-87}const u=p*e;if(1073741823<u)break;if(p=u,f=f*e+o,a++,++i===n){r=!0;break}s=t.charCodeAt(i)}c=30*o.__kBitsPerCharTableMultiplier-1;const m=0|(u*a+c>>>o.__kBitsPerCharTableShift)/30;l.__inplaceMultiplyAdd(p,f,m)}while(!r)}if(i!==n){if(!o.__isWhitespace(s))return null;for(i++;i<n;i++)if(s=t.charCodeAt(i),!o.__isWhitespace(s))return null}return l.sign=-1==r,l.__trim()}static __fillFromParts(t,e,r){let n=0,i=0,o=0;for(let s=e.length-1;0<=s;s--){const a=e[s],u=r[s];i|=a<<o,o+=u,30===o?(t.__setDigit(n++,i),o=0,i=0):30<o&&(t.__setDigit(n++,1073741823&i),o-=30,i=a>>>u-o)}if(0!==i){if(n>=t.length)throw new Error("implementation bug");t.__setDigit(n++,i)}for(;n<t.length;n++)t.__setDigit(n,0)}static __toStringBasePowerOfTwo(t,e){const r=t.length;let n=e-1;n=(85&n>>>1)+(85&n),n=(51&n>>>2)+(51&n),n=(15&n>>>4)+(15&n);const i=n,s=e-1,a=t.__digit(r-1);let u=0|(30*r-o.__clz30(a)+i-1)/i;if(t.sign&&u++,268435456<u)throw new Error("string too long");const c=Array(u);let f=u-1,l=0,h=0;for(let e=0;e<r-1;e++){const r=t.__digit(e),n=(l|r<<h)&s;c[f--]=o.__kConversionChars[n];const a=i-h;for(l=r>>>a,h=30-a;h>=i;)c[f--]=o.__kConversionChars[l&s],l>>>=i,h-=i}const d=(l|a<<h)&s;for(c[f--]=o.__kConversionChars[d],l=a>>>i-h;0!==l;)c[f--]=o.__kConversionChars[l&s],l>>>=i;if(t.sign&&(c[f--]="-"),-1!=f)throw new Error("implementation bug");return c.join("")}static __toStringGeneric(t,e,r){const n=t.length;if(0===n)return"";if(1===n){let n=t.__unsignedDigit(0).toString(e);return!1===r&&t.sign&&(n="-"+n),n}const i=30*n-o.__clz30(t.__digit(n-1)),s=o.__kMaxBitsPerChar[e]-1;let a=i*o.__kBitsPerCharTableMultiplier;a+=s-1,a=0|a/s;const u=a+1>>1,c=o.exponentiate(o.__oneDigit(e,!1),o.__oneDigit(u,!1));let f,l;const h=c.__unsignedDigit(0);if(1===c.length&&32767>=h){f=new o(t.length,!1),f.__initializeDigits();let r=0;for(let e=2*t.length-1;0<=e;e--){const n=r<<15|t.__halfDigit(e);f.__setHalfDigit(e,0|n/h),r=0|n%h}l=r.toString(e)}else{const r=o.__absoluteDivLarge(t,c,!0,!0);f=r.quotient;const n=r.remainder.__trim();l=o.__toStringGeneric(n,e,!0)}f.__trim();let d=o.__toStringGeneric(f,e,!0);for(;l.length<u;)l="0"+l;return!1===r&&t.sign&&(d="-"+d),d+l}static __unequalSign(t){return t?-1:1}static __absoluteGreater(t){return t?-1:1}static __absoluteLess(t){return t?1:-1}static __compareToBigInt(t,e){const r=t.sign;if(r!==e.sign)return o.__unequalSign(r);const n=o.__absoluteCompare(t,e);return 0<n?o.__absoluteGreater(r):0>n?o.__absoluteLess(r):0}static __compareToNumber(t,e){if(o.__isOneDigitInt(e)){const n=t.sign,i=0>e;if(n!==i)return o.__unequalSign(n);if(0===t.length){if(i)throw new Error("implementation bug");return 0===e?0:-1}if(1<t.length)return o.__absoluteGreater(n);const s=r(e),a=t.__unsignedDigit(0);return a>s?o.__absoluteGreater(n):a<s?o.__absoluteLess(n):0}return o.__compareToDouble(t,e)}static __compareToDouble(t,e){if(e!=e)return e;if(e===1/0)return-1;if(e===-1/0)return 1;const r=t.sign;if(r!==0>e)return o.__unequalSign(r);if(0===e)throw new Error("implementation bug: should be handled elsewhere");if(0===t.length)return-1;o.__kBitConversionDouble[0]=e;const n=2047&o.__kBitConversionInts[1]>>>20;if(2047==n)throw new Error("implementation bug: handled elsewhere");const i=n-1023;if(0>i)return o.__absoluteGreater(r);const s=t.length;let a=t.__digit(s-1);const u=o.__clz30(a),c=30*s-u,f=i+1;if(c<f)return o.__absoluteLess(r);if(c>f)return o.__absoluteGreater(r);let l=1048576|1048575&o.__kBitConversionInts[1],h=o.__kBitConversionInts[0];const d=29-u;if(d!==(0|(c-1)%30))throw new Error("implementation bug");let p,m=0;if(20>d){const t=20-d;m=t+32,p=l>>>t,l=l<<32-t|h>>>t,h<<=32-t}else if(20===d)m=32,p=l,l=h,h=0;else{const t=d-20;m=32-t,p=l<<t|h>>>32-t,l=h<<t,h=0}if(a>>>=0,p>>>=0,a>p)return o.__absoluteGreater(r);if(a<p)return o.__absoluteLess(r);for(let e=s-2;0<=e;e--){0<m?(m-=30,p=l>>>2,l=l<<30|h>>>2,h<<=30):p=0;const n=t.__unsignedDigit(e);if(n>p)return o.__absoluteGreater(r);if(n<p)return o.__absoluteLess(r)}if(0!==l||0!==h){if(0===m)throw new Error("implementation bug");return o.__absoluteLess(r)}return 0}static __equalToNumber(t,e){return o.__isOneDigitInt(e)?0===e?0===t.length:1===t.length&&t.sign===0>e&&t.__unsignedDigit(0)===r(e):0===o.__compareToDouble(t,e)}static __comparisonResultToBool(t,e){return 0===e?0>t:1===e?0>=t:2===e?0<t:3===e?0<=t:void 0}static __compare(t,e,r){if(t=o.__toPrimitive(t),e=o.__toPrimitive(e),"string"==typeof t&&"string"==typeof e)switch(r){case 0:return t<e;case 1:return t<=e;case 2:return t>e;case 3:return t>=e}if(o.__isBigInt(t)&&"string"==typeof e)return null!==(e=o.__fromString(e))&&o.__comparisonResultToBool(o.__compareToBigInt(t,e),r);if("string"==typeof t&&o.__isBigInt(e))return null!==(t=o.__fromString(t))&&o.__comparisonResultToBool(o.__compareToBigInt(t,e),r);if(t=o.__toNumeric(t),e=o.__toNumeric(e),o.__isBigInt(t)){if(o.__isBigInt(e))return o.__comparisonResultToBool(o.__compareToBigInt(t,e),r);if("number"!=typeof e)throw new Error("implementation bug");return o.__comparisonResultToBool(o.__compareToNumber(t,e),r)}if("number"!=typeof t)throw new Error("implementation bug");if(o.__isBigInt(e))return o.__comparisonResultToBool(o.__compareToNumber(e,t),2^r);if("number"!=typeof e)throw new Error("implementation bug");return 0===r?t<e:1===r?t<=e:2===r?t>e:3===r?t>=e:void 0}__clzmsd(){return o.__clz30(this.__digit(this.length-1))}static __absoluteAdd(t,e,r){if(t.length<e.length)return o.__absoluteAdd(e,t,r);if(0===t.length)return t;if(0===e.length)return t.sign===r?t:o.unaryMinus(t);let n=t.length;(0===t.__clzmsd()||e.length===t.length&&0===e.__clzmsd())&&n++;const i=new o(n,r);let s=0,a=0;for(;a<e.length;a++){const r=t.__digit(a)+e.__digit(a)+s;s=r>>>30,i.__setDigit(a,1073741823&r)}for(;a<t.length;a++){const e=t.__digit(a)+s;s=e>>>30,i.__setDigit(a,1073741823&e)}return a<i.length&&i.__setDigit(a,s),i.__trim()}static __absoluteSub(t,e,r){if(0===t.length)return t;if(0===e.length)return t.sign===r?t:o.unaryMinus(t);const n=new o(t.length,r);let i=0,s=0;for(;s<e.length;s++){const r=t.__digit(s)-e.__digit(s)-i;i=1&r>>>30,n.__setDigit(s,1073741823&r)}for(;s<t.length;s++){const e=t.__digit(s)-i;i=1&e>>>30,n.__setDigit(s,1073741823&e)}return n.__trim()}static __absoluteAddOne(t,e,r=null){const n=t.length;null===r?r=new o(n,e):r.sign=e;let i=1;for(let e=0;e<n;e++){const n=t.__digit(e)+i;i=n>>>30,r.__setDigit(e,1073741823&n)}return 0!=i&&r.__setDigitGrow(n,1),r}static __absoluteSubOne(t,e){const r=t.length,n=new o(e=e||r,!1);let i=1;for(let e=0;e<r;e++){const r=t.__digit(e)-i;i=1&r>>>30,n.__setDigit(e,1073741823&r)}if(0!=i)throw new Error("implementation bug");for(let t=r;t<e;t++)n.__setDigit(t,0);return n}static __absoluteAnd(t,e,r=null){let n=t.length,i=e.length,s=i;if(n<i){s=n;const r=t,o=n;t=e,n=i,e=r,i=o}let a=s;null===r?r=new o(a,!1):a=r.length;let u=0;for(;u<s;u++)r.__setDigit(u,t.__digit(u)&e.__digit(u));for(;u<a;u++)r.__setDigit(u,0);return r}static __absoluteAndNot(t,e,r=null){const n=t.length,i=e.length;let s=i;n<i&&(s=n);let a=n;null===r?r=new o(a,!1):a=r.length;let u=0;for(;u<s;u++)r.__setDigit(u,t.__digit(u)&~e.__digit(u));for(;u<n;u++)r.__setDigit(u,t.__digit(u));for(;u<a;u++)r.__setDigit(u,0);return r}static __absoluteOr(t,e,r=null){let n=t.length,i=e.length,s=i;if(n<i){s=n;const r=t,o=n;t=e,n=i,e=r,i=o}let a=n;null===r?r=new o(a,!1):a=r.length;let u=0;for(;u<s;u++)r.__setDigit(u,t.__digit(u)|e.__digit(u));for(;u<n;u++)r.__setDigit(u,t.__digit(u));for(;u<a;u++)r.__setDigit(u,0);return r}static __absoluteXor(t,e,r=null){let n=t.length,i=e.length,s=i;if(n<i){s=n;const r=t,o=n;t=e,n=i,e=r,i=o}let a=n;null===r?r=new o(a,!1):a=r.length;let u=0;for(;u<s;u++)r.__setDigit(u,t.__digit(u)^e.__digit(u));for(;u<n;u++)r.__setDigit(u,t.__digit(u));for(;u<a;u++)r.__setDigit(u,0);return r}static __absoluteCompare(t,e){const r=t.length-e.length;if(0!=r)return r;let n=t.length-1;for(;0<=n&&t.__digit(n)===e.__digit(n);)n--;return 0>n?0:t.__unsignedDigit(n)>e.__unsignedDigit(n)?1:-1}static __multiplyAccumulate(t,e,r,n){if(0===e)return;const i=32767&e,s=e>>>15;let a=0,u=0;for(let e,c=0;c<t.length;c++,n++){e=r.__digit(n);const f=t.__digit(c),l=32767&f,h=f>>>15,d=o.__imul(l,i),p=o.__imul(l,s),m=o.__imul(h,i),g=o.__imul(h,s);e+=u+d+a,a=e>>>30,e&=1073741823,e+=((32767&p)<<15)+((32767&m)<<15),a+=e>>>30,u=g+(p>>>15)+(m>>>15),r.__setDigit(n,1073741823&e)}for(;0!=a||0!==u;n++){let t=r.__digit(n);t+=a+u,u=0,a=t>>>30,r.__setDigit(n,1073741823&t)}}static __internalMultiplyAdd(t,e,r,n,i){let s=r,a=0;for(let r=0;r<n;r++){const n=t.__digit(r),u=o.__imul(32767&n,e),c=o.__imul(n>>>15,e),f=u+((32767&c)<<15)+a+s;s=f>>>30,a=c>>>15,i.__setDigit(r,1073741823&f)}if(i.length>n)for(i.__setDigit(n++,s+a);n<i.length;)i.__setDigit(n++,0);else if(0!==s+a)throw new Error("implementation bug")}__inplaceMultiplyAdd(t,e,r){r>this.length&&(r=this.length);const n=32767&t,i=t>>>15;let s=0,a=e;for(let t=0;t<r;t++){const e=this.__digit(t),r=32767&e,u=e>>>15,c=o.__imul(r,n),f=o.__imul(r,i),l=o.__imul(u,n),h=o.__imul(u,i);let d=a+c+s;s=d>>>30,d&=1073741823,d+=((32767&f)<<15)+((32767&l)<<15),s+=d>>>30,a=h+(f>>>15)+(l>>>15),this.__setDigit(t,1073741823&d)}if(0!=s||0!==a)throw new Error("implementation bug")}static __absoluteDivSmall(t,e,r=null){null===r&&(r=new o(t.length,!1));let n=0;for(let i,o=2*t.length-1;0<=o;o-=2){i=(n<<15|t.__halfDigit(o))>>>0;const s=0|i/e;n=0|i%e,i=(n<<15|t.__halfDigit(o-1))>>>0;const a=0|i/e;n=0|i%e,r.__setDigit(o>>>1,s<<15|a)}return r}static __absoluteModSmall(t,e){let r=0;for(let n=2*t.length-1;0<=n;n--)r=0|((r<<15|t.__halfDigit(n))>>>0)%e;return r}static __absoluteDivLarge(t,e,r,n){const i=e.__halfDigitLength(),s=e.length,a=t.__halfDigitLength()-i;let u=null;r&&(u=new o(a+2>>>1,!1),u.__initializeDigits());const c=new o(i+2>>>1,!1);c.__initializeDigits();const f=o.__clz15(e.__halfDigit(i-1));0<f&&(e=o.__specialLeftShift(e,f,0));const l=o.__specialLeftShift(t,f,1),h=e.__halfDigit(i-1);let d=0;for(let t,n=a;0<=n;n--){t=32767;const a=l.__halfDigit(n+i);if(a!==h){const r=(a<<15|l.__halfDigit(n+i-1))>>>0;t=0|r/h;let s=0|r%h;const u=e.__halfDigit(i-2),c=l.__halfDigit(n+i-2);for(;o.__imul(t,u)>>>0>(s<<16|c)>>>0&&(t--,s+=h,!(32767<s)););}o.__internalMultiplyAdd(e,t,0,s,c);let f=l.__inplaceSub(c,n,i+1);0!==f&&(f=l.__inplaceAdd(e,n,i),l.__setHalfDigit(n+i,32767&l.__halfDigit(n+i)+f),t--),r&&(1&n?d=t<<15:u.__setDigit(n>>>1,d|t))}if(n)return l.__inplaceRightShift(f),r?{quotient:u,remainder:l}:l;if(r)return u;throw new Error("unreachable")}static __clz15(t){return o.__clz30(t)-15}__inplaceAdd(t,e,r){let n=0;for(let i=0;i<r;i++){const r=this.__halfDigit(e+i)+t.__halfDigit(i)+n;n=r>>>15,this.__setHalfDigit(e+i,32767&r)}return n}__inplaceSub(t,e,r){let n=0;if(1&e){e>>=1;let i=this.__digit(e),o=32767&i,s=0;for(;s<r-1>>>1;s++){const r=t.__digit(s),a=(i>>>15)-(32767&r)-n;n=1&a>>>15,this.__setDigit(e+s,(32767&a)<<15|32767&o),i=this.__digit(e+s+1),o=(32767&i)-(r>>>15)-n,n=1&o>>>15}const a=t.__digit(s),u=(i>>>15)-(32767&a)-n;if(n=1&u>>>15,this.__setDigit(e+s,(32767&u)<<15|32767&o),e+s+1>=this.length)throw new RangeError("out of bounds");0==(1&r)&&(i=this.__digit(e+s+1),o=(32767&i)-(a>>>15)-n,n=1&o>>>15,this.__setDigit(e+t.length,1073709056&i|32767&o))}else{e>>=1;let i=0;for(;i<t.length-1;i++){const r=this.__digit(e+i),o=t.__digit(i),s=(32767&r)-(32767&o)-n;n=1&s>>>15;const a=(r>>>15)-(o>>>15)-n;n=1&a>>>15,this.__setDigit(e+i,(32767&a)<<15|32767&s)}const o=this.__digit(e+i),s=t.__digit(i),a=(32767&o)-(32767&s)-n;n=1&a>>>15;let u=0;0==(1&r)&&(u=(o>>>15)-(s>>>15)-n,n=1&u>>>15),this.__setDigit(e+i,(32767&u)<<15|32767&a)}return n}__inplaceRightShift(t){if(0===t)return;let e=this.__digit(0)>>>t;const r=this.length-1;for(let n=0;n<r;n++){const r=this.__digit(n+1);this.__setDigit(n,1073741823&r<<30-t|e),e=r>>>t}this.__setDigit(r,e)}static __specialLeftShift(t,e,r){const n=t.length,i=new o(n+r,!1);if(0===e){for(let e=0;e<n;e++)i.__setDigit(e,t.__digit(e));return 0<r&&i.__setDigit(n,0),i}let s=0;for(let r=0;r<n;r++){const n=t.__digit(r);i.__setDigit(r,1073741823&n<<e|s),s=n>>>30-e}return 0<r&&i.__setDigit(n,s),i}static __leftShiftByAbsolute(t,e){const r=o.__toShiftAmount(e);if(0>r)throw new RangeError("BigInt too big");const n=0|r/30,i=r%30,s=t.length,a=0!==i&&0!=t.__digit(s-1)>>>30-i,u=s+n+(a?1:0),c=new o(u,t.sign);if(0===i){let e=0;for(;e<n;e++)c.__setDigit(e,0);for(;e<u;e++)c.__setDigit(e,t.__digit(e-n))}else{let e=0;for(let t=0;t<n;t++)c.__setDigit(t,0);for(let r=0;r<s;r++){const o=t.__digit(r);c.__setDigit(r+n,1073741823&o<<i|e),e=o>>>30-i}if(a)c.__setDigit(s+n,e);else if(0!==e)throw new Error("implementation bug")}return c.__trim()}static __rightShiftByAbsolute(t,e){const r=t.length,n=t.sign,i=o.__toShiftAmount(e);if(0>i)return o.__rightShiftByMaximum(n);const s=0|i/30,a=i%30;let u=r-s;if(0>=u)return o.__rightShiftByMaximum(n);let c=!1;if(n)if(0!=(t.__digit(s)&(1<<a)-1))c=!0;else for(let e=0;e<s;e++)if(0!==t.__digit(e)){c=!0;break}c&&0===a&&0==~t.__digit(r-1)&&u++;let f=new o(u,n);if(0===a){f.__setDigit(u-1,0);for(let e=s;e<r;e++)f.__setDigit(e-s,t.__digit(e))}else{let e=t.__digit(s)>>>a;const n=r-s-1;for(let r=0;r<n;r++){const n=t.__digit(r+s+1);f.__setDigit(r,1073741823&n<<30-a|e),e=n>>>a}f.__setDigit(n,e)}return c&&(f=o.__absoluteAddOne(f,!0,f)),f.__trim()}static __rightShiftByMaximum(t){return t?o.__oneDigit(1,!0):o.__zero()}static __toShiftAmount(t){if(1<t.length)return-1;const e=t.__unsignedDigit(0);return e>o.__kMaxLengthBits?-1:e}static __toPrimitive(t,e="default"){if("object"!=typeof t)return t;if(t.constructor===o)return t;if("undefined"!=typeof Symbol&&"symbol"==typeof Symbol.toPrimitive){const r=t[Symbol.toPrimitive];if(r){const t=r(e);if("object"!=typeof t)return t;throw new TypeError("Cannot convert object to primitive value")}}const r=t.valueOf;if(r){const e=r.call(t);if("object"!=typeof e)return e}const n=t.toString;if(n){const e=n.call(t);if("object"!=typeof e)return e}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(t){return o.__isBigInt(t)?t:+t}static __isBigInt(t){return"object"==typeof t&&null!==t&&t.constructor===o}static __truncateToNBits(t,e){const r=0|(t+29)/30,n=new o(r,e.sign),i=r-1;for(let t=0;t<i;t++)n.__setDigit(t,e.__digit(t));let s=e.__digit(i);if(0!=t%30){const e=32-t%30;s=s<<e>>>e}return n.__setDigit(i,s),n.__trim()}static __truncateAndSubFromPowerOfTwo(t,e,r){var n=Math.min;const i=0|(t+29)/30,s=new o(i,r);let a=0;const u=i-1;let c=0;for(const t=n(u,e.length);a<t;a++){const t=0-e.__digit(a)-c;c=1&t>>>30,s.__setDigit(a,1073741823&t)}for(;a<u;a++)s.__setDigit(a,0|1073741823&-c);let f=u<e.length?e.__digit(u):0;const l=t%30;let h;if(0==l)h=0-f-c,h&=1073741823;else{const t=32-l;f=f<<t>>>t;const e=1<<32-t;h=e-f-c,h&=e-1}return s.__setDigit(u,h),s.__trim()}__digit(t){return this[t]}__unsignedDigit(t){return this[t]>>>0}__setDigit(t,e){this[t]=0|e}__setDigitGrow(t,e){this[t]=0|e}__halfDigitLength(){const t=this.length;return 32767>=this.__unsignedDigit(t-1)?2*t-1:2*t}__halfDigit(t){return 32767&this[t>>>1]>>>15*(1&t)}__setHalfDigit(t,e){const r=t>>>1,n=this.__digit(r),i=1&t?32767&n|e<<15:1073709056&n|32767&e;this.__setDigit(r,i)}static __digitPow(t,e){let r=1;for(;0<e;)1&e&&(r*=t),e>>>=1,t*=t;return r}static __isOneDigitInt(t){return(1073741823&t)===t}}return o.__kMaxLength=33554432,o.__kMaxLengthBits=o.__kMaxLength<<5,o.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],o.__kBitsPerCharTableShift=5,o.__kBitsPerCharTableMultiplier=1<<o.__kBitsPerCharTableShift,o.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],o.__kBitConversionBuffer=new ArrayBuffer(8),o.__kBitConversionDouble=new Float64Array(o.__kBitConversionBuffer),o.__kBitConversionInts=new Int32Array(o.__kBitConversionBuffer),o.__clz30=e?function(t){return e(t)-2}:function(t){var e=Math.LN2,r=Math.log;return 0===t?30:0|29-(0|r(t>>>0)/e)},o.__imul=t||function(t,e){return 0|t*e},o}()},1141:(t,e,r)=>{"use strict";var n=r(8575),i=r(4634),o=r(7512).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<<e|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 f(t,e,r,n,i,o,s){return u(t+(e&n|r&~n)+i+o|0,s)+e|0}function l(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=f(r,n=c(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=l(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,r,n,i,t[8],2272392833,11),i=l(i,o,r,n,t[11],1839030562,16),n=l(n,i,o,r,t[14],4259657740,23),r=l(r,n,i,o,t[1],2763975236,4),o=l(o,r,n,i,t[4],1272893353,11),i=l(i,o,r,n,t[7],4139469664,16),n=l(n,i,o,r,t[10],3200236656,23),r=l(r,n,i,o,t[13],681279174,4),o=l(o,r,n,i,t[0],3936430074,11),i=l(i,o,r,n,t[3],3572445317,16),n=l(n,i,o,r,t[6],76029189,23),r=l(r,n,i,o,t[9],3654602809,4),o=l(o,r,n,i,t[12],3873151461,11),i=l(i,o,r,n,t[15],530742520,16),r=h(r,n=l(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},3758:(t,e,r)=>{var n=r(9611),i=r(5060);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var c=t.shrn(u),f=a.toRed(o);e>0;e--){var l=this._randrange(new n(2),a);r&&r(l);var h=l.toRed(o).redPow(c);if(0!==h.cmp(s)&&0!==h.cmp(f)){for(var d=1;d<u;d++){if(0===(h=h.redSqr()).cmp(s))return!1;if(0===h.cmp(f))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),c=s.toRed(i);e>0;e--){var f=this._randrange(new n(2),s),l=t.gcd(f);if(0!==l.cmpn(1))return l;var h=f.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var d=1;d<a;d++){if(0===(h=h.redSqr()).cmp(o))return h.fromRed().subn(1).gcd(t);if(0===h.cmp(c))break}if(d===a)return(h=h.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},5997: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)}},5526:(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<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>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}},1898:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},8926:(t,e,r)=>{"use strict";var n=r(5055);e.certificate=r(6635);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=c;var f=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=f,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var l=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=l;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},6635:(t,e,r)=>{"use strict";var n=r(5055),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(u)})),f=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),l=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(f),this.key("validity").use(l),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},9463:(t,e,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(9366),a=r(1721),u=r(7512).Buffer;t.exports=function(t,e){var r,c=t.toString(),f=c.match(n);if(f){var l="aes"+f[1],h=u.from(f[2],"hex"),d=u.from(f[3].replace(/[\r\n]/g,""),"base64"),p=s(e,h.slice(0,8),parseInt(f[1],10)).key,m=[],g=a.createDecipheriv(l,p,h);m.push(g.update(d)),m.push(g.final()),r=u.concat(m)}else{var b=c.match(o);r=u.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},6581:(t,e,r)=>{var n=r(8926),i=r(2562),o=r(9463),s=r(1721),a=r(4222),u=r(7512).Buffer;function c(t){var e;"object"!=typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=u.from(t));var r,c,f=o(t,e),l=f.tag,h=f.data;switch(l){case"CERTIFICATE":c=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(h,"der")),r=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":h=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,l=parseInt(o.split("-")[1],10)/8,h=a.pbkdf2Sync(e,r,n,l,"sha1"),d=s.createDecipheriv(o,h,c),p=[];return p.push(d.update(f)),p.push(d.final()),u.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),e);case"PRIVATE KEY":switch(r=(c=n.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=n.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=c,c.signature=n.signature},9368:t=>{"use strict";function e(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function r(t,e){for(var r,n="",i=0,o=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)r=t.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,a):n=t.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var t,n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===t&&(t=process.cwd()),s=t),e(s),0!==s.length&&(n=s+"/"+n,i=47===s.charCodeAt(0))}return n=r(n,!i),i?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(t){if(e(t),0===t.length)return".";var n=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=r(t,!n)).length||n||(t="."),t.length>0&&i&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r)return"";if((t=n.resolve(t))===(r=n.resolve(r)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var o=t.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var u=r.length-a,c=s<u?s:u,f=-1,l=0;l<=c;++l){if(l===c){if(u>c){if(47===r.charCodeAt(a+l))return r.slice(a+l+1);if(0===l)return r.slice(a+l)}else s>c&&(47===t.charCodeAt(i+l)?f=l:0===l&&(f=0));break}var h=t.charCodeAt(i+l);if(h!==r.charCodeAt(a+l))break;47===h&&(f=l)}var d="";for(l=i+f+1;l<=o;++l)l!==o&&47!==t.charCodeAt(l)||(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+f):(a+=f,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,i=-1,o=!0,s=t.length-1;s>=1;--s)if(47===(r=t.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var a=r.length-1,u=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){i=n+1;break}}else-1===u&&(s=!1,u=n+1),a>=0&&(c===r.charCodeAt(a)?-1==--a&&(o=n):(a=-1,o=u))}return i===o?o=u:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":t.slice(i,o)},extname:function(t){e(t);for(var r=-1,n=0,i=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(47!==u)-1===i&&(o=!1,i=a+1),46===u?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":t.slice(r,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,i=t.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,u=-1,c=!0,f=t.length-1,l=0;f>=n;--f)if(47!==(i=t.charCodeAt(f)))-1===u&&(c=!1,u=f+1),46===i?-1===s?s=f:1!==l&&(l=1):-1!==s&&(l=-1);else if(!c){a=f+1;break}return-1===s||-1===u||0===l||1===l&&s===u-1&&s===a+1?-1!==u&&(r.base=r.name=0===a&&o?t.slice(1,u):t.slice(a,u)):(0===a&&o?(r.name=t.slice(1,s),r.base=t.slice(1,u)):(r.name=t.slice(a,s),r.base=t.slice(a,u)),r.ext=t.slice(s,u)),a>0?r.dir=t.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,t.exports=n},4222:(t,e,r)=>{e.pbkdf2=r(5820),e.pbkdf2Sync=r(7757)},5820:(t,e,r)=>{var n,i,o=r(7512).Buffer,s=r(8775),a=r(4540),u=r(7757),c=r(2891),f=r.g.crypto&&r.g.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function d(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,e,i,m,g,b){"function"==typeof g&&(b=g,g=void 0);var y=l[(g=g||"sha1").toLowerCase()];if(y&&"function"==typeof r.g.Promise){if(s(i,m),t=c(t,a,"Password"),e=c(e,a,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){d()((function(){e(null,t)}))}),(function(t){d()((function(){e(t)}))}))}(function(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=p(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return h[t]=e,e}(y).then((function(r){return r?p(t,e,i,m,y):u(t,e,i,m,g)})),b)}else d()((function(){var r;try{r=u(t,e,i,m,g)}catch(t){return b(t)}b(null,r)}))}},4540:(t,e,r)=>{var n;n=r.g.process&&r.g.process.browser?"utf-8":r.g.process&&r.g.process.version?parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",t.exports=n},8775:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!=r)throw new TypeError("Bad key length")}},7757:(t,e,r)=>{var n=r(4781),i=r(5991),o=r(1396),s=r(7512).Buffer,a=r(8775),u=r(4540),c=r(2891),f=s.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,f],u));for(var c=s.allocUnsafe(u+l[t]),h=s.allocUnsafe(u+l[t]),d=0;d<u;d++)c[d]=54^e[d],h[d]=92^e[d];var p=s.allocUnsafe(u+r+4);c.copy(p,0,0,u),this.ipad1=p,this.ipad2=c,this.opad=h,this.alg=t,this.blocksize=u,this.hash=a,this.size=l[t]}h.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,r,n,i){a(r,n);var o=new h(i=i||"sha1",t=c(t,u,"Password"),(e=c(e,u,"Salt")).length),f=s.allocUnsafe(n),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,m=l[i],g=Math.ceil(n/m),b=1;b<=g;b++){d.writeUInt32BE(b,e.length);for(var y=o.run(d,o.ipad1),v=y,w=1;w<r;w++){v=o.run(v,o.ipad2);for(var _=0;_<m;_++)y[_]^=v[_]}y.copy(f,p),p+=m}return f}},2891:(t,e,r)=>{var n=r(7512).Buffer;t.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},5473:(t,e,r)=>{"use strict";r.r(e),r.d(e,{Children:()=>yt,Component:()=>v,Fragment:()=>y,PureComponent:()=>dt,Suspense:()=>_t,SuspenseList:()=>St,cloneElement:()=>Ft,createContext:()=>U,createElement:()=>m,createFactory:()=>Ut,createPortal:()=>Tt,createRef:()=>b,default:()=>Kt,findDOMNode:()=>zt,forwardRef:()=>gt,hydrate:()=>Bt,isValidElement:()=>jt,lazy:()=>Et,memo:()=>pt,render:()=>Rt,unmountComponentAtNode:()=>qt,unstable_batchedUpdates:()=>Ht,useCallback:()=>rt,useContext:()=>nt,useDebugValue:()=>it,useEffect:()=>J,useErrorBoundary:()=>ot,useImperativeHandle:()=>tt,useLayoutEffect:()=>Z,useMemo:()=>et,useReducer:()=>Y,useRef:()=>Q,useState:()=>X,version:()=>Lt});var n,i,o,s,a,u,c,f={},l=[],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;n<arguments.length;n++)r.push(i[n]);if(null!=r&&(o.children=r),"function"==typeof t&&null!=t.defaultProps)for(n in t.defaultProps)void 0===o[n]&&(o[n]=t.defaultProps[n]);return g(t,o,e&&e.key,e&&e.ref,null)}function g(t,e,r,i,o){var s={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o};return null==o&&(s.__v=s),n.vnode&&n.vnode(s),s}function b(){return{}}function y(t){return t.children}function v(t,e){this.props=t,this.context=e}function w(t,e){if(null==e)return t.__?w(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?w(t):null}function _(t){var e,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(r=t.__k[e])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return _(t)}}function A(t){(!t.__d&&(t.__d=!0)&&i.push(t)&&!o++||a!==n.debounceRendering)&&((a=n.debounceRendering)||s)(E)}function E(){for(var t;o=i.length;)t=i.sort((function(t,e){return t.__v.__b-e.__v.__b})),i=[],t.some((function(t){var e,r,n,i,o,s,a;t.__d&&(s=(o=(e=t).__v).__e,(a=e.__P)&&(r=[],(n=d({},o)).__v=n,i=I(a,o,n,e.__n,void 0!==a.ownerSVGElement,null,r,null==s?w(o):s),C(r,o),i!=s&&_(o)))}))}function S(t,e,r,n,i,o,s,a,u){var c,h,d,m,g,b,y,v=r&&r.__k||l,_=v.length;if(a==f&&(a=null!=o?o[0]:_?w(r,0):null),c=0,e.__k=M(e.__k,(function(r){if(null!=r){if(r.__=e,r.__b=e.__b+1,null===(d=v[c])||d&&r.key==d.key&&r.type===d.type)v[c]=void 0;else for(h=0;h<_;h++){if((d=v[h])&&r.key==d.key&&r.type===d.type){v[h]=void 0;break}d=null}if(m=I(t,r,d=d||f,n,i,o,s,a,u),(h=r.ref)&&d.ref!=h&&(y||(y=[]),d.ref&&y.push(d.ref,null,r),y.push(h,r.__c||m,r)),null!=m){var l;if(null==b&&(b=m),void 0!==r.__d)l=r.__d,r.__d=void 0;else if(o==d||m!=a||null==m.parentNode){t:if(null==a||a.parentNode!==t)t.appendChild(m),l=null;else{for(g=a,h=0;(g=g.nextSibling)&&h<_;h+=2)if(g==m)break t;t.insertBefore(m,a),l=a}"option"==e.type&&(t.value="")}a=void 0!==l?l:m.nextSibling,"function"==typeof e.type&&(e.__d=a)}else a&&d.__e==a&&a.parentNode!=t&&(a=w(d))}return c++,r})),e.__e=b,null!=o&&"function"!=typeof e.type)for(c=o.length;c--;)null!=o[c]&&p(o[c]);for(c=_;c--;)null!=v[c]&&N(v[c],v[c]);if(y)for(c=0;c<y.length;c++)B(y[c],y[++c],y[++c])}function M(t,e,r){if(null==r&&(r=[]),null==t||"boolean"==typeof t)e&&r.push(e(null));else if(Array.isArray(t))for(var n=0;n<t.length;n++)M(t[n],e,r);else r.push(e?e("string"==typeof t||"number"==typeof t?g(null,t,null,null,t):null!=t.__e||null!=t.__c?g(t.type,t.props,t.key,null,t.__v):t):t);return r}function x(t,e,r){"-"===e[0]?t.setProperty(e,r):t[e]="number"==typeof r&&!1===h.test(e)?r+"px":null==r?"":r}function k(t,e,r,n,i){var o,s,a,u,c;if(i?"className"===e&&(e="class"):"class"===e&&(e="className"),"style"===e)if(o=t.style,"string"==typeof r)o.cssText=r;else{if("string"==typeof n&&(o.cssText="",n=null),n)for(u in n)r&&u in r||x(o,u,"");if(r)for(c in r)n&&r[c]===n[c]||x(o,c,r[c])}else"o"===e[0]&&"n"===e[1]?(s=e!==(e=e.replace(/Capture$/,"")),a=e.toLowerCase(),e=(a in t?a:e).slice(2),r?(n||t.addEventListener(e,T,s),(t.l||(t.l={}))[e]=r):t.removeEventListener(e,T,s)):"list"!==e&&"tagName"!==e&&"form"!==e&&"type"!==e&&"size"!==e&&!i&&e in t?t[e]=null==r?"":r:"function"!=typeof r&&"dangerouslySetInnerHTML"!==e&&(e!==(e=e.replace(/^xlink:?/,""))?null==r||!1===r?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):null==r||!1===r&&!/^ar/.test(e)?t.removeAttribute(e):t.setAttribute(e,r))}function T(t){this.l[t.type](n.event?n.event(t):t)}function I(t,e,r,i,o,s,a,u,c){var f,l,h,p,m,g,b,w,_,A,E=e.type;if(void 0!==e.constructor)return null;(f=n.__b)&&f(e);try{t:if("function"==typeof E){if(w=e.props,_=(f=E.contextType)&&i[f.__c],A=f?_?_.props.value:f.__:i,r.__c?b=(l=e.__c=r.__c).__=l.__E:("prototype"in E&&E.prototype.render?e.__c=l=new E(w,A):(e.__c=l=new v(w,A),l.constructor=E,l.render=O),_&&_.sub(l),l.props=w,l.state||(l.state={}),l.context=A,l.__n=i,h=l.__d=!0,l.__h=[]),null==l.__s&&(l.__s=l.state),null!=E.getDerivedStateFromProps&&(l.__s==l.state&&(l.__s=d({},l.__s)),d(l.__s,E.getDerivedStateFromProps(w,l.__s))),p=l.props,m=l.state,h)null==E.getDerivedStateFromProps&&null!=l.componentWillMount&&l.componentWillMount(),null!=l.componentDidMount&&l.__h.push(l.componentDidMount);else{if(null==E.getDerivedStateFromProps&&w!==p&&null!=l.componentWillReceiveProps&&l.componentWillReceiveProps(w,A),!l.__e&&null!=l.shouldComponentUpdate&&!1===l.shouldComponentUpdate(w,l.__s,A)||e.__v===r.__v&&!l.__){for(l.props=w,l.state=l.__s,e.__v!==r.__v&&(l.__d=!1),l.__v=e,e.__e=r.__e,e.__k=r.__k,l.__h.length&&a.push(l),f=0;f<e.__k.length;f++)e.__k[f]&&(e.__k[f].__=e);break t}null!=l.componentWillUpdate&&l.componentWillUpdate(w,l.__s,A),null!=l.componentDidUpdate&&l.__h.push((function(){l.componentDidUpdate(p,m,g)}))}l.context=A,l.props=w,l.state=l.__s,(f=n.__r)&&f(e),l.__d=!1,l.__v=e,l.__P=t,f=l.render(l.props,l.state,l.context),e.__k=null!=f&&f.type==y&&null==f.key?f.props.children:Array.isArray(f)?f:[f],null!=l.getChildContext&&(i=d(d({},i),l.getChildContext())),h||null==l.getSnapshotBeforeUpdate||(g=l.getSnapshotBeforeUpdate(p,m)),S(t,e,r,i,o,s,a,u,c),l.base=e.__e,l.__h.length&&a.push(l),b&&(l.__E=l.__=null),l.__e=!1}else null==s&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=R(r.__e,e,r,i,o,s,a,c);(f=n.diffed)&&f(e)}catch(t){e.__v=null,n.__e(t,e,r)}return e.__e}function C(t,e){n.__c&&n.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){n.__e(t,e.__v)}}))}function R(t,e,r,n,i,o,s,a){var u,c,h,d,p,m=r.props,g=e.props;if(i="svg"===e.type||i,null!=o)for(u=0;u<o.length;u++)if(null!=(c=o[u])&&((null===e.type?3===c.nodeType:c.localName===e.type)||t==c)){t=c,o[u]=null;break}if(null==t){if(null===e.type)return document.createTextNode(g);t=i?document.createElementNS("http://www.w3.org/2000/svg",e.type):document.createElement(e.type,g.is&&{is:g.is}),o=null,a=!1}if(null===e.type)m!==g&&t.data!=g&&(t.data=g);else{if(null!=o&&(o=l.slice.call(t.childNodes)),h=(m=r.props||f).dangerouslySetInnerHTML,d=g.dangerouslySetInnerHTML,!a){if(m===f)for(m={},p=0;p<t.attributes.length;p++)m[t.attributes[p].name]=t.attributes[p].value;(d||h)&&(d&&h&&d.__html==h.__html||(t.innerHTML=d&&d.__html||""))}(function(t,e,r,n,i){var o;for(o in r)"children"===o||"key"===o||o in e||k(t,o,null,r[o],n);for(o in e)i&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||r[o]===e[o]||k(t,o,e[o],r[o],n)})(t,g,m,i,a),d?e.__k=[]:(e.__k=e.props.children,S(t,e,r,n,"foreignObject"!==e.type&&i,o,s,f,a)),a||("value"in g&&void 0!==(u=g.value)&&u!==t.value&&k(t,"value",u,m.value,!1),"checked"in g&&void 0!==(u=g.checked)&&u!==t.checked&&k(t,"checked",u,m.checked,!1))}return t}function B(t,e,r){try{"function"==typeof t?t(e):t.current=e}catch(t){n.__e(t,r)}}function N(t,e,r){var i,o,s;if(n.unmount&&n.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||B(i,null,e)),r||"function"==typeof t.type||(r=null!=(o=t.__e)),t.__e=t.__d=void 0,null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){n.__e(t,e)}i.base=i.__P=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&N(i[s],e,r);null!=o&&p(o)}function O(t,e,r){return this.constructor(t,r)}function P(t,e,r){var i,o,s;n.__&&n.__(t,e),o=(i=r===u)?null:r&&r.__k||e.__k,t=m(y,null,[t]),s=[],I(e,(i?e:r||e).__k=t,o||f,f,void 0!==e.ownerSVGElement,r&&!i?[r]:o?null:l.slice.call(e.childNodes),s,r||f,i),C(s,t)}function D(t,e){P(t,e,u)}function L(t,e){var r,n;for(n in e=d(d({},t.props),e),arguments.length>2&&(e.children=l.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 U(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,A(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 A(r.__E=r)}catch(e){t=e}throw t}},v.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),A(this))},v.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),A(this))},v.prototype.render=y,i=[],o=0,s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=f,c=0;var j,F,q,z=0,H=[],K=n.__r,G=n.diffed,W=n.__c,V=n.unmount;function $(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 X(t){return z=1,Y(ft,t)}function Y(t,e,r){var n=$(j++,2);return n.__c||(n.__c=F,n.__=[r?r(e):ft(void 0,e),function(e){var r=t(n.__[0],e);n.__[0]!==r&&(n.__[0]=r,n.__c.setState({}))}]),n.__}function J(t,e){var r=$(j++,3);!n.__s&&ct(r.__H,e)&&(r.__=t,r.__H=e,F.__H.__h.push(r))}function Z(t,e){var r=$(j++,4);!n.__s&&ct(r.__H,e)&&(r.__=t,r.__H=e,F.__h.push(r))}function Q(t){return z=5,et((function(){return{current:t}}),[])}function tt(t,e,r){z=6,Z((function(){"function"==typeof t?t(e()):t&&(t.current=e())}),null==r?r:r.concat(t))}function et(t,e){var r=$(j++,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=$(j++,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=$(j++,10),r=X();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(e){return t.__H.__h=[],n.__e(e,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 ft(t,e){return"function"==typeof e?e(t):e}function lt(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),j=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)&&q===n.requestAnimationFrame||((q=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(r){e.some((function(t){t.__h&&(t.__h=[])})),e=[],n.__e(r,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}(v);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,lt({},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=lt({},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 bt=function(t,e){return t?M(t).reduce((function(t,r,n){return t.concat(e(r,n))}),[]):null},yt={map:bt,forEach:bt,count:function(t){return t?M(t).length:0},only:function(t){if(1!==(t=M(t)).length)throw new Error("Children.only() expects only one child.");return t[0]},toArray:M},vt=n.__e;function wt(t){return t&&((t=lt({},t)).__c=null,t.__k=t.__k&&t.__k.map(wt)),t}function _t(){this.__u=0,this.o=null,this.__b=null}function At(t){var e=t.__.__c;return e&&e.u&&e.u(t)}function Et(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 St(){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);vt(t,e,r)},(_t.prototype=new v).__c=function(t,e){var r=this;null==r.o&&(r.o=[]),r.o.push(e);var n=At(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(v,null,e.u?null:t.children),e.u&&t.fallback]};var Mt=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]<r[0])break;t.i=r=r[2]}};(St.prototype=new v).u=function(t){var e=this,r=At(e.__v),n=e.l.get(t);return n[0]++,function(i){var o=function(){e.props.revealOrder?(n.push(i),Mt(e,t,n)):i()};r?r(o):o()}},St.prototype.render=function(t){this.i=null,this.l=new Map;var e=M(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var r=e.length;r--;)this.l.set(e[r],this.i=[1,0,this.i]);return t.children},St.prototype.componentDidUpdate=St.prototype.componentDidMount=function(){var t=this;t.l.forEach((function(e,r){Mt(t,r,e)}))};var xt=function(){function t(){}var e=t.prototype;return e.getChildContext=function(){return this.props.context},e.render=function(t){return t.children},t}();function kt(t){var e=this,r=t.container,n=m(xt,{context:e.context},t.vnode);return e.s&&e.s!==r&&(e.v.parentNode&&e.s.removeChild(e.v),N(e.h),e.p=!1),t.vnode?e.p?(r.__k=e.__k,P(n,r),e.__k=r.__k):(e.v=document.createTextNode(""),D("",r),r.appendChild(e.v),e.p=!0,e.s=r,P(n,r,e.v),e.__k=e.v.__k):e.p&&(e.v.parentNode&&e.s.removeChild(e.v),N(e.h)),e.h=n,e.componentWillUnmount=function(){e.v.parentNode&&e.s.removeChild(e.v),N(e.h)},null}function Tt(t,e){return m(kt,{vnode:t,container:e})}var It=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/;v.prototype.isReactComponent={};var Ct="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;function Rt(t,e,r){if(null==e.__k)for(;e.firstChild;)e.removeChild(e.firstChild);return P(t,e),"function"==typeof r&&r(),t?t.__c:null}function Bt(t,e,r){return D(t,e),"function"==typeof r&&r(),t?t.__c:null}var Nt=n.event;function Ot(t,e){t["UNSAFE_"+e]&&!t[e]&&Object.defineProperty(t,e,{configurable:!1,get:function(){return this["UNSAFE_"+e]},set:function(t){this["UNSAFE_"+e]=t}})}n.event=function(t){Nt&&(t=Nt(t)),t.persist=function(){};var e=!1,r=!1,n=t.stopPropagation;t.stopPropagation=function(){n.call(t),e=!0};var i=t.preventDefault;return t.preventDefault=function(){i.call(t),r=!0},t.isPropagationStopped=function(){return e},t.isDefaultPrevented=function(){return r},t.nativeEvent=t};var Pt={configurable:!0,get:function(){return this.class}},Dt=n.vnode;n.vnode=function(t){t.$$typeof=Ct;var e=t.type,r=t.props;if(e){if(r.class!=r.className&&(Pt.enumerable="className"in r,null!=r.className&&(r.class=r.className),Object.defineProperty(r,"className",Pt)),"function"!=typeof e){var n,i,o;for(o in r.defaultValue&&void 0!==r.value&&(r.value||0===r.value||(r.value=r.defaultValue),delete r.defaultValue),Array.isArray(r.value)&&r.multiple&&"select"===e&&(M(r.children).forEach((function(t){-1!=r.value.indexOf(t.props.value)&&(t.props.selected=!0)})),delete r.value),r)if(n=It.test(o))break;if(n)for(o in i=t.props={},r)i[It.test(o)?o.replace(/[A-Z0-9]/,"-$&").toLowerCase():o]=r[o]}!function(e){var r=t.type,n=t.props;if(n&&"string"==typeof r){var i={};for(var o in n)/^on(Ani|Tra|Tou)/.test(o)&&(n[o.toLowerCase()]=n[o],delete n[o]),i[o.toLowerCase()]=o;if(i.ondoubleclick&&(n.ondblclick=n[i.ondoubleclick],delete n[i.ondoubleclick]),i.onbeforeinput&&(n.onbeforeinput=n[i.onbeforeinput],delete n[i.onbeforeinput]),i.onchange&&("textarea"===r||"input"===r.toLowerCase()&&!/^fil|che|ra/i.test(n.type))){var s=i.oninput||"oninput";n[s]||(n[s]=n[i.onchange],delete n[i.onchange])}}}(),"function"==typeof e&&!e.m&&e.prototype&&(Ot(e.prototype,"componentWillMount"),Ot(e.prototype,"componentWillReceiveProps"),Ot(e.prototype,"componentWillUpdate"),e.m=!0)}Dt&&Dt(t)};var Lt="16.8.0";function Ut(t){return m.bind(null,t)}function jt(t){return!!t&&t.$$typeof===Ct}function Ft(t){return jt(t)?L.apply(null,arguments):t}function qt(t){return!!t.__k&&(P(null,t),!0)}function zt(t){return t&&(t.base||1===t.nodeType&&t)||null}var Ht=function(t,e){return t(e)};const Kt={useState:X,useReducer:Y,useEffect:J,useLayoutEffect:Z,useRef:Q,useImperativeHandle:tt,useMemo:et,useCallback:rt,useContext:nt,useDebugValue:it,version:"16.8.0",Children:yt,render:Rt,hydrate:Rt,unmountComponentAtNode:qt,createPortal:Tt,createElement:m,createContext:U,createFactory:Ut,cloneElement:Ft,createRef:b,Fragment:y,isValidElement:jt,findDOMNode:zt,Component:v,PureComponent:dt,memo:pt,forwardRef:gt,unstable_batchedUpdates:Ht,Suspense:_t,SuspenseList:St,lazy:Et}},9475:(t,e,r)=>{e.publicEncrypt=r(6559),e.privateDecrypt=r(9818),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},8936:(t,e,r)=>{var n=r(1667),i=r(7512).Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},9818:(t,e,r)=>{var n=r(6581),i=r(8936),o=r(9296),s=r(9611),a=r(2657),u=r(1667),c=r(1555),f=r(7512).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var h,d=n(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");h=r?c(new s(e),d):a(e,d);var m=f.alloc(p-h.length);if(h=f.concat([m,h],p),4===l)return function(t,e){var r=t.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),s=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),c=e.slice(s+1),l=o(a,i(c,s)),h=o(c,i(l,r-s-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));for(var i=-1;++i<n;)r+=t[i]^e[i];return r}(n,h.slice(0,s)))throw new Error("decryption error");for(var d=s;0===h[d];)d++;if(1!==h[d++])throw new Error("decryption error");return h.slice(d)}(d,h);if(1===l)return function(t,e,r){for(var n=e.slice(0,2),i=2,o=0;0!==e[i++];)if(i>=e.length){o++;break}var s=e.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++,s.length<8&&o++,o)throw new Error("decryption error");return e.slice(i)}(0,h,r);if(3===l)return h;throw new Error("unknown padding")}},6559:(t,e,r)=>{var n=r(6581),i=r(3313),o=r(1667),s=r(8936),a=r(9296),u=r(9611),c=r(1555),f=r(2657),l=r(7512).Buffer;t.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===h)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,c=o("sha1").update(l.alloc(0)).digest(),f=c.length,h=2*f;if(n>r-h-2)throw new Error("message too long");var d=l.alloc(r-n-h-2),p=r-f-1,m=i(f),g=a(l.concat([c,d,l.alloc(1,1),e],p),s(m,p)),b=a(m,s(g,f));return new u(l.concat([l.alloc(1),b,g],r))}(p,e);else if(1===h)d=function(t,e,r){var n,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");return n=r?l.alloc(s-o-3,255):function(t){for(var e,r=l.allocUnsafe(t),n=0,o=i(2*t),s=0;n<t;)s===o.length&&(o=i(2*t),s=0),(e=o[s++])&&(r[n++]=e);return r}(s-o-3),new u(l.concat([l.from([0,r?1:2]),n,l.alloc(1),e],s))}(p,e,r);else{if(3!==h)throw new Error("unknown padding");if((d=new u(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?f(d,p):c(d,p)}},1555:(t,e,r)=>{var n=r(9611),i=r(7512).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},9296:t=>{t.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},2366:(t,e,r)=>{var n=r(953),i=r(2681),o=r(7497),s=r(7322);function a(t,e,r,o,s){var a=[].slice.call(arguments,1),u=a.length,c="function"==typeof a[u-1];if(!c&&!n())throw new Error("Callback required as last argument");if(!c){if(u<1)throw new Error("Too few arguments provided");return 1===u?(r=e,e=o=void 0):2!==u||e.getContext||(o=r,r=e,e=void 0),new Promise((function(n,s){try{var a=i.create(r,o);n(t(a,e,o))}catch(t){s(t)}}))}if(u<2)throw new Error("Too few arguments provided");2===u?(s=r,r=e,e=o=void 0):3===u&&(e.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=r,r=e,e=void 0));try{var f=i.create(r,o);s(null,t(f,e,o))}catch(t){s(t)}}e.create=i.create,e.toCanvas=a.bind(null,o.render),e.toDataURL=a.bind(null,o.renderToDataURL),e.toString=a.bind(null,(function(t,e,r){return s.render(t,r)}))},953:t=>{t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},9885:(t,e,r)=>{var n=r(7738).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];for(var e=Math.floor(t/7)+2,r=n(t),i=145===r?26:2*Math.ceil((r-13)/(2*e-2)),o=[r-7],s=1;s<e-1;s++)o[s]=o[s-1]-i;return o.push(6),o.reverse()},e.getPositions=function(t){for(var r=[],n=e.getRowColCoords(t),i=n.length,o=0;o<i;o++)for(var s=0;s<i;s++)0===o&&0===s||0===o&&s===i-1||o===i-1&&0===s||r.push([n[o],n[s]]);return r}},3376:(t,e,r)=>{var n=r(7179),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(t){this.mode=n.ALPHANUMERIC,this.data=t}o.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var e;for(e=0;e+2<=this.data.length;e+=2){var r=45*i.indexOf(this.data[e]);r+=i.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(i.indexOf(this.data[e]),6)},t.exports=o},7578:t=>{function e(){this.buffer=[],this.length=0}e.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var r=0;r<e;r++)this.putBit(1==(t>>>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},9862:(t,e,r)=>{var n=r(412);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},1564:(t,e,r)=>{var n=r(412),i=r(7179);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<r;e++)t.put(this.data[e],8)},t.exports=o},6984:(t,e,r)=>{var n=r(5599),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case n.L:return i[4*(t-1)+0];case n.M:return i[4*(t-1)+1];case n.Q:return i[4*(t-1)+2];case n.H:return i[4*(t-1)+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return o[4*(t-1)+0];case n.M:return o[4*(t-1)+1];case n.Q:return o[4*(t-1)+2];case n.H:return o[4*(t-1)+3];default:return}}},5599:(t,e)=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=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(t){return r}}},854:(t,e,r)=>{var n=r(7738).getSymbolSize;e.getPositions=function(t){var e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},2964:(t,e,r)=>{var n=r(7738),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<<n.getBCHDigit(o)-i;return 21522^(r<<10|o)}},9778:(t,e,r)=>{var n=r(412),i=n.alloc(512),o=n.alloc(256);!function(){for(var t=1,e=0;e<255;e++)i[e]=t,o[t]=e,256&(t<<=1)&&(t^=285);for(e=255;e<512;e++)i[e]=i[e-255]}(),e.log=function(t){if(t<1)throw new Error("log("+t+")");return o[t]},e.exp=function(t){return i[t]},e.mul=function(t,e){return 0===t||0===e?0:i[o[t]+o[e]]}},6882:(t,e,r)=>{var n=r(7179),i=r(7738);function o(t){this.mode=n.KANJI,this.data=t}o.getBitsLength=function(t){return 13*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=i.toSJIS(this.data[e]);if(r>=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},5499:(t,e)=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function r(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,r=0,n=0,i=0,o=null,s=null,a=0;a<e;a++){n=i=0,o=s=null;for(var u=0;u<e;u++){var c=t.get(a,u);c===o?n++:(n>=5&&(r+=n-5+3),o=c,n=1),(c=t.get(u,a))===s?i++:(i>=5&&(r+=i-5+3),s=c,i=1)}n>=5&&(r+=n-5+3),i>=5&&(r+=i-5+3)}return r},e.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var o=t.get(n,i)+t.get(n,i+1)+t.get(n+1,i)+t.get(n+1,i+1);4!==o&&0!==o||r++}return 3*r},e.getPenaltyN3=function(t){for(var e=t.size,r=0,n=0,i=0,o=0;o<e;o++){n=i=0;for(var s=0;s<e;s++)n=n<<1&2047|t.get(o,s),s>=10&&(1488===n||93===n)&&r++,i=i<<1&2047|t.get(s,o),s>=10&&(1488===i||93===i)&&r++}return 40*r},e.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n<r;n++)e+=t.data[n];return 10*Math.abs(Math.ceil(100*e/r/5)-10)},e.applyMask=function(t,e){for(var n=e.size,i=0;i<n;i++)for(var o=0;o<n;o++)e.isReserved(o,i)||e.xor(o,i,r(t,o,i))},e.getBestMask=function(t,r){for(var n=Object.keys(e.Patterns).length,i=0,o=1/0,s=0;s<n;s++){r(s),e.applyMask(s,t);var a=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),a<o&&(o=a,i=s)}return i}},7179:(t,e,r)=>{var n=r(501),i=r(307);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(e))throw new Error("Invalid version: "+e);return e>=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(t){return r}}},4102:(t,e,r)=>{var n=r(7179);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},5302:(t,e,r)=>{var n=r(412),i=r(9778);e.mul=function(t,e){for(var r=n.alloc(t.length+e.length-1),o=0;o<t.length;o++)for(var s=0;s<e.length;s++)r[o+s]^=i.mul(t[o],e[s]);return r},e.mod=function(t,e){for(var r=n.from(t);r.length-e.length>=0;){for(var o=r[0],s=0;s<e.length;s++)r[s]^=i.mul(e[s],o);for(var a=0;a<r.length&&0===r[a];)a++;r=r.slice(a)}return r},e.generateECPolynomial=function(t){for(var r=n.from([1]),o=0;o<t;o++)r=e.mul(r,[1,i.exp(o)]);return r}},2681:(t,e,r)=>{var n=r(412),i=r(7738),o=r(5599),s=r(7578),a=r(9862),u=r(9885),c=r(854),f=r(5499),l=r(6984),h=r(325),d=r(9713),p=r(2964),m=r(7179),g=r(6667),b=r(7955);function y(t,e,r){var n,i,o=t.size,s=p.getEncodedBits(e,r);for(n=0;n<15;n++)i=1==(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 v(t,e,r,o){var p;if(b(t))p=g.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");var v=e;if(!v){var w=g.rawSplit(t);v=d.getBestVersionForData(w,r)}p=g.fromString(t,v||40)}var _=d.getBestVersionForData(p,r);if(!_)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<_)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+_+".\n")}else e=_;var A=function(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)-l.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<u;c++)o.put(c%2?17:236,8);return function(t,e,r){for(var o=i.getSymbolTotalCodewords(e),s=o-l.getTotalCodewordsCount(e,r),a=l.getBlocksCount(e,r),u=a-o%a,c=Math.floor(o/a),f=Math.floor(s/a),d=f+1,p=c-f,m=new h(p),g=0,b=new Array(a),y=new Array(a),v=0,w=n.from(t.buffer),_=0;_<a;_++){var A=_<u?f:d;b[_]=w.slice(g,g+A),y[_]=m.encode(b[_]),g+=A,v=Math.max(v,A)}var E,S,M=n.alloc(o),x=0;for(E=0;E<v;E++)for(S=0;S<a;S++)E<b[S].length&&(M[x++]=b[S][E]);for(E=0;E<p;E++)for(S=0;S<a;S++)M[x++]=y[S][E];return M}(o,t,e)}(e,r,p),E=i.getSymbolSize(e),S=new a(E);return function(t,e){for(var r=t.size,n=c.getPositions(e),i=0;i<n.length;i++)for(var o=n[i][0],s=n[i][1],a=-1;a<=7;a++)if(!(o+a<=-1||r<=o+a))for(var u=-1;u<=7;u++)s+u<=-1||r<=s+u||(a>=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))}(S,e),function(t){for(var e=t.size,r=8;r<e-8;r++){var n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(S),function(t,e){for(var r=u.getPositions(e),n=0;n<r.length;n++)for(var i=r[n][0],o=r[n][1],s=-2;s<=2;s++)for(var a=-2;a<=2;a++)-2===s||2===s||-2===a||2===a||0===s&&0===a?t.set(i+s,o+a,!0,!0):t.set(i+s,o+a,!1,!0)}(S,e),y(S,r,0),e>=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)}(S,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<e.length&&(c=1==(e[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}}}(S,A),isNaN(o)&&(o=f.getBestMask(S,y.bind(null,S,r))),f.applyMask(o,S),y(S,r,o),{modules:S,version:e,errorCorrectionLevel:r,maskPattern:o,segments:p}}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=f.from(e.maskPattern),e.toSJISFunc&&i.setToSJISFunction(e.toSJISFunc)),v(t,r,s,n)}},325:(t,e,r)=>{var n=r(412),i=r(5302),o=r(973).lW;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},307:(t,e)=>{var r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(r=r.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=new RegExp(r,"g"),e.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=new RegExp(n,"g"),e.NUMERIC=new RegExp("[0-9]+","g"),e.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var i=new RegExp("^"+r+"$"),o=new RegExp("^[0-9]+$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return i.test(t)},e.testNumeric=function(t){return o.test(t)},e.testAlphanumeric=function(t){return s.test(t)}},6667:(t,e,r)=>{var n=r(7179),i=r(4102),o=r(3376),s=r(1564),a=r(6882),u=r(307),c=r(7738),f=r(9687);function l(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<u.bit)throw new Error('"'+t+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(u));switch(r!==n.KANJI||c.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new i(t);case n.ALPHANUMERIC:return new o(t);case n.KANJI:return new a(t);case n.BYTE:return new s(t)}}e.fromArray=function(t){return t.reduce((function(t,e){return"string"==typeof e?t.push(m(e,null)):e.data&&t.push(m(e.data,e.mode)),t}),[])},e.fromString=function(t,r){for(var i=function(t){for(var e=[],r=0;r<t.length;r++){var i=t[r];switch(i.mode){case n.NUMERIC:e.push([i,{data:i.data,mode:n.ALPHANUMERIC,length:i.length},{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.ALPHANUMERIC:e.push([i,{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.KANJI:e.push([i,{data:i.data,mode:n.BYTE,length:l(i.data)}]);break;case n.BYTE:e.push([{data:i.data,mode:n.BYTE,length:l(i.data)}])}}return e}(d(t,c.isKanjiModeEnabled())),o=function(t,e){for(var r={},i={start:{}},o=["start"],s=0;s<t.length;s++){for(var a=t[s],u=[],c=0;c<a.length;c++){var f=a[c],l=""+s+c;u.push(l),r[l]={node:f,lastCount:0},i[l]={};for(var h=0;h<o.length;h++){var d=o[h];r[d]&&r[d].node.mode===f.mode?(i[d][l]=p(r[d].lastCount+f.length,f.mode)-p(r[d].lastCount,f.mode),r[d].lastCount+=f.length):(r[d]&&(r[d].lastCount=f.length),i[d][l]=p(f.length,f.mode)+4+n.getCharCountIndicator(f.mode,e))}}o=u}for(h=0;h<o.length;h++)i[o[h]].end=0;return{map:i,table:r}}(i,r),s=f.find_path(o.map,"start","end"),a=[],u=1;u<s.length-1;u++)a.push(o.table[s[u]].node);return e.fromArray(a.reduce((function(t,e){var r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[]))},e.rawSplit=function(t){return e.fromArray(d(t,c.isKanjiModeEnabled()))}},7738:(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)}},501:(t,e)=>{e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},9713:(t,e,r)=>{var n=r(7738),i=r(6984),o=r(5599),s=r(7179),a=r(501),u=r(7955),c=n.getBCHDigit(7973);function f(t,e){return s.getCharCountIndicator(t,e)+4}function l(t,e){var r=0;return t.forEach((function(t){var n=f(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-f(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(l(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<<n.getBCHDigit(e)-c;return t<<12|e}},7497:(t,e,r)=>{var n=r(5667);e.render=function(t,e,r){var i=r,o=e;void 0!==i||e&&e.getContext||(i=e,e=void 0),e||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),i=n.getOptions(i);var s=n.getImageWidth(t.modules.size,i),a=o.getContext("2d"),u=a.createImageData(s,s);return n.qrToImageData(u.data,t,i),function(t,e,r){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=r,e.width=r,e.style.height=r+"px",e.style.width=r+"px"}(a,o,s),a.putImageData(u,0,0),o},e.renderToDataURL=function(t,r,n){var i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});var o=e.render(t,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},7322:(t,e,r)=>{var n=r(5667);function i(t,e){var r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function o(t,e,r){var n=t+e;return void 0!==r&&(n+=" "+r),n}e.render=function(t,e,r){var s=n.getOptions(e),a=t.modules.size,u=t.modules.data,c=a+2*s.margin,f=s.color.light.a?"<path "+i(s.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",l="<path "+i(s.color.dark,"stroke")+' d="'+function(t,e,r){for(var n="",i=0,s=!1,a=0,u=0;u<t.length;u++){var c=Math.floor(u%e),f=Math.floor(u/e);c||s||(s=!0),t[u]?(a++,u>0&&c>0&&t[u-1]||(n+=s?o("M",c+r,.5+f+r):o("m",i,0),i=0,s=!1),c+1<e&&t[u+1]||(n+=o("h",a),a=0)):i++}return n}(u,a,s.margin)+'"/>',h='viewBox="0 0 '+c+" "+c+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+h+' shape-rendering="crispEdges">'+f+l+"</svg>\n";return"function"==typeof r&&r(null,d),d}},5667:(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],f=0;f<a;f++)for(var l=0;l<a;l++){var h=4*(f*a+l),d=n.color.light;f>=u&&l>=u&&f<a-u&&l<a-u&&(d=c[o[Math.floor((f-u)/s)*i+Math.floor((l-u)/s)]?1:0]),t[h++]=d.r,t[h++]=d.g,t[h++]=d.b,t[h]=d.a}}},412:(t,e,r)=>{"use strict";var n=r(7955);o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}();var i=o.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function o(t,e,r){return o.TYPED_ARRAY_SUPPORT||this instanceof o?"number"==typeof t?u(this,t):function(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");var i;return i=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),o.TYPED_ARRAY_SUPPORT?i.__proto__=o.prototype:i=c(t,i),i}(t,e,r,n):"string"==typeof e?function(t,e){var r=0|l(e),n=a(t,r),i=n.write(e);return i!==r&&(n=n.slice(0,i)),n}(t,e):function(t,e){if(o.isBuffer(e)){var r=0|s(e.length),n=a(t,r);return 0===n.length||e.copy(n,0,0,r),n}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(i=e.length)!=i?a(t,0):c(t,e);if("Buffer"===e.type&&Array.isArray(e.data))return c(t,e.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}(this,t,e,r):new o(t,e,r)}function s(t){if(t>=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;n<e;++n)r[n]=0;return r}function c(t,e){for(var r=e.length<0?0:0|s(e.length),n=a(t,r),i=0;i<r;i+=1)n[i]=255&e[i];return n}function f(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&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 l(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:f(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<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}(f(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&&(e=t),o.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=o.prototype;else{var i=e-t;r=new o(i,void 0);for(var s=0;s<i;++s)r[s]=this[s+t]}return r},o.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=t.length-e+r);var i,s=n-r;if(this===t&&r<e&&e<n)for(i=s-1;i>=0;--i)t[i+e]=this[i+r];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+s),e);return s},o.prototype.fill=function(t,e,r){if("string"==typeof t){if("string"==typeof e?(e=0,r=this.length):"string"==typeof r&&(r=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=o.isBuffer(t)?t:new o(t),a=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this},o.concat=function(t,e){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a(null,0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var i=u(null,e),s=0;for(r=0;r<t.length;++r){var c=t[r];if(!o.isBuffer(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(i,s),s+=c.length}return i},o.byteLength=l,o.prototype._isBuffer=!0,o.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.exports.alloc=function(t){var e=new o(t);return e.fill(0),e},t.exports.from=function(t){return new o(t)}},973:(t,e,r)=>{"use strict";var n=r(5155),i=r(4525),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=u,e.h2=50;var s=2147483647;function a(t){if(t>s)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 l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),n=a(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(q(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(q(t,ArrayBuffer)||t&&q(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(q(t,SharedArrayBuffer)||t&&q(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}return void 0!==t.length?"number"!=typeof t.length||z(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(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 f(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 l(t){return f(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<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=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)||q(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 U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(i)return n?-1:U(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 C(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return M(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(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:v(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):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(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 f=-1;for(o=r;o<a;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(t,o+h)!==c(e,h)){l=!1;break}if(l)return o}return-1}function w(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(z(a))return s;t[r+s]=a}return s}function _(t,e,r,n){return F(U(e,t.length-r),t,r,n)}function A(t,e,r,n){return F(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return F(j(e),t,r,n)}function S(t,e,r,n){return F(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function M(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,c=t[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=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)&&(f=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&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=k)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=k));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return f(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return l(t)},u.allocUnsafeSlow=function(t){return l(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(q(o,Uint8Array))i+o.length>n.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;e<t;e+=2)b(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(q(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),f=t.slice(e,r),l=0;l<a;++l)if(c[l]!==f[l]){o=c[l],s=f[l];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=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 A(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(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 k=4096;function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function I(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=H[t[o]];return i}function R(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function B(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(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 P(t,e,r,n,o){return e=+e,r>>>=0,o||O(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,o){return e=+e,r>>>=0,o||O(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<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(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||B(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||B(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||B(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||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||B(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||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||B(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||B(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||B(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||B(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||B(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||B(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||B(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||B(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||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||N(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||N(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||N(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||N(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||N(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||N(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);N(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(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.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);N(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||N(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||N(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||N(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||N(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||N(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 P(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(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<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var s=u.isBuffer(t)?t:u.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var L=/[^+/0-9A-Za-z-_]/g;function U(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&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 j(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function q(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}()},4663:t=>{"use strict";var e=String.prototype.replace,r=/%20/g,n="RFC3986";t.exports={default:n,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:n}},5907:(t,e,r)=>{"use strict";var n=r(38),i=r(6186),o=r(4663);t.exports={formats:o,parse:i,stringify:n}},6186:(t,e,r)=>{"use strict";var n=r(3304),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},u=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},c=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,f=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;f.push(c)}for(var l=0;r.depth>0&&null!==(a=s.exec(o))&&l<r.depth;){if(l+=1,!r.plainObjects&&i.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(a[1])}return a&&f.push("["+o.slice(a.index)+"]"),function(t,e,r,n){for(var i=n?e:u(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,f=parseInt(c,10);r.parseArrays||""!==c?!isNaN(f)&&a!==c&&String(f)===c&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(s=[])[f]=i:"__proto__"!==c&&(s[c]=i):s={0:i}}i=s}return i}(f,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return s;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?s.charset:t.charset;return{allowDots:void 0===t.allowDots?s.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:s.comma,decoder:"function"==typeof t.decoder?t.decoder:s.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:s.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var f="string"==typeof t?function(t,e){var r,c={},f=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,l=e.parameterLimit===1/0?void 0:e.parameterLimit,h=f.split(e.delimiter,l),d=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r<h.length;++r)0===h[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[r]?p="utf-8":"utf8=%26%2310003%3B"===h[r]&&(p="iso-8859-1"),d=r,r=h.length);for(r=0;r<h.length;++r)if(r!==d){var m,g,b=h[r],y=b.indexOf("]="),v=-1===y?b.indexOf("="):y+1;-1===v?(m=e.decoder(b,s.decoder,p,"key"),g=e.strictNullHandling?null:""):(m=e.decoder(b.slice(0,v),s.decoder,p,"key"),g=n.maybeMap(u(b.slice(v+1),e),(function(t){return e.decoder(t,s.decoder,p,"value")}))),g&&e.interpretNumericEntities&&"iso-8859-1"===p&&(g=a(g)),b.indexOf("[]=")>-1&&(g=o(g)?[g]:g),i.call(c,m)?c[m]=n.combine(c[m],g):c[m]=g}return c}(t,r):t,l=r.plainObjects?Object.create(null):{},h=Object.keys(f),d=0;d<h.length;++d){var p=h[d],m=c(p,f[p],r,"string"==typeof t);l=n.merge(l,m,r)}return n.compact(l)}},38:(t,e,r)=>{"use strict";var n=r(3304),i=r(4663),o=Object.prototype.hasOwnProperty,s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},a=Array.isArray,u=String.prototype.split,c=Array.prototype.push,f=function(t,e){c.apply(t,a(e)?e:[e])},l=Date.prototype.toISOString,h=i.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:h,formatter:i.formatters[h],indices:!1,serializeDate:function(t){return l.call(t)},skipNulls:!1,strictNullHandling:!1},p=function t(e,r,i,o,s,c,l,h,p,m,g,b,y,v){var w,_=e;if("function"==typeof l?_=l(r,_):_ instanceof Date?_=m(_):"comma"===i&&a(_)&&(_=n.maybeMap(_,(function(t){return t instanceof Date?m(t):t}))),null===_){if(o)return c&&!y?c(r,d.encoder,v,"key",g):r;_=""}if("string"==typeof(w=_)||"number"==typeof w||"boolean"==typeof w||"symbol"==typeof w||"bigint"==typeof w||n.isBuffer(_)){if(c){var A=y?r:c(r,d.encoder,v,"key",g);if("comma"===i&&y){for(var E=u.call(String(_),","),S="",M=0;M<E.length;++M)S+=(0===M?"":",")+b(c(E[M],d.encoder,v,"value",g));return[b(A)+"="+S]}return[b(A)+"="+b(c(_,d.encoder,v,"value",g))]}return[b(r)+"="+b(String(_))]}var x,k=[];if(void 0===_)return k;if("comma"===i&&a(_))x=[{value:_.length>0?_.join(",")||null:void 0}];else if(a(l))x=l;else{var T=Object.keys(_);x=h?T.sort(h):T}for(var I=0;I<x.length;++I){var C=x[I],R="object"==typeof C&&void 0!==C.value?C.value:_[C];if(!s||null!==R){var B=a(_)?"function"==typeof i?i(r,C):r:r+(p?"."+C:"["+C+"]");f(k,t(R,B,i,o,s,c,l,h,p,m,g,b,y,v))}}return k};t.exports=function(t,e){var r,n=t,u=function(t){if(!t)return d;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||d.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=i.default;if(void 0!==t.format){if(!o.call(i.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=i.formatters[r],s=d.filter;return("function"==typeof t.filter||a(t.filter))&&(s=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===t.allowDots?d.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:d.charsetSentinel,delimiter:void 0===t.delimiter?d.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:d.encode,encoder:"function"==typeof t.encoder?t.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:d.encodeValuesOnly,filter:s,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:d.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:d.strictNullHandling}}(e);"function"==typeof u.filter?n=(0,u.filter)("",n):a(u.filter)&&(r=u.filter);var c,l=[];if("object"!=typeof n||null===n)return"";c=e&&e.arrayFormat in s?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var h=s[c];r||(r=Object.keys(n)),u.sort&&r.sort(u.sort);for(var m=0;m<r.length;++m){var g=r[m];u.skipNulls&&null===n[g]||f(l,p(n[g],g,h,u.strictNullHandling,u.skipNulls,u.encode?u.encoder:null,u.filter,u.sort,u.allowDots,u.serializeDate,u.format,u.formatter,u.encodeValuesOnly,u.charset))}var b=l.join(u.delimiter),y=!0===u.addQueryPrefix?"?":"";return u.charsetSentinel&&("iso-8859-1"===u.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),b.length>0?y+b:""}},3304:(t,e,r)=>{"use strict";var n=r(4663),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r};t.exports={arrayToObject:a,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],s=i.obj[i.prop],a=Object.keys(s),u=0;u<a.length;++u){var c=a[u],f=s[c];"object"==typeof f&&null!==f&&-1===r.indexOf(f)&&(e.push({obj:s,prop:c}),r.push(f))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,i,o){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var u="",c=0;c<a.length;++c){var f=a.charCodeAt(c);45===f||46===f||95===f||126===f||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===n.RFC1738&&(40===f||41===f)?u+=a.charAt(c):f<128?u+=s[f]:f<2048?u+=s[192|f>>6]+s[128|63&f]:f<55296||f>=57344?u+=s[224|f>>12]+s[128|f>>6&63]+s[128|63&f]:(c+=1,f=65536+((1023&f)<<10|1023&a.charCodeAt(c)),u+=s[240|f>>18]+s[128|f>>12&63]+s[128|f>>6&63]+s[128|63&f])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(o(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var s=e;return o(e)&&!o(r)&&(s=a(e,n)),o(e)&&o(r)?(r.forEach((function(r,o){if(i.call(e,o)){var s=e[o];s&&"object"==typeof s&&r&&"object"==typeof r?e[o]=t(s,r,n):e.push(r)}else e[o]=r})),e):Object.keys(r).reduce((function(e,o){var s=r[o];return i.call(e,o)?e[o]=t(e[o],s,n):e[o]=s,e}),s)}}},6575:(t,e,r)=>{"use strict";const n=r(9449),i=r(3947),o=r(2704);function s(t){if("string"!=typeof t||1!==t.length)throw new TypeError("arrayFormatSeparator must be single character string")}function a(t,e){return e.encode?e.strict?n(t):encodeURIComponent(t):t}function u(t,e){return e.decode?i(t):t}function c(t){return Array.isArray(t)?t.sort():"object"==typeof t?c(Object.keys(t)).sort(((t,e)=>Number(t)-Number(e))).map((e=>t[e])):t}function f(t){const e=t.indexOf("#");return-1!==e&&(t=t.slice(0,e)),t}function l(t){const e=(t=f(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 t of Object.keys(n)){const r=n[t];if("object"==typeof r&&null!==r)for(const t of Object.keys(r))r[t]=h(r[t],e);else n[t]=h(r,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=l,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 e of Object.keys(t))r(e)||(i[e]=t[e]);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(l(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:u(n,e)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=f(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}`}},9370:(t,e)=>{"use strict";var r=Object.prototype.hasOwnProperty;function n(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}function i(t){try{return encodeURIComponent(t)}catch(t){return null}}e.stringify=function(t,e){e=e||"";var n,o,s=[];for(o in"string"!=typeof e&&(e="?"),t)if(r.call(t,o)){if((n=t[o])||null!=n&&!isNaN(n)||(n=""),o=i(o),n=i(n),null===o||null===n)continue;s.push(o+"="+n)}return s.length?e+s.join("&"):""},e.parse=function(t){for(var e,r=/([^=?#&]+)=?([^&]*)/g,i={};e=r.exec(t);){var o=n(e[1]),s=n(e[2]);null===o||null===s||o in i||(i[o]=s)}return i}},3313:(t,e,r)=>{"use strict";var n=65536,i=r(7512).Buffer,o=r.g.crypto||r.g.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(t);if(t>0)if(t>n)for(var s=0;s<t;s+=n)o.getRandomValues(r.slice(s,s+n));else o.getRandomValues(r);return"function"==typeof e?process.nextTick((function(){e(null,r)})):r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},6451:(t,e,r)=>{"use strict";function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var i=r(7512),o=r(3313),s=i.Buffer,a=i.kMaxLength,u=r.g.crypto||r.g.msCrypto,c=Math.pow(2,32)-1;function f(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>c||t<0)throw new TypeError("offset must be a uint32");if(t>a||t>e)throw new RangeError("offset out of range")}function l(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>c||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>a)throw new RangeError("buffer too small")}function h(t,e,r,n){if(process.browser){var i=t.buffer,s=new Uint8Array(i,e,r);return u.getRandomValues(s),n?void process.nextTick((function(){n(null,t)})):t}if(!n)return o(r).copy(t,e),t;o(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!process.browser?(e.randomFill=function(t,e,n,i){if(!(s.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return f(e,t.length),l(n,e,t.length),h(t,e,n,i)},e.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(s.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return f(e,t.length),void 0===n&&(n=t.length-e),l(n,e,t.length),h(t,e,n)}):(e.randomFill=n,e.randomFillSync=n)},9235:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"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,u;if("string"==typeof e&&(o="not ",e.substr(0,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"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". 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},7345:(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(2083),o=r(5723);r(8575)(c,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(t){if(!(this instanceof c))return new c(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||process.nextTick(l,this)}function l(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},1217:(t,e,r)=>{"use strict";t.exports=i;var n=r(2994);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(8575)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},2083:(t,e,r)=>{"use strict";var n;t.exports=S,S.ReadableState=E,r(5939).EventEmitter;var i,o=function(t,e){return t.listeners(e).length},s=r(8412),a=r(2486).Buffer,u=r.g.Uint8Array||function(){},c=r(4616);i=c&&c.debuglog?c.debuglog("stream"):function(){};var f,l,h,d=r(7380),p=r(303),m=r(4480).getHighWaterMark,g=r(9235).q,b=g.ERR_INVALID_ARG_TYPE,y=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(8575)(S,s);var _=p.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(t,e,i){n=n||r(7345),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=r(301).s),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function S(t){if(n=n||r(7345),!(this instanceof S))return new S(t);var e=this instanceof n;this._readableState=new E(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function M(t,e,r,n,o){i("readableAddChunk",e);var s,c=t._readableState;if(null===e)c.reading=!1,function(t,e){if(i("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?I(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,C(t)))}}(t,c);else if(o||(s=function(t,e){var r,n;return n=e,a.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e)),r}(c,e)),s)_(t,s);else if(c.objectMode||e&&e.length>0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)c.endEmitted?_(t,new w):x(t,c,e,!0);else if(c.ended)_(t,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?x(t,c,e,!1):R(t,c)):x(t,c,e,!1)}else n||(c.reading=!1,R(t,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function x(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&I(t)),R(t,e)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(t,e){e(t)},S.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),M(this,t,e,!1,r)},S.prototype.unshift=function(t){return M(this,t,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(t){f||(f=r(301).s);var e=new f(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var k=1073741824;function T(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(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;i("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(i("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(C,t))}function C(t){var e=t._readableState;i("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,D(t)}function R(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(i("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function N(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function O(t){i("readable nexttick read 0"),t.read(0)}function P(t,e){i("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(i("flow",e.flowing);e.flowing&&null!==t.read(););}function L(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 U(t){var e=t._readableState;i("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(j,e,t))}function j(t,e){if(i("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<n;r++)if(t[r]===e)return r;return-1}S.prototype.read=function(t){i("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return i("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):I(this),null;if(0===(t=T(t,e))&&e.ended)return 0===e.length&&U(this),null;var n,o=e.needReadable;return i("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&i("length less than watermark",o=!0),e.ended||e.reading?i("reading or ended",o=!1):o&&(i("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=T(r,e))),null===(n=t>0?L(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&&U(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(t){_(this,new v("_read()"))},S.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,i("pipe count=%d opts=%j",n.pipesCount,e);var s=e&&!1===e.end||t===process.stdout||t===process.stderr?p:a;function a(){i("onend"),t.end()}n.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",(function e(o,s){i("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),t.removeListener("close",h),t.removeListener("finish",d),t.removeListener("drain",u),t.removeListener("error",l),t.removeListener("unpipe",e),r.removeListener("end",a),r.removeListener("end",p),r.removeListener("data",f),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}));var u=function(t){return function(){var e=t._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",u);var c=!1;function f(e){i("ondata");var o=t.write(e);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==F(n.pipes,t))&&!c&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function l(e){i("onerror",e),p(),t.removeListener("error",l),0===o(t,"error")&&_(t,e)}function h(){t.removeListener("finish",d),p()}function d(){i("onfinish"),t.removeListener("close",h),p()}function p(){i("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.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",l),t.once("close",h),t.once("finish",d),t.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),t},S.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;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},S.prototype.on=function(t,e){var r=s.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?I(this):n.reading||process.nextTick(O,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(t,e){var r=s.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(N,this),r},S.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(N,this),e},S.prototype.resume=function(){var t=this._readableState;return t.flowing||(i("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(P,t,e))}(this,t)),t.paused=!1,this},S.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var o in t.on("end",(function(){if(i("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(n=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var s=0;s<A.length;s++)t.on(A[s],this.emit.bind(this,A[s]));return this._read=function(e){i("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=r(3658)),l(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),S._fromList=L,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(t,e){return void 0===h&&(h=r(9827)),h(S,t,e)})},2994:(t,e,r)=>{"use strict";t.exports=f;var n=r(9235).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(7345);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);u.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",l)}function l(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(e,r){h(t,e,r)}))}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(8575)(f,u),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new i("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},5723:(t,e,r)=>{"use strict";function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var i;t.exports=S,S.WritableState=E;var o,s={deprecate:r(9440)},a=r(8412),u=r(2486).Buffer,c=r.g.Uint8Array||function(){},f=r(303),l=r(4480).getHighWaterMark,h=r(9235).q,d=h.ERR_INVALID_ARG_TYPE,p=h.ERR_METHOD_NOT_IMPLEMENTED,m=h.ERR_MULTIPLE_CALLBACK,g=h.ERR_STREAM_CANNOT_PIPE,b=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,w=h.ERR_UNKNOWN_ENCODING,_=f.errorOrDestroy;function A(){}function E(t,e,o){i=i||r(7345),t=t||{},"boolean"!=typeof o&&(o=e instanceof i),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(C,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),C(t,e))}(t,r,n,e,i);else{var o=T(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||k(t,r),n?process.nextTick(x,t,r,o,i):x(t,r,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function S(t){var e=this instanceof(i=i||r(7345));if(!e&&!o.call(S,this))return new S(t);this._writableState=new E(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function M(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),C(t,e)}function k(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,M(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(M(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function T(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),C(t,e)}))}function C(t,e){var r=T(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(I,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(8575)(S,a),E.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===S&&t&&t._writableState instanceof E}})):o=function(t){return t instanceof this},S.prototype.pipe=function(){_(this,new g)},S.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=t,u.isBuffer(n)||n instanceof c);return s&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=A),i.ending?function(t,e){var r=new v;_(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i;return null===r?i=new y:"string"==typeof r||e.objectMode||(i=new d("chunk",["string","Buffer"],r)),!i||(_(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var c=e.length<e.highWaterMark;if(c||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else M(t,e,!1,a,n,i,o);return c}(this,i,s,t,e,r)),o},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||k(this,t))},S.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(t,e,r){r(new p("_write()"))},S.prototype._writev=null,S.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,C(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(t,e){e(t)}},3658:(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(3759),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),l=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[f]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function m(t){process.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),b=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[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[c]?r(d(void 0,!0)):e[l](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[l])}return this[f]=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(b,(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,l,{value:function(t,e){var n=r[h].read();n?(r[f]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[f]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[f]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[c]=!0})),t.on("readable",m.bind(null,r)),r}},7380:(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;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=r(2486).Buffer,a=r(2361).inspect,u=a&&a.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r;return e=t,r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?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 t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.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;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],r&&o(e.prototype,r),t}()},303:t=>{"use strict";function e(t,e){n(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,t)):process.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,t)):process.nextTick(e,o,t):i?(process.nextTick(r,o),i(t)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},3759:(t,e,r)=>{"use strict";var n=r(9235).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||f()},c=e._writableState&&e._writableState.finished,f=function(){a=!1,c=!0,s||o.call(e)},l=e._readableState&&e._readableState.endEmitted,h=function(){s=!1,l=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!l?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!c?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},m=function(){e.req.on("finish",f)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",f),e.on("abort",p),e.req?m():e.on("request",m)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",h),e.on("finish",f),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",f),e.removeListener("abort",p),e.removeListener("request",m),e.req&&e.req.removeListener("finish",f),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",f),e.removeListener("end",h),e.removeListener("error",d),e.removeListener("close",p)}}},9827:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},7494:(t,e,r)=>{"use strict";var n,i=r(9235).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(3759)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,i=l(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var s=e.map((function(t,r){var o=r<e.length-1;return u(t,o,r>0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(f)}},4480:(t,e,r)=>{"use strict";var n=r(9235).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}}},8412:(t,e,r)=>{t.exports=r(5939).EventEmitter},8104:(t,e,r)=>{(e=t.exports=r(2083)).Stream=e,e.Readable=e,e.Writable=r(5723),e.Duplex=r(7345),e.Transform=r(2994),e.PassThrough=r(1217),e.finished=r(3759),e.pipeline=r(7494)},1926:t=>{"use strict";t.exports=function(t,e){if(e=e.split(":")[0],!(t=+t))return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},5991:(t,e,r)=>{"use strict";var n=r(2486).Buffer,i=r(8575),o=r(4634),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],f=[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],l=[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<<e|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 b(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function y(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function v(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,A=0|this._c,E=0|this._d,S=0|this._e,M=0;M<80;M+=1){var x,k;M<16?(x=m(r,n,i,o,d,t[a[M]],l[0],c[M]),k=v(w,_,A,E,S,t[u[M]],h[0],f[M])):M<32?(x=g(r,n,i,o,d,t[a[M]],l[1],c[M]),k=y(w,_,A,E,S,t[u[M]],h[1],f[M])):M<48?(x=b(r,n,i,o,d,t[a[M]],l[2],c[M]),k=b(w,_,A,E,S,t[u[M]],h[2],f[M])):M<64?(x=y(r,n,i,o,d,t[a[M]],l[3],c[M]),k=g(w,_,A,E,S,t[u[M]],h[3],f[M])):(x=v(r,n,i,o,d,t[a[M]],l[4],c[M]),k=m(w,_,A,E,S,t[u[M]],h[4],f[M])),r=d,d=o,o=p(i,10),i=n,n=x,w=S,S=E,E=p(A,10),A=_,_=k}var T=this._b+i+E|0;this._b=this._c+o+S|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+n+A|0,this._a=T},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},7512:(t,e,r)=>{var n=r(2486),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)}},4563:(t,e,r)=>{"use strict";var n,i=r(2486),o=i.Buffer,s={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=i[n]);var a=s.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=o[n]);if(s.Buffer.prototype=o.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=o(t);return e&&0!==e.length?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s},9374:function(t){"use strict";!function(e){const r=2147483647;function n(t){const e=new Uint32Array([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]);let r=1779033703,n=3144134277,i=1013904242,o=2773480762,s=1359893119,a=2600822924,u=528734635,c=1541459225;const f=new Uint32Array(64);function l(t){let l=0,h=t.length;for(;h>=64;){let d,p,m,g,b,y=r,v=n,w=i,_=o,A=s,E=a,S=u,M=c;for(p=0;p<16;p++)m=l+4*p,f[p]=(255&t[m])<<24|(255&t[m+1])<<16|(255&t[m+2])<<8|255&t[m+3];for(p=16;p<64;p++)d=f[p-2],g=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=f[p-15],b=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,f[p]=(g+f[p-7]|0)+(b+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&E^~A&S)|0)+(M+(e[p]+f[p]|0)|0)|0,b=((y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10))+(y&v^y&w^v&w)|0,M=S,S=E,E=A,A=_+g|0,_=w,w=v,v=y,y=g+b|0;r=r+y|0,n=n+v|0,i=i+w|0,o=o+_|0,s=s+A|0,a=a+E|0,u=u+S|0,c=c+M|0,l+=64,h-=64}}l(t);let h,d=t.length%64,p=t.length/536870912|0,m=t.length<<3,g=d<56?56:120,b=t.slice(t.length-d,t.length);for(b.push(128),h=d+1;h<g;h++)b.push(0);return b.push(p>>>24&255),b.push(p>>>16&255),b.push(p>>>8&255),b.push(p>>>0&255),b.push(m>>>24&255),b.push(m>>>16&255),b.push(m>>>8&255),b.push(m>>>0&255),l(b),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255]}function i(t,e,r){t=t.length<=64?t:n(t);const i=64+e.length+4,o=new Array(i),s=new Array(64);let a,u=[];for(a=0;a<64;a++)o[a]=54;for(a=0;a<t.length;a++)o[a]^=t[a];for(a=0;a<e.length;a++)o[64+a]=e[a];for(a=i-4;a<i;a++)o[a]=0;for(a=0;a<64;a++)s[a]=92;for(a=0;a<t.length;a++)s[a]^=t[a];function c(){for(let t=i-1;t>=i-4;t--){if(o[t]++,o[t]<=255)return;o[t]=0}}for(;r>=32;)c(),u=u.concat(n(s.concat(n(o)))),r-=32;return r>0&&(c(),u=u.concat(n(s.concat(n(o))).slice(0,r))),u}function o(t,e,r,n,i){let o;for(c(t,16*(2*r-1),i,0,16),o=0;o<2*r;o++)u(t,16*o,i,16),a(i,n),c(i,0,t,e+16*o,16);for(o=0;o<r;o++)c(t,e+2*o*16,t,16*o,16);for(o=0;o<r;o++)c(t,e+16*(2*o+1),t,16*(o+r),16)}function s(t,e){return t<<e|t>>>32-e}function a(t,e){c(t,0,e,0,16);for(let t=8;t>0;t-=2)e[4]^=s(e[0]+e[12],7),e[8]^=s(e[4]+e[0],9),e[12]^=s(e[8]+e[4],13),e[0]^=s(e[12]+e[8],18),e[9]^=s(e[5]+e[1],7),e[13]^=s(e[9]+e[5],9),e[1]^=s(e[13]+e[9],13),e[5]^=s(e[1]+e[13],18),e[14]^=s(e[10]+e[6],7),e[2]^=s(e[14]+e[10],9),e[6]^=s(e[2]+e[14],13),e[10]^=s(e[6]+e[2],18),e[3]^=s(e[15]+e[11],7),e[7]^=s(e[3]+e[15],9),e[11]^=s(e[7]+e[3],13),e[15]^=s(e[11]+e[7],18),e[1]^=s(e[0]+e[3],7),e[2]^=s(e[1]+e[0],9),e[3]^=s(e[2]+e[1],13),e[0]^=s(e[3]+e[2],18),e[6]^=s(e[5]+e[4],7),e[7]^=s(e[6]+e[5],9),e[4]^=s(e[7]+e[6],13),e[5]^=s(e[4]+e[7],18),e[11]^=s(e[10]+e[9],7),e[8]^=s(e[11]+e[10],9),e[9]^=s(e[8]+e[11],13),e[10]^=s(e[9]+e[8],18),e[12]^=s(e[15]+e[14],7),e[13]^=s(e[12]+e[15],9),e[14]^=s(e[13]+e[12],13),e[15]^=s(e[14]+e[13],18);for(let r=0;r<16;++r)t[r]+=e[r]}function u(t,e,r,n){for(let i=0;i<n;i++)r[i]^=t[e+i]}function c(t,e,r,n,i){for(;i--;)r[n++]=t[e++]}function f(t){if(!t||"number"!=typeof t.length)return!1;for(let e=0;e<t.length;e++){const r=t[e];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function l(t,e){if("number"!=typeof t||t%1)throw new Error("invalid "+e);return t}function h(t,e,n,s,a,h,d){if(n=l(n,"N"),s=l(s,"r"),a=l(a,"p"),h=l(h,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/s)throw new Error("N too large");if(s>r/128/a)throw new Error("r too large");if(!f(t))throw new Error("password must be an array or buffer");if(t=Array.prototype.slice.call(t),!f(e))throw new Error("salt must be an array or buffer");e=Array.prototype.slice.call(e);let p=i(t,e,128*a*s);const m=new Uint32Array(32*a*s);for(let t=0;t<m.length;t++){const e=4*t;m[t]=(255&p[e+3])<<24|(255&p[e+2])<<16|(255&p[e+1])<<8|(255&p[e+0])<<0}const g=new Uint32Array(64*s),b=new Uint32Array(32*s*n),y=32*s,v=new Uint32Array(16),w=new Uint32Array(16),_=a*n*2;let A,E,S=0,M=null,x=!1,k=0,T=0;const I=d?parseInt(1e3/s):4294967295,C="undefined"!=typeof setImmediate?setImmediate:setTimeout,R=function(){if(x)return d(new Error("cancelled"),S/_);let e;switch(k){case 0:E=32*T*s,c(m,E,g,0,y),k=1,A=0;case 1:e=n-A,e>I&&(e=I);for(let t=0;t<e;t++)c(g,0,b,(A+t)*y,y),o(g,y,s,v,w);if(A+=e,S+=e,d){const t=parseInt(1e3*S/_);if(t!==M){if(x=d(null,S/_),x)break;M=t}}if(A<n)break;A=0,k=2;case 2:e=n-A,e>I&&(e=I);for(let t=0;t<e;t++){const t=g[16*(2*s-1)]&n-1;u(b,t*y,g,y),o(g,y,s,v,w)}if(A+=e,S+=e,d){const t=parseInt(1e3*S/_);if(t!==M){if(x=d(null,S/_),x)break;M=t}}if(A<n)break;if(c(g,0,m,E,y),T++,T<a){k=0;break}p=[];for(let t=0;t<m.length;t++)p.push(m[t]>>0&255),p.push(m[t]>>8&255),p.push(m[t]>>16&255),p.push(m[t]>>24&255);const r=i(t,p,h);return d&&d(null,1,r),r}d&&C(R)};if(!d)for(;;){const t=R();if(null!=t)return t}R()}const d={scrypt:function(t,e,r,n,i,o,s){return new Promise((function(a,u){let c=0;s&&s(0),h(t,e,r,n,i,o,(function(t,e,r){if(t)u(t);else if(r)s&&1!==c&&s(1),a(new Uint8Array(r));else if(s&&e!==c)return c=e,s(e)}))}))},syncScrypt:function(t,e,r,n,i,o){return new Uint8Array(h(t,e,r,n,i,o))}};t.exports=d}()},8886:(t,e,r)=>{var n=r(7512).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<o;){for(var u=s%i,c=Math.min(o-a,i-u),f=0;f<c;f++)r[u+f]=t[a+f];a+=c,(s+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=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},1396:(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(1820),n.sha1=r(7276),n.sha224=r(7570),n.sha256=r(7093),n.sha384=r(7692),n.sha512=r(266)},1820:(t,e,r)=>{var n=r(8575),i=r(8886),o=r(7512).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 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,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var d=~~(h/20),p=0|((e=n)<<5|e>>>27)+f(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},7276:(t,e,r)=>{var n=r(8575),i=r(8886),o=r(7512).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 f(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,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)+l(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=f(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},7570:(t,e,r)=>{var n=r(8575),i=r(7093),o=r(8886),s=r(7512).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},7093:(t,e,r)=>{var n=r(8575),i=r(8886),o=r(7512).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 f(t,e,r){return t&e|r&(t|e)}function l(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,b=0;b<16;++b)r[b]=t.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((e=r[b-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[b-7]+d(r[b-15])+r[b-16];for(var y=0;y<64;++y){var v=g+h(u)+c(u,p,m)+s[y]+r[y]|0,w=l(n)+f(n,i,o)|0;g=m,m=p,p=u,u=a+v|0,a=o,o=i,i=n,n=v+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},7692:(t,e,r)=>{var n=r(8575),i=r(266),o=r(8886),s=r(7512).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},266:(t,e,r)=>{var n=r(8575),i=r(8886),o=r(7512).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 f(t,e,r){return t&e|r&(t|e)}function l(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 b(t,e){return t>>>0<e>>>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,y=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,A=0|this._cl,E=0|this._dl,S=0|this._el,M=0|this._fl,x=0|this._gl,k=0|this._hl,T=0;T<32;T+=2)e[T]=t.readInt32BE(4*T),e[T+1]=t.readInt32BE(4*T+4);for(;T<160;T+=2){var I=e[T-30],C=e[T-30+1],R=d(I,C),B=p(C,I),N=m(I=e[T-4],C=e[T-4+1]),O=g(C,I),P=e[T-14],D=e[T-14+1],L=e[T-32],U=e[T-32+1],j=B+D|0,F=R+P+b(j,B)|0;F=(F=F+N+b(j=j+O|0,O)|0)+L+b(j=j+U|0,U)|0,e[T]=F,e[T+1]=j}for(var q=0;q<160;q+=2){F=e[q],j=e[q+1];var z=f(r,n,i),H=f(w,_,A),K=l(r,w),G=l(w,r),W=h(a,S),V=h(S,a),$=s[q],X=s[q+1],Y=c(a,u,y),J=c(S,M,x),Z=k+V|0,Q=v+W+b(Z,k)|0;Q=(Q=(Q=Q+Y+b(Z=Z+J|0,J)|0)+$+b(Z=Z+X|0,X)|0)+F+b(Z=Z+j|0,j)|0;var tt=G+H|0,et=K+z+b(tt,G)|0;v=y,k=x,y=u,x=M,u=a,M=S,a=o+Q+b(S=E+Z|0,E)|0,o=i,E=A,i=n,A=_,n=r,_=w,r=Q+et+b(w=Z+tt|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+A|0,this._dl=this._dl+E|0,this._el=this._el+S|0,this._fl=this._fl+M|0,this._gl=this._gl+x|0,this._hl=this._hl+k|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+n+b(this._bl,_)|0,this._ch=this._ch+i+b(this._cl,A)|0,this._dh=this._dh+o+b(this._dl,E)|0,this._eh=this._eh+a+b(this._el,S)|0,this._fh=this._fh+u+b(this._fl,M)|0,this._gh=this._gh+y+b(this._gl,x)|0,this._hh=this._hh+v+b(this._hl,k)|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},2704: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)]}},202:(t,e,r)=>{t.exports=i;var n=r(5939).EventEmitter;function i(){n.call(this)}r(8575)(i,n),i.Readable=r(2083),i.Writable=r(5723),i.Duplex=r(7345),i.Transform=r(2994),i.PassThrough=r(1217),i.finished=r(3759),i.pipeline=r(7494),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(f(),0===n.listenerCount(this,"error"))throw t}function f(){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",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",c),t.on("error",c),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},5237:(t,e,r)=>{var n=r(4054),i=r(8184),o=r(3674),s=r(4768),a=r(9098),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,f=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?s+"//"+u:"")+(c?":"+c:"")+f,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var l=new n(t);return e&&l.on("response",e),l},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"]},3651:(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(t){}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},4054:(t,e,r)=>{var n=r(2486).Buffer,i=r(3651),o=r(8575),s=r(8184),a=r(8104),u=s.IncomingMessage,c=s.readyStates,f=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(f,a.Writable),f.prototype.setHeader=function(t,e){var r=t.toLowerCase();-1===l.indexOf(r)&&(this._headers[r]={name:t,value:e})},f.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null},f.prototype.removeHeader=function(t){delete this._headers[t.toLowerCase()]},f.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 f=t._xhr=new r.g.XMLHttpRequest;try{f.open(t._opts.method,t._opts.url,!0)}catch(e){return void process.nextTick((function(){t.emit("error",e)}))}"responseType"in f&&(f.responseType=t._mode),"withCredentials"in f&&(f.withCredentials=!!e.withCredentials),"text"===t._mode&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(f.timeout=e.requestTimeout,f.ontimeout=function(){t.emit("requestTimeout")}),s.forEach((function(t){f.setRequestHeader(t[0],t[1])})),t._response=null,f.onreadystatechange=function(){switch(f.readyState){case c.LOADING:case c.DONE:t._onXHRProgress()}},"moz-chunked-arraybuffer"===t._mode&&(f.onprogress=function(){t._onXHRProgress()}),f.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{f.send(o)}catch(e){return void process.nextTick((function(){t.emit("error",e)}))}}}},f.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),function(t){try{var e=t.status;return null!==e&&0!==e}catch(t){return!1}}(t._xhr)&&!t._destroyed&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))},f.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))},f.prototype._write=function(t,e,r){this._body.push(t),r()},f.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))},f.prototype.abort=f.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)},f.prototype.end=function(t,e,r){"function"==typeof t&&(r=t,t=void 0),a.Writable.prototype.end.call(this,t,e,r)},f.prototype.setTimeout=function(t,e){var r=this;e&&r.once("timeout",e),r._socketTimeout=t,r._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var l=["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"]},8184:(t,e,r)=>{var n=r(2486).Buffer,i=r(3651),o=r(8575),s=r(8104),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(t){}}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 f=a.rawHeaders["mime-type"];if(f){var l=f.match(/;\s*charset=([^;])(;|$)/);l&&(a._charset=l[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;c<s.length;c++)u[c]=255&s.charCodeAt(c);e.push(u)}else e.push(s,e._charset);e._pos=o.length}break;case"arraybuffer":if(i.readyState!==a.DONE||!i.response)break;o=i.response,e.push(n.from(new Uint8Array(o)));break;case"moz-chunked-arraybuffer":if(o=i.response,i.readyState!==a.LOADING||!o)break;e.push(n.from(new Uint8Array(o)));break;case"ms-stream":if(o=i.response,i.readyState!==a.LOADING)break;var f=new r.g.MSStreamReader;f.onprogress=function(){f.result.byteLength>e._pos&&(e.push(n.from(new Uint8Array(f.result.slice(e._pos)))),e._pos=f.result.byteLength)},f.onload=function(){t(!0),e.push(null)},f.readAsArrayBuffer(o)}e._xhr.readyState===a.DONE&&"ms-stream"!==e._mode&&(t(!0),e.push(null))}},9449:t=>{"use strict";t.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))},301:(t,e,r)=>{"use strict";var n=r(7512).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=f,this.end=l,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 f(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 l(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<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(e[n]))>=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):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}},2858:t=>{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function r(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(t){r.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}})),r.prototype._setDefaults=function(t){this._defaults.forEach((function(r){var n;t[r.fn].apply(t,function(t){if(Array.isArray(t))return e(t)}(n=r.args)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(n)||function(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}))},t.exports=r},5391:(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;"undefined"!=typeof window?i=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),i=void 0):i=self;var o=r(1069),s=r(5799),a=r(5907),u=r(4287),c=r(9905),f=r(969),l=r(2858);function h(){}t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var d=e=t.exports;e.Request=w,d.getXHR=function(){if(i.XMLHttpRequest&&(!i.location||"file:"!==i.location.protocol||!i.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function m(t){if(!c(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&g(e,r,t[r]);return e.join("&")}function g(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){g(t,e,r)}));else if(c(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&g(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function b(t){for(var e,r,n={},i=t.split("&"),o=0,s=i.length;o<s;++o)-1===(r=(e=i[o]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function y(t){return/[/+]json($|[^-\w])/i.test(t)}function v(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,i,o=t.split(/\r?\n/),s={},a=0,u=o.length;a<u;++a)-1!==(e=(r=o[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),i=p(r.slice(e+1)),s[n]=i);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function w(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new v(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}function _(t,e,r){var n=d("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}d.serializeObject=m,d.parseString=b,d.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},d.serialize={"application/x-www-form-urlencoded":a.stringify,"application/json":s},d.parse={"application/x-www-form-urlencoded":b,"application/json":JSON.parse},f(v.prototype),v.prototype._parseBody=function(t){var e=d.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&y(this.type)&&(e=d.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},v.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},d.Response=v,o(w.prototype),u(w.prototype),w.prototype.type=function(t){return this.set("Content-Type",d.types[t]||t),this},w.prototype.accept=function(t){return this.set("Accept",d.types[t]||t),this},w.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var i=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,i)},w.prototype.query=function(t){return"string"!=typeof t&&(t=m(t)),t&&this._query.push(t),this},w.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},w.prototype._getFormData=function(){return this._formData||(this._formData=new i.FormData),this._formData},w.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},w.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},w.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},w.prototype.ca=w.prototype.agent,w.prototype.buffer=w.prototype.ca,w.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},w.prototype.pipe=w.prototype.write,w.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},w.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||h,this._finalizeQueryString(),this._end()},w.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},w.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=d.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],o=this._serializer||d.serialize[i?i.split(";")[0]:""];!o&&y(i)&&(o=d.serialize["application/json"]),o&&(r=o(r))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&e.setRequestHeader(s,this.header[s]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},d.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){l.prototype[t.toLowerCase()]=function(e,r){var n=new d.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),l.prototype.del=l.prototype.delete,d.get=function(t,e,r){var n=d("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},d.head=function(t,e,r){var n=d("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},d.options=function(t,e,r){var n=d("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},d.del=_,d.delete=_,d.patch=function(t,e,r){var n=d("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},d.post=function(t,e,r){var n=d("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},d.put=function(t,e,r){var n=d("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},9905:t=>{"use strict";function e(t){return e="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},e(t)}t.exports=function(t){return null!==t&&"object"===e(t)}},4287:(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=r(9905);function o(t){if(t)return function(t){for(var e in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,e)&&(t[e]=o.prototype[e]);return t}(t)}t.exports=o,o.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},o.prototype.parse=function(t){return this._parser=t,this},o.prototype.responseType=function(t){return this._responseType=t,this},o.prototype.serialize=function(t){return this._serializer=t,this},o.prototype.timeout=function(t){if(!t||"object"!==n(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},o.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var s=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),a=new Set([408,413,429,500,502,503,504,521,522,524]);o.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&a.has(e.status))return!0;if(t){if(t.code&&s.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},o.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},o.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},o.prototype.catch=function(t){return this.then(void 0,t)},o.prototype.use=function(t){return t(this),this},o.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},o.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},o.prototype.get=function(t){return this._header[t.toLowerCase()]},o.prototype.getHeader=o.prototype.get,o.prototype.set=function(t,e){if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},o.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},o.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(i(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},o.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},o.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},o.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},o.prototype.redirects=function(t){return this._maxRedirects=t,this},o.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},o.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},o.prototype.send=function(t){var e=i(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&i(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},o.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},o.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},o.prototype._appendQueryString=function(){console.warn("Unsupported")},o.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},o.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},969:(t,e,r)=>{"use strict";var n=r(3094);function i(t){if(t)return function(t){for(var e in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,e)&&(t[e]=i.prototype[e]);return t}(t)}t.exports=i,i.prototype.get=function(t){return this.header[t.toLowerCase()]},i.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(this[i]=r[i]);this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},i.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t}},3094:(t,e)=>{"use strict";function r(t,e){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,u=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw s}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){var e,n={},i=r(t.split(/ *; */));try{for(i.s();!(e=i.n()).done;){var o=e.value.split(/ *= */),s=o.shift(),a=o.shift();s&&a&&(n[s]=a)}}catch(t){i.e(t)}finally{i.f()}return n},e.parseLinks=function(t){var e,n={},i=r(t.split(/ *, */));try{for(i.s();!(e=i.n()).done;){var o=e.value.split(/ *; */),s=o[0].slice(1,-1);n[o[1].split(/ *= */)[1].slice(1,-1)]=s}}catch(t){i.e(t)}finally{i.f()}return n},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},2817:t=>{t.exports=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n<t.rangeCount;n++)r.push(t.getRangeAt(n));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null}return t.removeAllRanges(),function(){"Caret"===t.type&&t.removeAllRanges(),t.rangeCount||r.forEach((function(e){t.addRange(e)})),e&&e.focus()}}},4243:(t,e,r)=>{var n=r(2486).Buffer,i=r(7811).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)}},1042:(t,e,r)=>{"use strict";var n=r(1926),i=r(9370),o=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,u=/:\d+$/,c=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,f=/^[a-zA-Z]:/;function l(t){return(t||"").toString().replace(o,"")}var h=[["#","hash"],["?","query"],function(t,e){return m(e.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],d={hash:1,query:1};function p(t){var e,n=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},i={},o=typeof(t=t||n);if("blob:"===t.protocol)i=new b(unescape(t.pathname),{});else if("string"===o)for(e in i=new b(t,{}),d)delete i[e];else if("object"===o){for(e in t)e in d||(i[e]=t[e]);void 0===i.slashes&&(i.slashes=a.test(t.href))}return i}function m(t){return"file:"===t||"ftp:"===t||"http:"===t||"https:"===t||"ws:"===t||"wss:"===t}function g(t,e){t=(t=l(t)).replace(s,""),e=e||{};var r,n=c.exec(t),i=n[1]?n[1].toLowerCase():"",o=!!n[2],a=!!n[3],u=0;return o?a?(r=n[2]+n[3]+n[4],u=n[2].length+n[3].length):(r=n[2]+n[4],u=n[2].length):a?(r=n[3]+n[4],u=n[3].length):r=n[4],"file:"===i?u>=2&&(r=r.slice(2)):m(i)?r=n[4]:i?o&&(r=r.slice(2)):u>=2&&m(e.protocol)&&(r=n[4]),{protocol:i,slashes:o||m(i),slashesCount:u,rest:r}}function b(t,e,r){if(t=(t=l(t)).replace(s,""),!(this instanceof b))return new b(t,e,r);var o,a,u,c,d,y,v=h.slice(),w=typeof e,_=this,A=0;for("object"!==w&&"string"!==w&&(r=e,e=null),r&&"function"!=typeof r&&(r=i.parse),o=!(a=g(t||"",e=p(e))).protocol&&!a.slashes,_.slashes=a.slashes||o&&e.slashes,_.protocol=a.protocol||e.protocol||"",t=a.rest,("file:"===a.protocol&&(2!==a.slashesCount||f.test(t))||!a.slashes&&(a.protocol||a.slashesCount<2||!m(_.protocol)))&&(v[3]=[/(.*)/,"pathname"]);A<v.length;A++)"function"!=typeof(c=v[A])?(u=c[0],y=c[1],u!=u?_[y]=t:"string"==typeof u?~(d="@"===u?t.lastIndexOf(u):t.indexOf(u))&&("number"==typeof c[2]?(_[y]=t.slice(0,d),t=t.slice(d+c[2])):(_[y]=t.slice(d),t=t.slice(0,d))):(d=u.exec(t))&&(_[y]=d[1],t=t.slice(0,d.index)),_[y]=_[y]||o&&c[3]&&e[y]||"",c[4]&&(_[y]=_[y].toLowerCase())):t=c(t,_);r&&(_.query=r(_.query)),o&&e.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==e.pathname)&&(_.pathname=function(t,e){if(""===t)return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)"."===r[n]?r.splice(n,1):".."===r[n]?(r.splice(n,1),s++):s&&(0===n&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),"."!==i&&".."!==i||r.push(""),r.join("/")}(_.pathname,e.pathname)),"/"!==_.pathname.charAt(0)&&m(_.protocol)&&(_.pathname="/"+_.pathname),n(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(~(d=_.auth.indexOf(":"))?(_.username=_.auth.slice(0,d),_.username=encodeURIComponent(decodeURIComponent(_.username)),_.password=_.auth.slice(d+1),_.password=encodeURIComponent(decodeURIComponent(_.password))):_.username=encodeURIComponent(decodeURIComponent(_.auth)),_.auth=_.password?_.username+":"+_.password:_.username),_.origin="file:"!==_.protocol&&m(_.protocol)&&_.host?_.protocol+"//"+_.host:"null",_.href=_.toString()}b.prototype={set:function(t,e,r){var o=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(r||i.parse)(e)),o[t]=e;break;case"port":o[t]=e,n(e,o.protocol)?e&&(o.host=o.hostname+":"+e):(o.host=o.hostname,o[t]="");break;case"hostname":o[t]=e,o.port&&(e+=":"+o.port),o.host=e;break;case"host":o[t]=e,u.test(e)?(e=e.split(":"),o.port=e.pop(),o.hostname=e.join(":")):(o.hostname=e,o.port="");break;case"protocol":o.protocol=e.toLowerCase(),o.slashes=!r;break;case"pathname":case"hash":if(e){var s="pathname"===t?"/":"#";o[t]=e.charAt(0)!==s?s+e:e}else o[t]=e;break;case"username":case"password":o[t]=encodeURIComponent(e);break;case"auth":var a=e.indexOf(":");~a?(o.username=e.slice(0,a),o.username=encodeURIComponent(decodeURIComponent(o.username)),o.password=e.slice(a+1),o.password=encodeURIComponent(decodeURIComponent(o.password))):o.username=encodeURIComponent(decodeURIComponent(e))}for(var c=0;c<h.length;c++){var f=h[c];f[4]&&(o[f[1]]=o[f[1]].toLowerCase())}return o.auth=o.password?o.username+":"+o.password:o.username,o.origin="file:"!==o.protocol&&m(o.protocol)&&o.host?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(t){t&&"function"==typeof t||(t=i.stringify);var e,r=this,n=r.host,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var s=o+(r.protocol&&r.slashes||m(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):"file:"!==r.protocol&&m(r.protocol)&&!n&&"/"!==r.pathname&&(s+="@"),(":"===n[n.length-1]||u.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,(e="object"==typeof r.query?t(r.query):r.query)&&(s+="?"!==e.charAt(0)?"?"+e:e),r.hash&&(s+=r.hash),s}},b.extractProtocol=g,b.location=p,b.trimLeft=l,b.qs=i,t.exports=b},9440:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(t){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)}}},286:t=>{"use strict";t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},3674:t=>{t.exports=function(){for(var t={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)e.call(n,i)&&(t[i]=n[i])}return t};var e=Object.prototype.hasOwnProperty},3254:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e},s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};e.__esModule=!0;var a=o(r(8403));s(r(8403),e),e.default=a},4660:function(t,e,r){"use strict";var n,i,o,s=this&&this.__assign||function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},s.apply(this,arguments)},a=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),u=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c=this&&this.__importStar||function(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)&&a(e,t,r);return u(e,t),e},f=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||a(e,t,r)},l=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},h=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},d=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},p=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},m=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},g=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.getTxnParams=e.toWTxn=e.signSendAndConfirm=e.setMinMillisBetweenRequests=e.setCustomHttpEventHandler=e.setSigningMonitor=e.formatWithDecimals=e.addressFromHex=e.getQueryLowerBound=e.setQueryLowerBound=e.btoiLast8=e.bytes_xor=e.digest_xor=e.digestEq=e.bytesEq=e.Array_set=e.assert=e.protect=e.muldiv=e.cast=e.sqrt256=e.sqrt=e.lt256=e.le256=e.gt256=e.ge256=e.eq256=e.bxor256=e.bior256=e.band256=e.div256=e.mul256=e.mod256=e.sub256=e.add256=e.lt=e.le=e.gt=e.ge=e.eq=e.bxor=e.bior=e.band=e.div=e.mul=e.mod=e.sub=e.add=e.algosdk=e.connector=void 0,e.newAccountFromSecret=e.newAccountFromMnemonic=e.getDefaultAccount=e.formatCurrency=e.minimumBalance=e.parseCurrency=e.atomicUnit=e.standardUnit=e.newTestAccounts=e.newTestAccount=e.fundFromFaucet=e.canFundFromFaucet=e.createAccount=e.balanceOf=e.balancesOf=e.minimumBalanceOf=e.connectAccount=e.transfer=e.makeTransferTxn=e.setFaucet=e.getFaucet=e.setProviderByName=e.providerEnvByName=e.setProviderByEnv=e.setProvider=e.getProvider=e.walletFallback=e.setWalletFallback=e.hasRandom=e.randomUInt=e.T_Token=e.T_Struct=e.T_Digest=e.T_Address=e.T_Bytes=e.T_Data=e.T_Object=e.T_Contract=e.T_Array=e.T_Tuple=e.T_UInt256=e.T_UInt=e.T_Bool=e.T_Null=e.digest=e.tokenEq=e.addressEq=e.setValidQueryWindow=e.getValidQueryWindow=e.MinTxnFee=void 0,e.reachStdlib=e.launchToken=e.unsafeGetMnemonic=e.formatAddress=e.verifyContract=e.wait=e.waitUntilSecs=e.waitUntilTime=e.getNetworkSecs=e.getTimeSecs=e.getNetworkTime=void 0,e.connector="ALGO";var b=g(r(7012)),y=r(7012);a(e,y,"default","algosdk");var v=r(3825),w=g(r(138)),_=g(r(2486)),A=c(r(5976)),E=c(r(7883)),S=_.default.Buffer,M=r(2196),x=r(3653),k=r(135),T=g(r(799)),I=r(3066);e.addressFromHex=I.addressFromHex;var C=r(2130),R=r(9757);e.add=I.stdlib.add,e.sub=I.stdlib.sub,e.mod=I.stdlib.mod,e.mul=I.stdlib.mul,e.div=I.stdlib.div,e.band=I.stdlib.band,e.bior=I.stdlib.bior,e.bxor=I.stdlib.bxor,e.eq=I.stdlib.eq,e.ge=I.stdlib.ge,e.gt=I.stdlib.gt,e.le=I.stdlib.le,e.lt=I.stdlib.lt,e.add256=I.stdlib.add256,e.sub256=I.stdlib.sub256,e.mod256=I.stdlib.mod256,e.mul256=I.stdlib.mul256,e.div256=I.stdlib.div256,e.band256=I.stdlib.band256,e.bior256=I.stdlib.bior256,e.bxor256=I.stdlib.bxor256,e.eq256=I.stdlib.eq256,e.ge256=I.stdlib.ge256,e.gt256=I.stdlib.gt256,e.le256=I.stdlib.le256,e.lt256=I.stdlib.lt256,e.sqrt=I.stdlib.sqrt,e.sqrt256=I.stdlib.sqrt256,e.cast=I.stdlib.cast,e.muldiv=I.stdlib.muldiv,e.protect=I.stdlib.protect,e.assert=I.stdlib.assert,e.Array_set=I.stdlib.Array_set,e.bytesEq=I.stdlib.bytesEq,e.digestEq=I.stdlib.digestEq,e.digest_xor=I.stdlib.digest_xor,e.bytes_xor=I.stdlib.bytes_xor,e.btoiLast8=I.stdlib.btoiLast8,f(r(135),e);var B=r(3653);e.setQueryLowerBound=B.setQueryLowerBound,e.getQueryLowerBound=B.getQueryLowerBound,e.formatWithDecimals=B.formatWithDecimals;var N=d((0,x.makeSigningMonitor)(),2),O=N[0],P=N[1];e.setSigningMonitor=O;var D=function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){return[2,void 0]}))}))};e.setCustomHttpEventHandler=function(t){D=t};var L=0;e.setMinMillisBetweenRequests=function(t){L=t};var U=new x.Lock,j=void 0,F=void 0,q=void 0;function z(t){return l(this,void 0,void 0,(function(){var e,r;return h(this,(function(n){switch(n.label){case 0:return e=t.eventName,L>0?"before"!==e?[3,4]:[4,U.acquire()]:[3,5];case 1:return n.sent(),q?(r=Math.max(0,q+L-Date.now()),(0,x.debug)("waiting ".concat(r,"ms due to minMillisBetweenRequests=").concat(L)),[4,w.default.set(r)]):[3,3];case 2:n.sent(),n.label=3;case 3:q=Date.now(),j=t.reqNum,F=t.label,n.label=4;case 4:if("success"===e||"error"===e){if(j!==t.reqNum||F!=t.label)throw Error("impossible: multiple requests in flight");j=void 0,F=void 0,U.release()}n.label=5;case 5:return[4,D(t)];case 6:return n.sent(),[2]}}))}))}var H=function(t){return b.default.encodeAddress(S.from(t.slice(2),"hex"))},K=function(t){return b.default.encodeAddress(t.from.publicKey)},G=function(t){var e=t["application-transaction"]||{},r=e["application-args"]||[],n=e["application-id"],i=function(){var e,r,n=t["inner-txns"]||[];try{for(var i=p(n),o=i.next();!o.done;o=i.next()){var s=o.value;return(0,x.debug)("ccai itx",s),s["created-application-index"]}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}();return{"confirmed-round":t["confirmed-round"],sender:t.sender,"approval-program":e["approval-program"],"clear-state-program":e["clear-state-program"],logs:t.logs||[],"application-args":r,"application-index":n,"created-application-index":t["created-application-index"],"created-asset-index":t["created-asset-index"],"created-companion-application-index":i}},W=function(t){var e=S.from(t,"base64");return b.default.decodeUnsignedTransaction(e)},V=function(t,e){return S.from(t.signTxn(e)).toString("base64")};e.signSendAndConfirm=function(t,r){return l(void 0,void 0,void 0,(function(){var n,i,o,s,a,u,c,f,m,g;return h(this,(function(y){switch(y.label){case 0:return void 0!==t.sk&&r.forEach((function(e){var r,n;void 0===t.sk||e.stxn||void 0===e.signers||1!==e.signers.length||e.signers[0]!==t.addr||((0,x.debug)("signSendAndConfirm","signing one"),e.stxn=(r=e.txn,n=t.sk,V(W(r),n)))})),[4,(0,e.getProvider)()];case 1:n=y.sent(),y.label=2;case 2:return y.trys.push([2,4,,5]),[4,P(r,n.signAndPostTxns(r))];case 3:return g=d.apply(void 0,[y.sent(),2]),i=g[0],o=g[1],[3,5];case 4:throw s=y.sent(),m="".concat(s),(0,x.hasProp)(s,"response")&&(a=s.response,(0,x.hasProp)(a,"body")?s.response=a.body:(0,x.hasProp)(a,"text")?s.response=a.text:(delete a.request,delete a.req)),{type:"signAndPost",e:s,es:m};case 5:(0,x.debug)({sapt_res:i}),u=r.length-1,c=W(r[u].txn),y.label=6;case 6:return y.trys.push([6,8,,9]),[4,o((v=c.txID(),l(void 0,void 0,void 0,(function(){var t,e,r,n,i;return h(this,(function(o){switch(o.label){case 0:return t=function(t){return l(void 0,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e={},[4,t];case 1:return[2,(e.val=r.sent(),e)];case 2:return[2,{exn:r.sent()}];case 3:return[2]}}))}))},e="waitForConfirmation ".concat(v),[4,at()];case 1:return r=o.sent(),n=function(){return l(void 0,void 0,void 0,(function(){var o,s,a,u,c,f,l,d;return h(this,(function(h){switch(h.label){case 0:return o=r.pendingTransactionInformation(v).do(),[4,t(o)];case 1:return s=h.sent(),(0,x.debug)(e,"info",s),"exn"in s?((0,x.debug)(e,"switching to indexer on error"),[4,i()]):[3,3];case 2:case 5:return[2,h.sent()];case 3:return a=s.val,void 0!==(u=a["confirmed-round"])&&u>0?(c=void 0===a.logs?[]:a.logs,(0,x.debug)(e,"confirmed"),f=b.default.Transaction.from_obj_for_encoding(a.txn.txn),(0,x.debug)(e,"confirmed",f),l=function(t){return(t||[]).map((function(t){return function(t,e){if(void 0===e&&(e="utf8"),!(t instanceof Uint8Array))throw console.log(t),Error("Expected Uint8Array, got ".concat(t));return S.from(t).toString(e)}(t,"base64")}))},d=function(){var t,e,r=a["inner-txns"]||[];try{for(var n=p(r),i=n.next();!i.done;i=n.next()){var o=i.value;return(0,x.debug)("ccai itx",o),o["application-index"]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}(),[2,{"confirmed-round":u,"created-asset-index":a["asset-index"],logs:l(c),"created-application-index":a["application-index"],"created-companion-application-index":d,sender:K(f),"application-args":l(f.appArgs)}]):[3,4];case 4:return""!==a["pool-error"]?[3,6]:((0,x.debug)(e,"still in pool, trying again"),[4,n()]);case 6:throw Error("waitForConfirmation: error confirming: ".concat((0,x.j2s)(a)))}}))}))},i=function(){return l(void 0,void 0,void 0,(function(){var t,r,n;return h(this,(function(i){switch(i.label){case 0:return[4,ut()];case 1:return t=i.sent(),r=t.lookupTransactionByID(v),[4,et(e,r)];case 2:return n=i.sent(),(0,x.debug)(e,"indexer",n),[2,G(n.transaction)]}}))}))},[4,ct()];case 2:return o.sent()?[4,n()]:[3,4];case 3:case 5:return[2,o.sent()];case 4:return[4,i()]}}))}))))];case 7:return[2,y.sent()];case 8:throw f=y.sent(),m="".concat(f),{type:"waitForConfirmation",e:f,es:m};case 9:return[2]}var v}))}))};var $=function(t){return S.from(b.default.encodeUnsignedTransaction(t)).toString("base64")};e.toWTxn=function(t){return{txn:$(t),signers:[K(t)]}};var X=function(){return w.default.set(1e3)};e.getTxnParams=function(t){return l(void 0,void 0,void 0,(function(){var e,r,n,i,o;return h(this,(function(a){switch(a.label){case 0:return e="".concat(t," fillTxn"),(0,x.debug)(e,"getting params"),[4,at()];case 1:r=a.sent(),a.label=2;case 2:return[4,r.getTransactionParams().do()];case 3:return n=a.sent(),(0,x.debug)(e,"got params:",n),i=function(t){return(0,k.bigNumberToNumber)((0,k.bigNumberify)(t))},o=s(s({},n),{fee:i(n.fee),firstRound:i(n.firstRound),lastRound:i(n.lastRound)}),(0,x.debug)(e,"got params:",o),0!==o.firstRound?[2,o]:((0,x.debug)(e,"...but firstRound is 0, so let's wait and try again."),[4,X()]);case 4:return a.sent(),[3,2];case 5:return[2]}}))}))};var Y=function(t,r,n){return l(void 0,void 0,void 0,(function(){var i;return h(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,(0,e.signSendAndConfirm)(r,[n])];case 1:return[2,o.sent()];case 2:throw i=o.sent(),console.log(i),Error("".concat(t," txn failed:\n").concat((0,x.j2s)(n),"\nwith:\n").concat((0,x.j2s)(i)));case 3:return[2]}}))}))};function J(t){var e=t._Connectors.ALGO,r=e.unsupported,n=e.warnings,i=function(t){return t.map((function(t){return" * ".concat(t)})).join("\n")};if(n.length>0&&!(0,x.hideWarnings)()&&console.error("This Reach application is dangerous to run on Algorand for the following reasons:\n".concat(i(n))),r.length>0)throw Error("This Reach application is not supported on Algorand for the following reasons:\n".concat(i(r)))}e.MinTxnFee=1e3;var Z=function(t){return S.from(t).toString("hex")},Q=function(t){return Uint8Array.from(S.from(t,"base64"))},tt=function(t,e){return l(void 0,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.do()];case 1:return r=n.sent(),(0,x.debug)(t,"RESULT",r),[2,{val:r}];case 2:return[2,{exn:n.sent()}];case 3:return[2]}}))}))},et=function(t,e,r,n){return void 0===r&&(r=0),void 0===n&&(n=function(t){return{exn:t}}),l(void 0,void 0,void 0,(function(){var i,o,s,a;return h(this,(function(u){switch(u.label){case 0:(0,x.debug)(t,e.query),u.label=1;case 1:return r>0?[4,X()]:[3,3];case 2:u.sent(),u.label=3;case 3:return[4,tt(t,e)];case 4:return"exn"in(i=u.sent())?(-111===(null==(o=i.exn)?void 0:o.errno)||"ECONNRESET"===(null==o?void 0:o.code)?(0,x.debug)(t,"NO CONNECTION"):function(t){var e;return((null===(e=null==t?void 0:t.response)||void 0===e?void 0:e.text)||"").toLowerCase().includes("accounting not initialized")}(o)&&(0,x.debug)(t,"ACCOUNTING NOT INITIALIZED"),(null===(a=null==o?void 0:o.response)||void 0===a?void 0:a.text)&&(o=o.response.text),"exn"in(s=n(o))?((0,x.debug)(t,"RETRYING",{e:o}),r++,[3,1]):((0,x.debug)(t,"FAIL OK",{e:o,fr:s}),[2,s.val])):[2,i.val];case 5:return[2]}}))}))};e.getValidQueryWindow=function(){return!0},e.setValidQueryWindow=function(t){if("number"==typeof t)throw Error("Only setValidQueryWindow(true) is supported on Algorand")};var rt=function(t){var e=t["application-transaction"];return!!e&&(0,k.bigNumberify)(e["application-id"]).eq(0)},nt=function(){return(0,x.makeEventQueue)({raw2proc:G,alwaysIgnored:function(t){return r=(e=t["application-transaction"])&&e["application-args"]||[],!!e&&"optin"===e["on-completion"]&&0==r.length||function(t){var e=t.logs;if(e&&1===e.length){var r=e[0],n=Q(r);if(n.length>=4){var i=Z(n.subarray(0,4));return(0,x.debug)("apiOnly",{l0h:i}),"151f7c75"===i}return!1}return!1}(t);var e,r},getTxns:function(t,e,r,n){return l(void 0,void 0,void 0,(function(){var i,o,s,a,u,c,f,l,d;return h(this,(function(h){switch(h.label){case 0:return i=e.ApplicationID,[4,ut()];case 1:return o=h.sent(),s=(0,k.bigNumberToNumber)(r.add(1)),(0,x.debug)(t,{ctime:r,mtime:s}),a=(0,k.bigNumberToNumber)(i),u=o.searchForTransactions().applicationID(a).minRound(s),[4,et(t,u,n)];case 2:return c=h.sent(),f=[],(l=function(t){t.filter((function(t){return"appl"===t["tx-type"]})).forEach((function(t){var e=t["application-transaction"]||{},r=(0,k.bigNumberify)(e["application-id"]||0),n=(0,k.bigNumberify)(t["created-application-index"]||0),o=t["inner-txns"];r.eq(i)||n.eq(i)?f.push(t):o&&l(o)}))})(c.transactions),d=(0,k.bigNumberify)(c["current-round"]),[2,{txns:f,gtime:d}]}}))}))},getTxnTime:function(t){return(0,k.bigNumberify)(t["confirmed-round"])}})};function it(t){return l(this,void 0,void 0,(function(){var e,r,n,i,o,s;return h(this,(function(a){switch(a.label){case 0:return e=t.ALGO_INDEXER_SERVER,r=t.ALGO_INDEXER_PORT,n=t.ALGO_INDEXER_TOKEN,[4,(0,T.default)(e,r)];case 1:return a.sent(),i=r||void 0,o=new E.URLTokenBaseHTTPClient({"X-Indexer-API-Token":n},e,i),[2,[s=new A.ReachHTTPClient(o,"indexer",z),new b.default.Indexer(s)]]}}))}))}function ot(t){return l(this,void 0,void 0,(function(){var e,r,n,i,o,s;return h(this,(function(a){switch(a.label){case 0:return e=t.ALGO_SERVER,r=t.ALGO_PORT,n=t.ALGO_TOKEN,[4,(0,T.default)(e,r)];case 1:return a.sent(),i=r||void 0,o=new E.URLTokenBaseHTTPClient({"X-Algo-API-Token":n},e,i),[2,[s=new A.ReachHTTPClient(o,"algodv2",z),new b.default.Algodv2(s)]]}}))}))}e.addressEq=I.stdlib.addressEq,e.tokenEq=I.stdlib.tokenEq,e.digest=I.stdlib.digest,e.T_Null=I.typeDefs.T_Null,e.T_Bool=I.typeDefs.T_Bool,e.T_UInt=I.typeDefs.T_UInt,e.T_UInt256=I.typeDefs.T_UInt256,e.T_Tuple=I.typeDefs.T_Tuple,e.T_Array=I.typeDefs.T_Array,e.T_Contract=I.typeDefs.T_Contract,e.T_Object=I.typeDefs.T_Object,e.T_Data=I.typeDefs.T_Data,e.T_Bytes=I.typeDefs.T_Bytes,e.T_Address=I.typeDefs.T_Address,e.T_Digest=I.typeDefs.T_Digest,e.T_Struct=I.typeDefs.T_Struct,e.T_Token=I.typeDefs.T_Token,e.randomUInt=(n=(0,x.makeRandom)(8)).randomUInt,e.hasRandom=n.hasRandom;e.setWalletFallback=function(t){C.window.algorand||(C.window.algorand=t())};var st=function(t,e,r){var n=void 0,i=t.providerEnv||"LocalHost",o="string"==typeof i?gt(i):i,a=function(t){return l(void 0,void 0,void 0,(function(){var e,r,i,s;return h(this,(function(a){switch(a.label){case 0:return[4,ht(o)];case 1:return[4,(n=a.sent()).algodClient.getTransactionParams().do()];case 2:return e=a.sent(),r=e.genesisID,i=e.genesisHash,function(t,e){var r=t.genesisID,n=t.genesisHash,i=e||{},o=i.genesisID,s=i.genesisHash;if(o&&o!==r||s&&s!==n)throw Error("Requested genesis ID or hash not supported by this wallet.\n"+"Expected: '".concat(r,"' '").concat(n,"'\n")+"Got: '".concat(o,"' '").concat(s,"'"))}(s={genesisID:r,genesisHash:i},t),[2,s]}}))}))},u=function(t){return l(void 0,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:return[4,e()];case 1:return function(t,e){if(e&&(e[0]!==t||e.length>1))throw Error("One or more requested accounts not supported by this wallet.\n"+"Expected: ".concat(JSON.stringify([t]),"\n")+"Got: ".concat(JSON.stringify(e)))}(r=n.sent(),null==t?void 0:t.accounts),[2,{accounts:[r]}]}}))}))},c=function(t,e){return l(void 0,void 0,void 0,(function(){var e,i,o;return h(this,(function(s){switch(s.label){case 0:if(!n)throw new Error("must call enable");return(0,x.debug)("fallBack: signAndPostTxns",{txns:t}),e=[],t.forEach((function(t){t.stxn||e.push(t.txn)})),(0,x.debug)("fallBack: signAndPostTxns",{to_sign:e}),0!=e.length?[3,1]:(o=[],[3,3]);case 1:return[4,r(e)];case 2:o=s.sent(),s.label=3;case 3:return i=o,(0,x.debug)("fallBack: signAndPostTxns",{signed:i}),[2,t.map((function(t){if(t.stxn)return t.stxn;var e=i.shift();if(!e)throw new Error("txn not signed");return e}))]}}))}))},f=function(t,e){return l(void 0,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:if(!n)throw new Error("must call enable");return e=t.map((function(t){return S.from(t,"base64")})),(0,x.debug)("fallBack: signAndPostTxns",e),[4,n.algodClient.sendRawTransaction(e).do()];case 1:return r.sent(),[2,{}]}}))}))};return{_env:o,enable:function(t){return l(void 0,void 0,void 0,(function(){var e,r;return h(this,(function(n){switch(n.label){case 0:return[4,a(t)];case 1:return e=n.sent(),[4,u(t)];case 2:return r=n.sent(),[2,s(s({},e),r)]}}))}))},enableNetwork:a,enableAccounts:u,getAlgodv2Client:function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){if(!n)throw new Error("must call enable");return[2,n.algod_bc]}))}))},getIndexerClient:function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){if(!n)throw new Error("must call enable");return[2,n.indexer_bc]}))}))},signTxns:c,postTxns:f,signAndPostTxns:function(t,e){return l(void 0,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:return[4,c(t)];case 1:return e=r.sent(),[4,f(e)];case 2:return[2,r.sent()]}}))}))}}};e.walletFallback=function(t){(0,x.debug)("using wallet fallback with",t);var e=t.MyAlgoConnect;if(e)return function(t,e){return function(){(0,x.debug)("using MyAlgoWallet wallet fallback"),C.window.Buffer||(C.window.Buffer=S);var r=new t,n=new x.Lock;return st(e,(function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,n.runWith((function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,r.connect({shouldSelectOneAccount:!0})];case 1:return[2,t.sent()]}}))}))}))];case 1:return[2,t.sent()[0].address]}}))}))}),(function(t){return l(void 0,void 0,void 0,(function(){var e;return h(this,(function(i){switch(i.label){case 0:return(0,x.debug)("MAW signTransaction ->",t),[4,n.runWith((function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,r.signTransaction(t)];case 1:return[2,e.sent()]}}))}))}))];case 1:return e=i.sent(),(0,x.debug)("MAW signTransaction <-",e),[2,e.map((function(t){return S.from(t.blob).toString("base64")}))]}}))}))}))}}(e,t);var r=t.WalletConnect;return r?function(t,e){return function(){(0,x.debug)("using WalletConnect wallet fallback");var r=new t;return st(e,(function(){return r.getAddr()}),(function(t){return r.signTxns(t)}))}}(r,t):function(t){return function(){return(0,x.debug)("using mnemonic wallet fallback"),st(t,(function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){return[2,C.window.prompt("Please paste the address of your account:")]}))}))}),(function(t){return l(void 0,void 0,void 0,(function(){return h(this,(function(e){return[2,t.map((function(t){var e=W(t),r=K(e),n=C.window.prompt("Please paste the mnemonic for the address, ".concat(r,". It will not be saved.")),i=b.default.mnemonicToSecretKey(n);return V(e,i.sk)}))]}))}))}))}}(t)},e.getProvider=(i=d((0,x.replaceableThunk)((function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return C.window.algorand?[4,(e=C.window.algorand,r=C.process.env,l(void 0,void 0,void 0,(function(){var t,n,i,o,a,u,c,f,d,p,m,g,y,v,w,_,A;return h(this,(function(E){switch(E.label){case 0:return(0,x.debug)("making provider with wallet"),t=s(s(s({},{REACH_ISOLATED_NETWORK:"no",ALGO_NODE_WRITE_ONLY:"yes"}),r),e._env||{}),n=r.ALGO_GENESIS_ID,i=r.ALGO_GENESIS_HASH,o=r.ALGO_ACCOUNT,a=t.REACH_ISOLATED_NETWORK,u=t.ALGO_NODE_WRITE_ONLY,c={genesisID:n||void 0,genesisHash:i||void 0,accounts:o?[o]:void 0},f=(0,x.truthyEnv)(a),d=(0,x.truthyEnv)(u),void 0!==e.enableNetwork||void 0!==e.enableAccounts?[3,2]:[4,e.enable(c)];case 1:return m=E.sent(),p=m,[3,5];case 2:if(void 0!==e.enableNetwork&&void 0!==e.enableAccounts)return[3,3];throw new Error("must have enableNetwork AND enableAccounts OR neither");case 3:return[4,e.enableNetwork(c)];case 4:E.sent(),E.label=5;case 5:return[4,e.getAlgodv2Client()];case 6:return g=E.sent(),[4,e.getIndexerClient()];case 7:return y=E.sent(),v=new b.default.Algodv2(g),w=new b.default.Indexer(y),_=function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:if(void 0!==p)return[3,2];if(void 0===e.enableAccounts)throw new Error("impossible: no wallet.enableAccounts");return[4,e.enableAccounts(c)];case 1:if(void 0===(p=t.sent()))throw new Error("Could not enable accounts");t.label=2;case 2:return[2,p.accounts[0]]}}))}))},A=e.signAndPostTxns,[2,{algod_bc:g,indexer_bc:y,indexer:w,algodClient:v,nodeWriteOnly:d,getDefaultAddress:_,isIsolatedNetwork:f,signAndPostTxns:A}]}}))})))]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return(0,x.debug)("making default provider based on process.env"),[4,ht(C.process.env)]}var e,r}))}))})),2),i[0]),e.setProvider=i[1];var at=function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,(0,e.getProvider)()];case 1:return(t=r.sent().algodClient).setIntEncoding(b.default.IntDecoding.BIGINT),[2,t]}}))}))},ut=function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,(0,e.getProvider)()];case 1:return(t=r.sent().indexer).setIntEncoding(b.default.IntDecoding.BIGINT),[2,t]}}))}))},ct=function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,(0,e.getProvider)()];case 1:return[2,!1===t.sent().nodeWriteOnly]}}))}))},ft=function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return t=e.assert,[4,ct()];case 1:return[2,t.apply(void 0,[r.sent(),"node can read"])]}}))}))},lt={ALGO_SERVER:"http://localhost",ALGO_PORT:"4180",ALGO_TOKEN:"c87f5580d7a866317b4bfe9e8b8d1dda955636ccebfa88c12b414db208dd9705",ALGO_INDEXER_SERVER:"http://localhost",ALGO_INDEXER_PORT:"8980",ALGO_INDEXER_TOKEN:"reach-devnet",REACH_ISOLATED_NETWORK:"yes",ALGO_NODE_WRITE_ONLY:"no"};function ht(t){return l(this,void 0,void 0,(function(){var e,r,n,i,o,s,a,u,c,f,m,g=this;return h(this,(function(b){switch(b.label){case 0:return(0,x.debug)("makeProviderByEnv",t),e=function(t){var e,r,n=lt,i={};try{for(var o=p(["ALGO_SERVER","ALGO_PORT","ALGO_TOKEN","ALGO_INDEXER_SERVER","ALGO_INDEXER_PORT","ALGO_INDEXER_TOKEN","REACH_ISOLATED_NETWORK","ALGO_NODE_WRITE_ONLY"]),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=(0,x.envDefault)(t[a],n[a])}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return i}(t),(0,x.debug)("makeProviderByEnv defaulted",e),[4,ot(e)];case 1:return r=d.apply(void 0,[b.sent(),2]),n=r[0],i=r[1],[4,it(e)];case 2:return o=d.apply(void 0,[b.sent(),2]),s=o[0],a=o[1],u=(0,x.truthyEnv)(e.REACH_ISOLATED_NETWORK),c=(0,x.truthyEnv)(e.ALGO_NODE_WRITE_ONLY),f=function(t){return"Providers created by environment ".concat(t,". Calling setProviderByEnv or setProviderByName removes this capability. Try removing calls to those functions.")},m=function(t,e){return l(g,void 0,void 0,(function(){var e,r;return h(this,(function(n){switch(n.label){case 0:return e=t.map((function(t){if(t.stxn)return t.stxn;throw new Error(f("cannot interactively sign"))})),r=e.map((function(t){return S.from(t,"base64")})),(0,x.debug)("signAndPostTxns",r),[4,i.sendRawTransaction(r).do()];case 1:return n.sent(),[2]}}))}))},[2,{algod_bc:n,indexer_bc:s,algodClient:i,indexer:a,nodeWriteOnly:c,isIsolatedNetwork:u,getDefaultAddress:function(){return l(g,void 0,void 0,(function(){return h(this,(function(t){throw new Error(f("do not have default addresses"))}))}))},signAndPostTxns:m}]}}))}))}function dt(t){(0,e.setProvider)(ht(t))}function pt(t){var e="https://".concat(t.toLowerCase(),"-"),r=".algonode.cloud";return{ALGO_SERVER:"".concat(e,"api").concat(r),ALGO_PORT:"",ALGO_TOKEN:"",ALGO_INDEXER_SERVER:"".concat(e,"idx").concat(r),ALGO_INDEXER_PORT:"",ALGO_INDEXER_TOKEN:"",REACH_ISOLATED_NETWORK:"no",ALGO_NODE_WRITE_ONLY:"yes"}}function mt(t){var e="MainNet"===t?"":"".concat(t.toLowerCase(),"."),r="".concat(e,"algoexplorerapi.io");return{ALGO_SERVER:"https://node.".concat(r),ALGO_PORT:"",ALGO_TOKEN:"",ALGO_INDEXER_SERVER:"https://algoindexer.".concat(r),ALGO_INDEXER_PORT:"",ALGO_INDEXER_TOKEN:"",REACH_ISOLATED_NETWORK:"no",ALGO_NODE_WRITE_ONLY:"yes"}}function gt(t){switch(t){case"MainNet":case"algonode/MainNet":return pt("MainNet");case"TestNet":case"algonode/TestNet":return pt("TestNet");case"BetaNet":case"algonode/BetaNet":return pt("BetaNet");case"randlabs/MainNet":return mt("MainNet");case"randlabs/TestNet":return mt("TestNet");case"randlabs/BetaNet":return mt("BetaNet");case"LocalHost":return lt;default:throw Error("Unrecognized provider name: ".concat(t))}}e.setProviderByEnv=dt,e.providerEnvByName=gt,e.setProviderByName=function(t){return dt(gt(t))},e.getFaucet=(o=d((0,x.replaceableThunk)((function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return t=b.default.mnemonicToSecretKey((0,x.envDefault)(C.process.env.ALGO_FAUCET_PASSPHRASE,"guilt butter canyon devote inflict comfort lumber relief chat key fury absorb reject palm siege draw jelly lyrics melody palace use box joy ability result")),[4,(0,e.connectAccount)(t)];case 1:return[2,r.sent()]}}))}))})),2),o[0]),e.setFaucet=o[1];var bt=function(t){return new Uint8Array(S.from(t))},yt="Reach ".concat(M.VERSION),vt=bt(yt),wt=function(t){return t?bt(yt+" ".concat(t,")")):vt};e.makeTransferTxn=function(t,e,r,n,i,o,s){void 0===o&&(o=void 0),void 0===s&&(s=void 0);var a=(0,k.bigNumberToBigInt)(r),u=wt(s);return n?b.default.makeAssetTransferTxnWithSuggestedParams(t,e,o,void 0,a,u,(0,k.bigNumberToNumber)(n),i):b.default.makePaymentTxnWithSuggestedParams(t,e,a,o,u,i)},e.transfer=function(t,r,n,i,o){return void 0===i&&(i=void 0),void 0===o&&(o=void 0),l(void 0,void 0,void 0,(function(){var s,a,u,c,f;return h(this,(function(l){switch(l.label){case 0:return s=t.networkAccount,a=(0,I.extractAddr)(r),u=(0,k.bigNumberify)(n),[4,(0,e.getTxnParams)("transfer")];case 1:return c=l.sent(),f=(0,e.toWTxn)((0,e.makeTransferTxn)(s.addr,a,u,i,c,void 0,o)),[4,Y("transfer ".concat((0,x.j2s)(t)," ").concat((0,x.j2s)(r)," ").concat(u),s,f)];case 2:return[2,l.sent()]}}))}))};var _t=function(t,r){var n=r.map((function(t){return t.netName})),i="".concat(t,"(").concat(n.join(","),")"),o=(0,R.sha512_256)(i),s=o.slice(0,8);(0,x.debug)("makeLogRep",{evt:t,tyns:n,sig:i,hu:o,hp:s});var a=function(t){if(Z(Q(t).slice(0,4))===s){(0,x.debug)("parse",{log:t});var n=d((0,e.T_Tuple)(m([(0,I.bytestringyNet)(4)],d(r),!1)).fromNet(St(t))),i=n[0],o=n.slice(1);return(0,x.debug)("parse",{logb:i,pd:o}),o}},u=function(t){if(0!=t.logs.length){var e=t.logs[0];return a(e)}};return{parse:a,parse0:u,parse0b:function(t){return void 0!==u(t)}}},At=function(t){return"_reach_e".concat(t)},Et=function(t,e){return(0,x.debug)("hasLogFor",t,e),_t(At(t),e).parse0b},St=function(t){var e=S.from(t,"base64").toString("hex");return v.ethers.utils.arrayify("0x"+e)},Mt=function(t){return l(void 0,void 0,void 0,(function(){var e,r,n,i,o,s,a,u;return h(this,(function(c){switch(c.label){case 0:e="getAccountInfo",c.label=1;case 1:return c.trys.push([1,5,,6]),[4,ft()];case 2:return c.sent(),[4,at()];case 3:return r=c.sent(),n=r.accountInformation(t),(0,x.debug)(e,n),[4,n.do()];case 4:return i=c.sent(),(0,x.debug)(e,"node",i),[2,i];case 5:return o=c.sent(),(0,x.debug)(e,"node err",o),[3,6];case 6:return[4,ut()];case 7:return s=c.sent(),a=s.lookupAccountByID(t),[4,et(e,a,0,(function(t){return"string"==typeof t&&t.includes("no accounts found for address")?{val:{"current-round":BigInt(0),account:{amount:BigInt(0)}}}:{exn:t}}))];case 8:return u=c.sent(),(0,x.debug)(e,u),[2,u.account]}}))}))},xt=function(t){return l(void 0,void 0,void 0,(function(){var e,r,n,i,o,s,a;return h(this,(function(u){switch(u.label){case 0:e=(0,k.bigNumberToNumber)(t),r="getApplicationInfo",u.label=1;case 1:return u.trys.push([1,5,,6]),[4,ft()];case 2:return u.sent(),[4,at()];case 3:return[4,u.sent().getApplicationByID(e).do()];case 4:return n=u.sent(),(0,x.debug)(r,"node",n),[2,{val:n}];case 5:return i=u.sent(),(0,x.debug)(r,"node err",i),[3,6];case 6:return[4,ut()];case 7:return o=u.sent(),s=o.lookupApplications(e).includeAll(!0),[4,tt(r,s)];case 8:return"val"in(a=u.sent())?((0,x.debug)(r,{application:a.val.application}),[2,a.val.application.deleted?kt(e):{val:a.val.application}]):[2,a]}}))}))},kt=function(t){return l(void 0,void 0,void 0,(function(){var e,r,n,i,o,s,a;return h(this,(function(u){switch(u.label){case 0:return e="getDeletedApplicationInfoM",[4,ut()];case 1:return r=u.sent(),n=r.searchForTransactions().applicationID(t).limit(1),[4,tt(e,n)];case 2:return"val"in(i=u.sent())?0===i.val.transactions.length?[2,{exn:"application does not exist"}]:(o=i.val.transactions[0],s=o["application-transaction"],(0,x.debug)(e,{appTxn:s}),"appl"!==o["tx-type"]||void 0===s||o["created-application-index"]!==BigInt(t)||s["application-id"]!==BigInt(0)||void 0===s["approval-program"]||void 0===s["clear-state-program"]||void 0===s["local-state-schema"]||void 0===s["global-state-schema"]?[2,{exn:"tried to synthesize AppInfo from deployment transaction, but the deployment transaction was wrong"}]:[2,{val:{id:o["created-application-index"],"created-at-round":o["confirmed-round"],deleted:!0,params:{creator:o.sender,"approval-program":s["approval-program"],"clear-state-program":s["clear-state-program"],"local-state-schema":s["local-state-schema"],"global-state-schema":s["global-state-schema"],"global-state":[],"extra-program-pages":null!==(a=s["extra-program-pages"])&&void 0!==a?a:BigInt(0)}}}]):[2,i]}}))}))};e.connectAccount=function(t){return l(void 0,void 0,void 0,(function(){function r(t){return i=t,(0,x.debug)("setDebugLabel",{newLabel:t,pks:o}),this}var n,i,o,a,u,c,f,g,y,v,w,_,A,E,M,T;return h(this,(function(C){return i=(n=t).addr.substring(2,6),o=e.T_Address.canonicalize(n),(0,x.debug)(i,"connectAccount"),a=0,u=function(){return o},c=function(t){if(t===o)return t;throw Error("I should be ".concat(t,", but am ").concat(o))},f=function(t,r){(0,x.ensureConnectorAvailable)(t,"ALGO",16,10),J(t);var s=t._Connectors.ALGO,f=s.stateSize,g=s.stateKeys,y=s.mapDataKeys,v=s.mapDataSize,w=s.ABI,_=s.companionInfo,A=null!==_,E=y>0,M=t._getMaps({reachStdlib:I.stdlib}).mapDataTy,T=(0,e.T_Bytes)(M.netSize),C=M.fromNet(T.toNet(T.canonicalize("")));(0,x.debug)({emptyMapData:C});var R=function(r,o){var s=r.getInfo,a=void 0;return function(){return l(void 0,void 0,void 0,(function(){var u,c,f,p,g,w,_,E,S,T,I,C,R,B,N,D,L,U,j;return h(this,(function(F){switch(F.label){case 0:return(0,x.debug)(i,"getC"),a?((0,x.debug)(i,"getC","ret"),[2,a]):((0,x.debug)(i,"getC","wait"),[4,s()]);case 1:return u=F.sent(),[4,(0,x.stdVerifyContract)(r,(function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return[4,qt(i,u,t,o)];case 1:return[2,e.sent()]}}))}))}))];case 2:return c=F.sent(),f=c.ApplicationID,p=c.Deployer,o.isInited()||(o.init({ApplicationID:f}),o.pushIgnore(rt)),(0,x.debug)(i,"getC",{ApplicationID:f}),g=b.default.getApplicationAddress((0,k.bigNumberToBigInt)(f)),(0,x.debug)(i,"getC",{ctcAddr:g}),w=function(t){return l(void 0,void 0,void 0,(function(){var e,r,n,i;return h(this,(function(o){switch(o.label){case 0:return[4,Mt(t)];case 1:return e=o.sent(),(0,x.debug)("getLocalState",e),r=e["apps-local-state"]||[],n=(0,k.bigNumberToBigInt)(f),i=r.find((function(t){return t.id===n})),(0,x.debug)("getLocalState",i),[2,i?i["key-value"]:void 0]}}))}))},_=function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,w(n.addr)];case 1:return[2,void 0!==t.sent()]}}))}))},E=function(){return l(void 0,void 0,void 0,(function(){var t,r,o,s,a,u,c;return h(this,(function(l){switch(l.label){case 0:return t="".concat(i," doOptIn"),(0,x.debug)(t),r=Y,o=[t,n],s=e.toWTxn,u=(a=b.default).makeApplicationOptInTxn,c=[n.addr],[4,(0,e.getTxnParams)(t)];case 1:return[4,r.apply(void 0,o.concat([s.apply(void 0,[u.apply(a,c.concat([l.sent(),(0,k.bigNumberToNumber)(f),void 0,void 0,void 0,void 0,vt]))])]))];case 2:return l.sent(),[2]}}))}))},S=!1,T=function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return S?[3,4]:[4,_()];case 1:return t.sent()?[3,3]:[4,E()];case 2:t.sent(),t.label=3;case 3:S=!0,t.label=4;case 4:return[2]}}))}))},I=void 0,C=0,R=function(){return l(void 0,void 0,void 0,(function(){var t,e;return h(this,(function(r){switch(r.label){case 0:return t=Date.now(),e=U()?0:1e3,I&&t-C<e?((0,x.debug)("getAppState cached"),[2,I]):[4,B()];case 1:return I=r.sent(),C=t,[2,I]}}))}))},B=function(){return l(void 0,void 0,void 0,(function(){var t,e,r,n;return h(this,(function(i){switch(i.label){case 0:return t="getAppStateFresh",[4,xt(f)];case 1:return"exn"in(e=i.sent())||e.val.deleted?[2,void 0]:(r=e.val,n=r.params["global-state"],(0,x.debug)(t,{appSt:n}),[2,n])}}))}))},N=function(t){return l(void 0,void 0,void 0,(function(){var r,n,i,o;return h(this,(function(s){switch(s.label){case 0:return(n=t)?[3,2]:[4,R()];case 1:n=s.sent(),s.label=2;case 2:return(r=n)&&(i=O("",[],r))?(o=A?[e.T_Contract]:[],[2,(0,e.T_Tuple)(m([e.T_UInt,e.T_UInt],d(o),!1)).fromNet(i)]):[2,void 0]}}))}))},D=function(t){return l(void 0,void 0,void 0,(function(){var e,r;return h(this,(function(n){switch(n.label){case 0:return t.eq(0)?[2,!0]:[4,N()];case 1:return e=n.sent(),r=!e||t.eq(e[1]),(0,x.debug)("canIWin",{lct:t,gs:e,r}),[2,r]}}))}))},[4,(0,e.getProvider)()];case 3:return L=F.sent().isIsolatedNetwork,j=function(t,r){return l(void 0,void 0,void 0,(function(){var n,i,o,s;return h(this,(function(a){switch(a.label){case 0:return(0,x.debug)("viewMapRef",{mapi:t,a:r}),[4,w(H(r))];case 1:return void 0===(n=a.sent())?[2,["None",null]]:((0,x.debug)("viewMapRef",{ls:n}),i=P("m",v,y,n),(0,x.debug)("viewMapRef",{mbs:i}),void 0===i?[2,["None",null]]:(o=M.fromNet(i),(0,x.debug)("viewMapRef",{md:o}),s=o[t],(0,e.assert)(void 0!==s,"viewMapRef mr undefined"),[2,s]))}}))}))},[2,a={ApplicationID:f,ctcAddr:g,Deployer:p,getAppState:R,getGlobalState:N,ensureOptIn:T,canIWin:D,isIsolatedNetwork:U=function(){return L},viewMapRef:j}]}}))}))}},B=function(t){return l(void 0,void 0,void 0,(function(){var e,r,n,i,o;return h(this,(function(s){switch(s.label){case 0:return[4,t()];case 1:return e=s.sent(),r=e.getAppState,n=e.getGlobalState,[4,r()];case 2:if(!(i=s.sent()))throw Error("getCurrentStep_: no appSt");return[4,n(i)];case 3:if(!(o=s.sent()))throw Error("getCurrentStep_: no gs");return[2,o[0]]}}))}))},N=function(t,r){return l(void 0,void 0,void 0,(function(){var n,i,o,s,a,u,c,l,d,p;return h(this,(function(h){switch(h.label){case 0:return[4,t()];case 1:return n=h.sent(),i=n.getAppState,o=n.getGlobalState,[4,i()];case 2:if(!(s=h.sent()))throw Error("getState: no appSt");return[4,o(s)];case 3:if(!(a=h.sent()))throw Error("getState: no gs");if((0,x.debug)("getState_",{gs:a}),void 0===(u=P("v",f,g,s)))throw Error("getState: no vvn");return c=a[0],l=r(c),d=(0,e.T_Tuple)(l),p=d.fromNet(u),(0,x.debug)("getState_",{vvn:u,vvs:p}),[2,[a[2],p]]}}))}))},O=function(t,e,r){(0,x.debug)({prefix:t,key:e});var n,i=(n=new Uint8Array(e),S.from(n).toString("base64"));(0,x.debug)({ik:i});var o=r.find((function(t){return t.key===i}));if((0,x.debug)({ste:o}),void 0!==o){var s=o.value;if((0,x.debug)({st:s}),void 0!==s.bytes){var a=Q(s.bytes);return(0,x.debug)({bsi:a}),a}}},P=function(t,e,r,n){(0,x.debug)("recoverSplitBytes",{prefix:t,size:e,howMany:r,src:n});for(var i=new Uint8Array(e),o=0,s=0;s<r;s++){var a=O(t,[s],n);if(!a||0==a.length)return i;i.set(a,o),o+=a.length}return i},D=w.sigs;return(0,x.stdContract)({bin:t,getABI:function(t){return{sigs:t?D:D.map((function(t){return{name:t}})).filter(x.stdABIFilter).map((function(t){return t.name}))}},waitUntilTime:e.waitUntilTime,waitUntilSecs:e.waitUntilSecs,selfAddress:u,iam:c,stdlib:I.stdlib,setupView:function(t){var e=nt(),r=R(t,e),n={viewMapRef:function(t,e){return l(void 0,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,r()];case 1:return[4,(0,n.sent().viewMapRef)(t,e)];case 2:return[2,n.sent()]}}))}))}};return{getView1:function(t,e,n,i,o){return void 0===o&&(o=!0),function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return l(void 0,void 0,void 0,(function(){var a,u,c,f,l,p,m,g;return h(this,(function(h){switch(h.label){case 0:(0,x.debug)("getView1",e,n,s),a=i.decode,h.label=1;case 1:return h.trys.push([1,5,,6]),[4,B(r)];case 2:if(u=h.sent(),c=(0,k.bigNumberToNumber)(u),!(f=t[c]))throw Error("no views for state ".concat(u));return[4,N(r,(function(t){return f}))];case 3:return(l=d.apply(void 0,[h.sent(),2]))[0],p=l[1],[4,a(c,p,s)];case 4:return m=h.sent(),(0,x.debug)({vres:m}),[2,o?["Some",m]:m];case 5:if(g=h.sent(),(0,x.debug)("getView1",e,n,"error",g),o)return[2,["None",null]];throw Error("View ".concat(e,".").concat(n," is not set."));case 6:return[2]}}))}))}},viewLib:n}},setupEvents:function(t){return{createEventStream:function(r,n){var i=nt(),o=R(t,i),s=_t(r,n).parse;return(0,x.makeEventStream)({eq:i,getTxnTime:function(t){return(0,k.bigNumberify)(t["confirmed-round"])},sync:function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,o()];case 1:return t.sent(),[2]}}))}))},getNetworkTime:e.getNetworkTime,getLogs:function(t){return t.logs},parseLog:s})}}},_setup:function(r){var s=r.setInfo,u=r.setTrustedVerifyResult,c=nt(),f=R(r,c),v=void 0,w=function(t){return l(void 0,void 0,void 0,(function(){var r,n,i,o,s,a,u,c,f,d,m,g,b;return h(this,(function(y){switch(y.label){case 0:if(r=t.dhead,n=t.funcNum,i=t.out_tys,o=t.didSend,s=t.txn,(0,x.debug)(r,"txn",s),A&&0===n){if(null==(a=s["created-companion-application-index"]))throw Error("impossible: no companion index");v=(0,k.bigNumberify)(a)}return u=s["confirmed-round"],[4,(0,x.retryLoop)([r,"getTimeSecs"],(function(){return(0,e.getTimeSecs)((0,k.bigNumberify)(u))}))];case 1:if(c=y.sent(),f=_t(At(n),i),d=f.parse0(s),(0,x.debug)(r,{ctc_args:d}),void 0===d)throw Error("impossible: txn doesn't have right log as first");return m=s.sender,g=e.T_Address.canonicalize({addr:m}),(0,x.debug)(r,{from:g,fromAddr:m}),b=function(t,r,n,i){return l(void 0,void 0,void 0,(function(){var o,a,u,c,f,l,d,m,g,b,y;return h(this,(function(h){(0,x.debug)("getOutput",{o_mode:t,o_lab:r,o_ctc:n,o_val:i}),o=(0,e.T_Tuple)([e.T_UInt,n]);try{for(a=p(s.logs),u=a.next();!u.done;u=a.next())if(c=u.value,f=St(c),l=e.T_UInt.fromNet(f),d="v".concat(l),(0,x.debug)("getOutput",{l:c,lb:f,ln:l,ls:d}),d===r)return m=o.fromNet(f),g=m[1],(0,x.debug)("getOutput",{ld:m,o:g}),[2,g]}catch(t){b={error:t}}finally{try{u&&!u.done&&(y=a.return)&&y.call(a)}finally{if(b)throw b.error}}throw Error("no log for ".concat(r))}))}))},[2,{didSend:o,didTimeout:!1,data:d,time:(0,k.bigNumberify)(u),secs:(0,k.bigNumberify)(c),from:g,getOutput:b}]}}))}))},S=function(t){return l(void 0,void 0,void 0,(function(){var r,n,o,s,a,u,d,p,m,g,b,y;return h(this,(function(v){switch(v.label){case 0:return r=t.funcNum,n=t.out_tys,o=t.didSend,s=t.timeoutAt,a=t.waitIfNotPresent,u="m".concat(r),d="".concat(i,": recv ").concat(u," ").concat(s),(0,x.debug)(d,"start"),[4,f()];case 1:return p=v.sent().isIsolatedNetwork,m=function(t){return l(void 0,void 0,void 0,(function(){var r,n;return h(this,(function(i){switch(i.label){case 0:return r=t.add(1),(0,x.debug)(d,"TIMECHECK",{timeoutAt:s,cr_bn:t,crp:r}),[4,(0,x.checkTimeout)(p,e.getTimeSecs,s,r)];case 1:return n=i.sent(),(0,x.debug)(d,"TIMECHECK",{r:n,waitIfNotPresent:a}),n||!a?[3,3]:[4,(0,e.waitUntilTime)(r)];case 2:i.sent(),i.label=3;case 3:return[2,n]}}))}))},[4,c.peq(d,m)];case 2:return g=v.sent(),(0,x.debug)(d,"res",g),b=Et(r,n),!g.timeout&&b(g.txn)?[4,c.deq(d)]:[3,5];case 3:return v.sent(),y=g.txn,[4,w({dhead:d,out_tys:n,didSend:o,funcNum:r,txn:y})];case 4:return[2,v.sent()];case 5:if(s)return(0,x.debug)(d,"timeout"),[2,{didTimeout:!0}];throw Error("".concat(d,": impossible: not good, but no timeout"));case 6:return[2]}}))}))};return{getContractInfo:function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,f()];case 1:return[2,t.sent().ApplicationID]}}))}))},getContractAddress:function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,f()];case 1:return t=r.sent().ctcAddr,[2,e.T_Address.canonicalize(t)]}}))}))},getContractCompanion:function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){return A?[2,["None",null]]:[2,["Some",v]]}))}))},getBalance:function(t){return void 0===t&&(t=!1),l(void 0,void 0,void 0,(function(){var r,n,i;return h(this,(function(o){switch(o.label){case 0:return[4,f()];case 1:return r=o.sent().ctcAddr,[4,(0,e.balanceOf)({addr:r},t)];case 2:return n=o.sent(),i=n.lt(e.minimumBalance)?(0,k.bigNumberify)(0):n.sub(e.minimumBalance),(0,x.debug)("Balance of contract:",i),[2,i]}}))}))},getState:function(e,r){return l(void 0,void 0,void 0,(function(){var n,i,o;return h(this,(function(s){switch(s.label){case 0:return(0,x.debug)("getState"),[4,N(f,(function(n){if(e.eq(n))return r;throw(0,x.apiStateMismatchError)(t,e,n)}))];case 1:return n=d.apply(void 0,[s.sent(),2]),i=n[0],o=n[1],v=i,[2,o]}}))}))},getCurrentStep:function(){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,B(f)];case 1:return[2,t.sent()]}}))}))},sendrecv:function(r){return l(void 0,void 0,void 0,(function(){var p,M,T,I,C,R,B,N,O,P,D,L,U,j,F,q,z,K,W,V,$,X,tt,et,rt,nt,it,ot,st,at,ut,ct,ft,lt,ht,dt,pt,mt,gt,bt,yt,_t,At,St,Mt,xt,kt,Tt,It,Ct,Rt,Bt;return h(this,(function(Nt){switch(Nt.label){case 0:return p=r.funcNum,M=r.evt_cnt,T=r.lct,I=r.tys,C=r.args,R=r.pay,B=r.out_tys,N=r.onlyIf,O=r.soloSend,P=r.timeoutAt,D=r.sim_p,L=0===p,U=function(t,e,r){return l(void 0,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:if((0,x.debug)(F,"doRecv",r),!t&&T.eq(0))throw new Error("API call failed: ".concat(r));return[4,S({funcNum:p,evt_cnt:M,out_tys:B,didSend:t,waitIfNotPresent:e,timeoutAt:P})];case 1:return[2,n.sent()]}}))}))},j="m".concat(p),F="".concat(i,": sendrecv ").concat(j," ").concat(P),N?[3,2]:[4,U(!1,!0,"onlyIf false")];case 1:return[2,Nt.sent()];case 2:return q=function(t){return l(void 0,void 0,void 0,(function(){var e;return h(this,(function(r){switch(r.label){case 0:return e=Et(p,B),c.pushIgnore((function(t){return e(G(t))})),[4,w({dhead:F,out_tys:B,didSend:!0,funcNum:p,txn:t})];case 1:return[2,r.sent()]}}))}))},L?((0,x.debug)(F,"deploy"),J(t),z=t._Connectors.ALGO,K=z.appApproval,W=z.appClear,V=z.extraPages,(0,x.debug)(F,"deploy",{extraPages:V}),$=n.addr,tt=Y,et=["ApplicationCreate",n],rt=e.toWTxn,it=(nt=b.default).makeApplicationCreateTxn,ot=[$],[4,(0,e.getTxnParams)(F)]):[3,5];case 3:return[4,tt.apply(void 0,et.concat([rt.apply(void 0,[it.apply(nt,ot.concat([Nt.sent(),b.default.OnApplicationComplete.NoOpOC,Q(K),Q(W),Lt,Ut+y,jt,Ft+g,void 0,void 0,void 0,void 0,wt(a++),void 0,void 0,V]))])]))];case 4:if(X=Nt.sent(),!(st=X["created-application-index"]))throw Error("No created-application-index in ".concat((0,x.j2s)(X)));at=(0,k.bigNumberify)(st),(0,x.debug)(i,"created",{ApplicationID:at}),ut=at,u({ApplicationID:at,Deployer:$}),s(ut),Nt.label=5;case 5:return[4,f()];case 6:return ct=Nt.sent(),ft=ct.ApplicationID,lt=ct.ctcAddr,ht=ct.Deployer,dt=ct.ensureOptIn,pt=ct.canIWin,mt=ct.isIsolatedNetwork,gt=d(R,2),bt=gt[0],gt[1],(0,x.debug)(F,"--- START"),[4,(0,e.getNetworkTime)()];case 7:return yt=Nt.sent(),[4,(0,e.getTimeSecs)(yt)];case 8:return _t=Nt.sent(),(At=d((0,x.argsSplit)(C,M),2))[0],St=At[1],(Mt=d((0,x.argsSplit)(I,M),2))[0],xt=Mt[1],[4,D({didSend:!0,didTimeout:!1,data:St,time:yt,secs:_t,value:bt,from:o,getOutput:function(t,e,r,n){return l(void 0,void 0,void 0,(function(){return h(this,(function(t){return[2,r.defaultValue]}))}))}})];case 9:return kt=Nt.sent(),(0,x.debug)(F,"--- SIMULATE",kt),L&&(Tt=A?e.minimumBalance.mul(2):e.minimumBalance,kt.txns.unshift({kind:"to",amt:Tt,tok:void 0})),It=kt.isHalt,E?[4,dt()]:[3,11];case 10:Nt.sent(),Nt.label=11;case 11:Ct=kt.mapRefs,Rt=function(){var t,r,o,s,a,u,c,f,l,g,y,w,E,S,M,I,C,R,B,N,D,z,K,G,W,V,$,X,Y,J,Q,tt,et,rt,nt;return h(this,(function(h){switch(h.label){case 0:return[4,(0,e.getTxnParams)(F)];case 1:return t=h.sent(),(0,x.debug)(F,"--- TIMECHECK",{params:t,timeoutAt:P}),[4,(0,x.checkTimeout)(mt,e.getTimeSecs,P,(0,k.bigNumberify)(t.firstRound).add(1))];case 2:return h.sent()?(r={},[4,U(!1,!1,"timeout")]):[3,4];case 3:return[2,(r.value=h.sent(),r)];case 4:return(o=!O)?[4,pt(T)]:[3,6];case 5:o=!h.sent(),h.label=6;case 6:return o?(s={},[4,U(!1,!1,"cannot win ".concat(T))]):[3,8];case 7:return[2,(s.value=h.sent(),s)];case 8:if((0,x.debug)(F,"--- ASSEMBLE w/",t),a=[],u=function(t){(0,e.addressEq)(n.addr,t)||-1!==a.findIndex((function(r){return(0,e.addressEq)(r,t)}))||a.push(t)},c=function(t){(0,x.debug)("recordAccount",{caddr:t});var e=H(t);(0,x.debug)("recordAccount",{addr:e}),u(e)},Ct.forEach(c),f=[],l=function(t){var e=(0,k.bigNumberToNumber)(t);if(!f.includes(e)){f.push(e);var r=b.default.getApplicationAddress((0,k.bigNumberToBigInt)(t));u(r)}},g=[],y=function(t){if(t){var e=(0,k.bigNumberToNumber)(t);g.includes(e)||g.push(e)}},w=0,E=0,S=[],M=0,C=function(r){var i;if("tokenNew"===r.kind)return C({kind:"to",amt:e.minimumBalance,tok:void 0}),void E++;if("tokenBurn"!==r.kind){if("tokenDestroy"===r.kind)return y(r.tok),void E++;if("remote"===r.kind)return l(r.obj),r.toks.map(y),r.accs.map(c),r.apps.map(l),void(E+=1+(0,k.bigNumberToNumber)(r.pays)+(0,k.bigNumberToNumber)(r.bills)+(0,k.bigNumberToNumber)(r.fees));if("api"!==r.kind){var o=r.tok,s=(0,k.bigNumberify)(0),a=lt,f=lt;if("from"===r.kind)return y(o),c(r.to),void E++;if("init"===r.kind)return C({kind:"to",amt:e.minimumBalance,tok:void 0}),y(o),void E++;if("halt"===r.kind)return o&&y(o),u(ht),void E++;if("to"===r.kind)a=n.addr,f=lt,s=r.amt;else{if("info"===r.kind)return void y(o);(0,e.assert)(!1,"sim txn kind")}i=(0,e.makeTransferTxn)(a,f,s,o,t,void 0,M++),w+=i.fee,i.fee=0,S.push(i)}else I=r.who}},kt.txns.forEach(C),A&&(L&&(l((0,k.bigNumberify)(0)),E++),R=function(){if(!L){if(void 0===v)throw Error("impossible: no companion yet");l(v)}},N=(B=function(t){return _[t]||0})("publish".concat(p))+(I?B("api_".concat(I)):0),(0,x.debug)("companion",{whichApi:I,companionCalls:N,companionInfo:_}),N>0&&(E+=N,R()),It&&(R(),E++)),(0,x.debug)(F,"txnExtraTxns",S),(0,x.debug)(F,{howManyMoreFees:E,extraFees:w}),w+=e.MinTxnFee*E,(0,x.debug)(F,{extraFees:w}),(0,x.debug)(F,"MAP",{mapAccts:a}),a.length>4)throw Error("Application references too many local state cells in one step. Reach should catch this problem statically.");D=0===a.length?void 0:a,z=0===g.length?void 0:g,(0,x.debug)(F,{assetsArr:g,assetsVal:z}),K=0===f.length?void 0:f,(0,x.debug)(F,{foreignArr:f,foreignVal:K}),G=[T,St],W=[e.T_UInt,(0,e.T_Tuple)(xt)],(0,x.debug)(F,"--- ARGS =",G),(V=G.map((function(t,e){return W[e].toNet(t)}))).unshift(new Uint8Array([p])),V.unshift(new Uint8Array([0])),V.forEach((function(t){if(!(t instanceof Uint8Array))throw Error("expect safe program argument, got ".concat((0,x.j2s)(t)))})),(0,x.debug)(F,"--- PREPARE:",V.map(Z)),$=It?b.default.makeApplicationDeleteTxn:b.default.makeApplicationNoOpTxn,(X=$(n.addr,t,(0,k.bigNumberToNumber)(ft),V,D,K,z,vt)).fee+=w,Y=m(m([],d(S),!1),[X],!1),(0,x.debug)(F,"assigning",{rtxns:Y}),b.default.assignGroupID(Y),J=Y.map(e.toWTxn),(0,x.debug)(F,"signing",{wtxns:J}),Q=void 0,h.label=9;case 9:return h.trys.push([9,11,,14]),[4,(0,e.signSendAndConfirm)(n,J)];case 10:return Q=h.sent(),[3,14];case 11:return tt=h.sent(),et=(0,x.j2s)(tt),(0,x.debug)(F,"FAIL",tt,et),O?[3,13]:((0,x.debug)(F,"LOST"),rt={},[4,U(!1,!1,et)]);case 12:return[2,(rt.value=h.sent(),rt)];case 13:if(P)return(0,x.debug)(F,"CONTINUE"),[2,"continue"];throw Error("".concat(i," failed to call ").concat(j,": ").concat(et));case 14:return(0,x.debug)(F,"SUCCESS",Q),nt={},[4,q(Q)];case 15:return[2,(nt.value=h.sent(),nt)]}}))},Nt.label=12;case 12:return[5,Rt()];case 13:return"object"==typeof(Bt=Nt.sent())?[2,Bt.value]:[3,12];case 14:return[2]}}))}))},recv:S,apiMapRef:function(t,e){return function(e){return l(void 0,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,f()];case 1:return[4,(0,r.sent().viewMapRef)(t,e)];case 2:return[2,r.sent()]}}))}))}}}},givenInfoP:r})},g={networkAccount:t},y=function(t){return l(void 0,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return(0,x.debug)("tokenAccepted",t),[4,It(g,t)];case 1:return[2,!1!==e.sent()]}}))}))},v=function(t){return l(void 0,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,y(t)];case 1:return r.sent()?[3,3]:((0,x.debug)("tokenAccept",t),[4,(0,e.transfer)(g,g,0,t)]);case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},w=function(t){return l(void 0,void 0,void 0,(function(){var r,n,i,o,s,a,u,c,f,d;return h(this,(function(p){switch(p.label){case 0:return(0,x.debug)("tokenMetadata",t),[4,(m=(0,k.bigNumberToNumber)(t),l(void 0,void 0,void 0,(function(){var t,e,r,n;return h(this,(function(i){switch(i.label){case 0:return t="getAssetInfo",[4,ut()];case 1:return e=i.sent(),r=e.lookupAssetByID(m),[4,et(t,r,0,(function(t){if("string"==typeof t&&t.includes("no assets found for asset-id"))throw Error("Asset ".concat(m," does not exist"));return{exn:t}}))];case 2:return n=i.sent(),(0,x.debug)(t,n),[2,n.asset]}}))})))];case 1:return r=p.sent(),(0,x.debug)({tokenRes:r}),n=r.params,(0,x.debug)({tokenInfo:n}),i=function(t,e){return e?t.fromNet(St(e)):void 0},s=(o=function(t,r){return i((0,e.T_Bytes)(t),r)})(32,n["name-b64"]),a=o(8,n["unit-name-b64"]),u=o(96,n["url-b64"]),c=function(){var t=n["metadata-hash"];try{return o(32,t)}catch(r){return(0,x.debug)("tokenMetadata metadata-hash","".concat(r)),i(e.T_Digest,t)}}(),f=(0,k.bigNumberify)(n.total),d=(0,k.bigNumberify)(n.decimals),[2,{name:s,symbol:a,url:u,metadata:c,supply:f,decimals:d}]}var m}))}))},_=(0,x.stdAccount_unsupported)(e.connector),A=s(s({},_),{networkAccount:t,getAddress:u,stdlib:I.stdlib,setDebugLabel:r,tokenAccepted:y,tokenAccept:v,tokenMetadata:w,contract:f}),E=A,M=function(t){return(0,e.balanceOf)(E,t)},T=function(t){return(0,e.balancesOf)(E,t)},[2,(0,x.stdAccount)(s(s({},A),{balanceOf:M,balancesOf:T}))]}))}))},e.minimumBalanceOf=function(t){return l(void 0,void 0,void 0,(function(){var r,n,i,o,s,a,u,c,f,l,d,p,m,g,b;return h(this,(function(h){switch(h.label){case 0:return r=(0,I.extractAddr)(t),[4,Mt(r)];case 1:return(n=h.sent()).amount===BigInt(0)?[2,(0,k.bigNumberify)(0)]:(i=(0,k.bigNumberify)((null!==(f=n["created-apps"])&&void 0!==f?f:[]).length),o=(0,k.bigNumberify)((null!==(l=n["apps-local-state"])&&void 0!==l?l:[]).length),s=(0,k.bigNumberify)(null!==(p=(null!==(d=n["apps-total-schema"])&&void 0!==d?d:{})["num-byte-slice"])&&void 0!==p?p:0),a=(0,k.bigNumberify)(null!==(g=(null!==(m=n["apps-total-schema"])&&void 0!==m?m:{})["num-uint"])&&void 0!==g?g:0),u=(0,k.bigNumberify)((null!==(b=n.assets)&&void 0!==b?b:[]).length),c=(0,k.bigNumberify)(0).add(u.mul(Ot)).add(Ct.add(Bt).mul(a)).add(Ct.add(Rt).mul(s)).add(Nt.mul(i)).add(Ot.mul(o)).add(e.minimumBalance),(0,x.debug)("minBalance",c),[2,c])}}))}))};var Tt=function(t,e){return l(void 0,void 0,void 0,(function(){var r,n,i,o;return h(this,(function(s){switch(s.label){case 0:return r=(0,I.extractAddr)(t),[4,Mt(r)];case 1:return n=s.sent(),i=n.assets||[],o=function(t){if(t){var e=(0,k.bigNumberify)(t),r=i.find((function(t){return e.eq(t["asset-id"])}));return!!r&&(0,k.bigNumberify)(r.amount)}return(0,k.bigNumberify)(n.amount)},[2,e.map(o)]}}))}))};e.balancesOf=function(t,e){return l(void 0,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,Tt(t,e)];case 1:return[2,r.sent().map((function(t){return!1===t?(0,k.bigNumberify)(0):t}))]}}))}))};var It=function(t,e){return l(void 0,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,Tt(t,[e||null])];case 1:return[2,r.sent()[0]]}}))}))};e.balanceOf=function(t,r){return l(void 0,void 0,void 0,(function(){return h(this,(function(n){switch(n.label){case 0:return[4,(0,e.balancesOf)(t,[r||null])];case 1:return[2,n.sent()[0]]}}))}))},e.createAccount=function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return t=b.default.generateAccount(),[4,(0,e.connectAccount)(t)];case 1:return[2,r.sent()]}}))}))},e.canFundFromFaucet=function(){return l(void 0,void 0,void 0,(function(){var t,r,n,i,o;return h(this,(function(s){switch(s.label){case 0:return[4,(0,e.getFaucet)()];case 1:return t=s.sent(),r="canFundFromFaucet",(0,x.debug)(r,"check genesis"),[4,(0,e.getTxnParams)(r)];case 2:return n=s.sent(),(i=n.genesisID)!=="devnet-v1"?((0,x.debug)(r,"expected '".concat("devnet-v1","' !== actual '").concat(i,"'")),[2,!1]):((0,x.debug)(r,"check balance"),[4,(0,e.balanceOf)(t)]);case 3:return o=s.sent(),(0,x.debug)(r,"faucet balance = ".concat(Pt(o,4)," ").concat(e.standardUnit)),[2,(0,e.gt)(o,0)]}}))}))},e.fundFromFaucet=function(t,r){return l(void 0,void 0,void 0,(function(){var n,i;return h(this,(function(o){switch(o.label){case 0:return[4,(0,e.getFaucet)()];case 1:return n=o.sent(),(0,x.debug)("fundFromFaucet"),i=Math.round(Math.random()*Math.pow(2,32)),[4,(0,e.transfer)(n,t,r,void 0,i)];case 2:return o.sent(),[2]}}))}))},e.newTestAccount=function(t){return l(void 0,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:return[4,(0,e.createAccount)()];case 1:return r=n.sent(),[4,(0,e.fundFromFaucet)(r,t)];case 2:return n.sent(),[2,r]}}))}))},e.newTestAccounts=(0,x.make_newTestAccounts)(e.newTestAccount).parallel,e.standardUnit="ALGO",e.atomicUnit="μALGO",e.parseCurrency=function(t,e){if(void 0===e&&(e=6),!(Number.isInteger(e)&&0<=e))throw Error("Expected decimals to be a nonnegative integer, but got ".concat(e,"."));var r=((0,k.isBigNumber)(t)?t.toNumber():"string"==typeof t?parseFloat(t):"bigint"==typeof t?Number(t):t)*Math.pow(10,e);return(0,k.bigNumberify)(Math.floor(r))},e.minimumBalance=(0,k.bigNumberify)(1e5);var Ct=(0,k.bigNumberify)(25e3),Rt=(0,k.bigNumberify)(25e3),Bt=(0,k.bigNumberify)(3500),Nt=(0,k.bigNumberify)(1e5),Ot=(0,k.bigNumberify)(1e5);function Pt(t,e){return void 0===e&&(e=6),(0,B.handleFormat)(t,e,6)}e.formatCurrency=Pt,e.getDefaultAccount=function(){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,(0,e.getProvider)()];case 1:return[4,r.sent().getDefaultAddress()];case 2:return t=r.sent(),[4,(0,e.connectAccount)({addr:t})];case 3:return[2,r.sent()]}}))}))},e.newAccountFromMnemonic=function(t){return l(void 0,void 0,void 0,(function(){return h(this,(function(r){switch(r.label){case 0:return[4,(0,e.connectAccount)(b.default.mnemonicToSecretKey(t))];case 1:return[2,r.sent()]}}))}))},e.newAccountFromSecret=function(t){return l(void 0,void 0,void 0,(function(){var r,n;return h(this,(function(i){switch(i.label){case 0:return r=v.ethers.utils.arrayify(t),n=b.default.secretKeyToMnemonic(r),[4,(0,e.newAccountFromMnemonic)(n)];case 1:return[2,i.sent()]}}))}))},e.getNetworkTime=function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(e){switch(e.label){case 0:return[4,ut()];case 1:return[4,e.sent().makeHealthCheck().do()];case 2:return t=e.sent(),[2,(0,k.bigNumberify)(t.round)]}}))}))},e.getTimeSecs=function(t){return l(void 0,void 0,void 0,(function(){var e,r,n,i;return h(this,(function(o){switch(o.label){case 0:e=(0,k.bigNumberToNumber)(t),o.label=1;case 1:return o.trys.push([1,5,,8]),[4,ft()];case 2:return o.sent(),[4,at()];case 3:return[4,o.sent().block(e).do()];case 4:return r=o.sent(),[2,(0,k.bigNumberify)(r.block.ts)];case 5:return n=o.sent(),(0,x.debug)("getTimeSecs","node failed",n),[4,ut()];case 6:return[4,o.sent().lookupBlock(e).do()];case 7:return i=o.sent(),(0,x.debug)("getTimeSecs","indexer",i),[2,(0,k.bigNumberify)(i.timestamp)];case 8:return[2]}}))}))},e.getNetworkSecs=function(){return l(void 0,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return t=e.getTimeSecs,[4,(0,e.getNetworkTime)()];case 1:return[4,t.apply(void 0,[r.sent()])];case 2:return[2,r.sent()]}}))}))};var Dt=function(t){return l(void 0,void 0,void 0,(function(){var r,n;return h(this,(function(i){switch(i.label){case 0:return[4,(0,e.getNetworkTime)()];case 1:return r=i.sent(),(0,x.debug)("stepTime",{target:t,now:r}),t.lte(r)?[2,r]:[4,(0,e.getProvider)()];case 2:return i.sent().isIsolatedNetwork?(n=e.fundFromFaucet,[4,(0,e.getFaucet)()]):[3,5];case 3:return[4,n.apply(void 0,[i.sent(),0])];case 4:return i.sent(),[3,7];case 5:return[4,X()];case 6:i.sent(),i.label=7;case 7:return[3,0];case 8:return[2]}}))}))};e.waitUntilTime=(0,x.make_waitUntilX)("time",e.getNetworkTime,Dt),e.waitUntilSecs=(0,x.make_waitUntilX)("secs",e.getNetworkSecs,(function(t){return l(void 0,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:return r=Dt,[4,(0,e.getNetworkTime)()];case 1:return[4,r.apply(void 0,[n.sent().add(1)])];case 2:return t=n.sent(),[4,(0,e.getTimeSecs)(t)];case 3:return[2,n.sent()]}}))}))})),e.wait=function(t,r){return l(void 0,void 0,void 0,(function(){var n;return h(this,(function(i){switch(i.label){case 0:return[4,(0,e.getNetworkTime)()];case 1:return n=i.sent(),[4,(0,e.waitUntilTime)(n.add(t),r)];case 2:return[2,i.sent()]}}))}))};var Lt=0,Ut=0,jt=0,Ft=1;e.verifyContract=function(t,e){return l(void 0,void 0,void 0,(function(){return h(this,(function(r){return[2,qt("",t,e,nt())]}))}))};var qt=function(t,r,n,i){return l(void 0,void 0,void 0,(function(){var o,s,a,u,c,f,l,d,p,m,g,b,y,v,w,_,A,E,S,M;return h(this,(function(h){switch(h.label){case 0:return J(n),o=(0,e.protect)(e.T_Contract,r),s=n._Connectors.ALGO,a=s.appApproval,u=s.appClear,c=s.mapDataKeys,f=s.stateKeys,l="".concat(t,": verifyContract"),d=function(t,e){if(!t)throw Error("".concat(l," failed: ").concat(e))},m=(p=function(t){return function(e,r,n){var i=(0,x.j2sf)(e),o=(0,x.j2sf)(r);d(t(e,r),"".concat(n,": expected ").concat(o,", got ").concat(i))}})((function(t,e){return t.eq(e)})),g=function(t,e,r){return m((0,k.bigNumberify)(t),(0,k.bigNumberify)(e),r)},b=p((function(t,e){return(0,x.j2sf)(t)===(0,x.j2sf)(e)})),[4,xt(o)];case 1:if("exn"in(y=h.sent()))throw Error("".concat(l," failed: failed to lookup application (").concat(o,"): ").concat((0,x.j2s)(y.exn)));return v=y.val,w=v.params,(0,x.debug)(l,{appInfo_wanted:n._Connectors.ALGO}),(0,x.debug)(l,{appInfo_p:w}),d(void 0!==w,"Cannot lookup ApplicationId"),b(w["approval-program"],a,"Approval program does not match Reach backend"),b(w["clear-state-program"],u,"ClearState program does not match Reach backend"),_=w.creator,A=w["local-state-schema"],g(A["num-byte-slice"],Ut+c,"Num of byte-slices in local state schema does not match Reach backend"),g(A["num-uint"],Lt,"Num of uints in local state schema does not match Reach backend"),E=w["global-state-schema"],g(E["num-byte-slice"],Ft+f,"Num of byte-slices in global state schema does not match Reach backend"),g(E["num-uint"],jt,"Num of uints in global state schema does not match Reach backend"),i.init({ApplicationID:o}),[4,i.deq(l)];case 2:return S=h.sent(),(0,x.debug)({iat:S}),g(S["created-application-index"],o,"app created"),g(S["application-index"],0,"app created"),(M=v["created-at-round"])&&g(S["confirmed-round"],M,"created on correct round"),b(S["approval-program"],w["approval-program"],"ApprovalProgram unchanged since creation"),b(S["clear-state-program"],w["clear-state-program"],"ClearStateProgram unchanged since creation"),[2,{ApplicationID:o,Deployer:_}]}}))}))};e.formatAddress=function(t){return(0,I.addressFromHex)(e.T_Address.canonicalize(t))},e.unsafeGetMnemonic=function(t){var e=t.networkAccount||t;if(!e.sk)throw Error("unsafeGetMnemonic: Secret key not accessible for account");return b.default.secretKeyToMnemonic(e.sk)};var zt=function(t,e,r,n,i,o,s,a,u,c){return b.default.makeAssetCreateTxnWithSuggestedParamsFromObject({from:t,note:u,total:(0,k.bigNumberToBigInt)(e),decimals:r,defaultFrozen:!1,unitName:n,assetName:i,assetURL:o,assetMetadataHash:s,clawback:a,suggestedParams:c})};e.launchToken=function(t,r,n,i){return void 0===i&&(i={}),l(void 0,void 0,void 0,(function(){var o,s,a,u,c,f,d,p,m,g,b,y,v,w,_;return h(this,(function(A){switch(A.label){case 0:return o=t.networkAccount.addr,s=i.supply?(0,k.bigNumberify)(i.supply):(0,k.bigNumberify)(2).pow(64).sub(1),a=null!==(v=i.decimals)&&void 0!==v?v:6,u=null!==(w=i.url)&&void 0!==w?w:"",c=null!==(_=i.metadataHash)&&void 0!==_?_:"",f=i.clawback?H((0,e.protect)(e.T_Address,i.clawback)):void 0,d=i.note||void 0,[4,(0,e.getTxnParams)("launchToken")];case 1:return p=A.sent(),[4,Y("launchToken ".concat((0,x.j2s)(t)," ").concat(r," ").concat(n),t.networkAccount,(0,e.toWTxn)(zt(o,s,a,n,r,u,c,f,d,p)))];case 2:if(m=A.sent(),!(g=m["created-asset-index"]))throw Error("".concat(n," no asset-index!"));return b=(0,k.bigNumberify)(g),y=function(n,i){return void 0===i&&(i=t),l(void 0,void 0,void 0,(function(){var t,o,s,a;return h(this,(function(u){switch(u.label){case 0:return t=n.networkAccount.addr,o=i.networkAccount.addr,[4,(0,e.getTxnParams)("token.optOut")];case 1:return s=u.sent(),a=(0,e.makeTransferTxn)(t,o,(0,k.bigNumberify)(0),b,s,o),[4,Y("token.optOut ".concat((0,x.j2s)(n)," ").concat(r),n.networkAccount,(0,e.toWTxn)(a))];case 2:return u.sent(),[2]}}))}))},[2,{name:r,sym:n,id:b,mint:function(r,n){return(0,e.transfer)(t,r,n,b)},optOut:y}]}}))}))},e.reachStdlib=I.stdlib},9539:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var i=n(r(3406));e.default=i.default},5976:function(t,e){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},i=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};e.__esModule=!0,e.ReachHTTPClient=void 0;var a=function(){function t(t,e,r){this.bc=t,this.eh=r,this.label=e,this.reqNum=0}return t.prototype._doTheThing=function(t,e,a,u,c){return n(this,void 0,void 0,(function(){var n,f,l,h,d,p,m,g;return i(this,(function(i){switch(i.label){case 0:return f=(n=this).eh,l=n.reqNum,h=n.label,d={label:h,reqNum:l,method:t,relativePath:e,data:a[0],query:u},this.reqNum=l+1,[4,f(r({eventName:"before"},d))];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,5,,7]),[4,(g=this.bc)[t].apply(g,s(s([e],o(a),!1),[u,c],!1))];case 3:return p=i.sent(),[4,f(r({eventName:"success",response:p},d))];case 4:return i.sent(),[2,p];case 5:return m=i.sent(),[4,f(r({eventName:"error",err:m},d))];case 6:throw i.sent(),m;case 7:return[2]}}))}))},t.prototype.get=function(t,e,r){return n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this._doTheThing("get",t,[],e,r)];case 1:return[2,n.sent()]}}))}))},t.prototype.post=function(t,e,r,o){return n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this._doTheThing("post",t,[e],r,o)];case 1:return[2,n.sent()]}}))}))},t.prototype.delete=function(t,e,r,o){return n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this._doTheThing("delete",t,[e],r,o)];case 1:return[2,n.sent()]}}))}))},t}();e.ReachHTTPClient=a},7883:function(t,e,r){"use strict";var n=r(2486).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(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)&&i(e,t,r);return o(e,t),e},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},u=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.URLTokenBaseHTTPClient=void 0;var f=c(r(1042)),l=c(r(9368)),h=s(r(5391)),d=function(){function t(t,e,r,n){void 0===n&&(n={}),this.defaultHeaders=n;var i=new f.default(e,{});if(void 0!==r&&i.set("port",r.toString()),0===i.protocol.length)throw new Error("Invalid base server URL, protocol must be defined.");this.baseURL=i,this.tokenHeader=t}return t.prototype.addressWithPath=function(t){return new f.default(l.default.posix.join(this.baseURL.pathname,t),this.baseURL).toString()},t.superagentToHTTPClientResponse=function(t){return t.body instanceof ArrayBuffer&&(t.body=new Uint8Array(t.body)),t},t.formatSuperagentError=function(t){if(t.response)try{var e=JSON.parse(n.from(t.response.body).toString());t.message="Network request error. Received status ".concat(t.response.status,": ").concat(e.message)}catch(t){}return t},t.prototype.get=function(e,r,n){return void 0===n&&(n={}),a(this,void 0,void 0,(function(){var i,o,s;return u(this,(function(a){switch(a.label){case 0:i=h.get(this.addressWithPath(e)).set(this.tokenHeader).set(this.defaultHeaders).set(n).responseType("arraybuffer").query(r),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,i];case 2:return o=a.sent(),[2,t.superagentToHTTPClientResponse(o)];case 3:throw s=a.sent(),t.formatSuperagentError(s);case 4:return[2]}}))}))},t.prototype.post=function(e,r,i,o){return void 0===o&&(o={}),a(this,void 0,void 0,(function(){var s,a,c;return u(this,(function(u){switch(u.label){case 0:s=h.post(this.addressWithPath(e)).set(this.tokenHeader).set(this.defaultHeaders).set(o).query(i).serialize((function(t){return t})).responseType("arraybuffer").send(n.from(r)),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,s];case 2:return a=u.sent(),[2,t.superagentToHTTPClientResponse(a)];case 3:throw c=u.sent(),t.formatSuperagentError(c);case 4:return[2]}}))}))},t.prototype.delete=function(e,r,i,o){return void 0===o&&(o={}),a(this,void 0,void 0,(function(){var s,a,c;return u(this,(function(u){switch(u.label){case 0:s=h.delete(this.addressWithPath(e)).set(this.tokenHeader).set(this.defaultHeaders).set(o).query(i).serialize((function(t){return t})).responseType("arraybuffer").send(n.from(r)),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,s];case 2:return a=u.sent(),[2,t.superagentToHTTPClientResponse(a)];case 3:throw c=u.sent(),t.formatSuperagentError(c);case 4:return[2]}}))}))},t}();e.URLTokenBaseHTTPClient=d},1825:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},i=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var s=o(r(8849)),a=o(r(3882)),u=r(3653),c=function(){function t(){console.log("AWC ctor"),this.wc=!1,this.connected=new u.Signal}return t.prototype.ensureWC=function(){return n(this,void 0,void 0,(function(){var t,e;return i(this,(function(r){return console.log("AWC ensureWC"),this.wc||(this.wc=new s.default({bridge:"https://bridge.walletconnect.org",qrcodeModal:a.default}),t=this,e=function(e,r){if(console.log("AWC onConnect",{err:e,payload:r}),e)throw e;t.connected.notify()},this.wc.on("session_update",e),this.wc.on("connect",e),console.log("AWC ensureWC",{me:t})),[2]}))}))},t.prototype.ensureSession=function(){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.ensureWC()];case 1:return t.sent(),this.wc.connected?[3,3]:(console.log("AWC createSession"),[4,this.wc.createSession()]);case 2:return t.sent(),[3,4];case 3:console.log("AWC session exists"),this.connected.notify(),t.label=4;case 4:return[2]}}))}))},t.prototype.getAddr=function(){return n(this,void 0,void 0,(function(){var t;return i(this,(function(e){switch(e.label){case 0:return[4,this.ensureSession()];case 1:return e.sent(),[4,this.connected.wait()];case 2:return e.sent(),t=this.wc.accounts,console.log("AWC getAddr",t),[2,t[0]]}}))}))},t.prototype.signTxns=function(t){return n(this,void 0,void 0,(function(){var e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.ensureSession()];case 1:i.sent(),e={method:"algo_signTxn",params:[t.map((function(t){return{txn:t}}))]},console.log("AWC signTxns ->",e),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.wc.sendCustomRequest(e)];case 3:return r=i.sent(),console.log("AWC signTxns <-",r),[2,r];case 4:throw n=i.sent(),console.log("AWC signTxns err",n),n;case 5:return[2]}}))}))},t}();e.default=c},3066:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(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)&&i(e,t,r);return o(e,t),e},a=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.stdlib=e.emptyContractInfo=e.typeDefs=e.tokenEq=e.ctcAddrEq=e.btoiLast8=e.bytes_xor=e.digest_xor=e.digestEq=e.addressEq=e.T_Data=e.T_Object=e.T_Struct=e.T_Tuple=e.T_Array=e.T_Contract=e.T_Address=e.extractAddr=e.addressFromHex=e.addressToHex=e.T_Digest=e.T_Bytes=e.bytestringyNet=e.T_UInt256=e.T_UInt=e.T_Bool=e.T_Null=e.digest=e.UInt_max=void 0;var f=s(r(6549)),l=r(3653),h=r(135),d=c(r(7012)),p=c(r(2486)),m=r(3825),g=s(r(1923)),b=m.ethers.BigNumber,y=p.default.Buffer;e.UInt_max=b.from(2).pow(64).sub(1),e.digest=(0,l.makeDigest)("sha256",(function(t,e){return t.toNet(e)})),e.T_Null=n(n({},g.BT_Null),{netSize:0,toNet:function(t){return new Uint8Array([])},fromNet:function(t){return null},netName:"byte[0]"}),e.T_Bool=n(n({},g.BT_Bool),{netSize:1,toNet:function(t){return new Uint8Array([t?1:0])},fromNet:function(t){return 1==t[0]},netName:"byte"}),e.T_UInt=n(n({},g.BT_UInt(e.UInt_max)),{netSize:8,toNet:function(t){try{return m.ethers.utils.zeroPad(m.ethers.utils.arrayify(t),8)}catch(r){throw new Error("toNet: ".concat(t," is out of range [0, ").concat(e.UInt_max,"]"))}},fromNet:function(t){return m.ethers.BigNumber.from(t.slice(0,8))},netName:"uint64"}),e.T_UInt256=n(n({},g.BT_UInt(l.UInt256_max)),{netSize:32,toNet:function(t){try{return m.ethers.utils.zeroPad(m.ethers.utils.arrayify(t),32)}catch(e){throw new Error("toNet: ".concat(t," is out of range [0, ").concat(l.UInt256_max,"]"))}},fromNet:function(t){return m.ethers.BigNumber.from(t.slice(0,32))},netName:"uint256"}),e.bytestringyNet=function(t){return{netSize:t,netName:"byte[".concat(t,"]"),toNet:function(t){return m.ethers.utils.arrayify(t)},fromNet:function(e){return m.ethers.utils.hexlify(e.slice(0,t))}}},e.T_Bytes=function(t){return n(n(n({},g.BT_Bytes(t)),function(t){return{toNet:function(t){return m.ethers.utils.toUtf8Bytes(t)},fromNet:function(e){return m.ethers.utils.toUtf8String(e.slice(0,t))}}}(t)),{netSize:(0,h.bigNumberToNumber)(t),netName:"byte[".concat(t,"]")})},e.T_Digest=n(n(n({},g.BT_Digest),(0,e.bytestringyNet)(32)),{netName:"digest"}),e.addressToHex=function(t){return"0x"+y.from(d.default.decodeAddress(t).publicKey).toString("hex")},e.addressFromHex=function(t){return d.default.encodeAddress(y.from(t.slice(2),"hex"))};var v=function(t){return t&&t.networkAccount&&t.networkAccount.addr||t&&t.addr||"string"==typeof t&&t};e.extractAddr=function(t){var e=v(t);if(!1===e)throw Error("Expected address, got ".concat(t));return e},e.T_Address=n(n(n({},g.BT_Address),(0,e.bytestringyNet)(32)),{netSize:32,canonicalize:function(t){var r,n,i=(n=v(r=t))?"0x"===n.slice(0,2)?n:(0,e.addressToHex)(n):r;return g.BT_Address.canonicalize(i||t).padEnd(66,"0")},netName:"address"}),e.T_Contract=n(n({},e.T_UInt),{name:"Contract"}),e.T_Array=function(t,r){var i=(0,h.bigNumberToNumber)((0,h.bigNumberify)(r));(0,l.debug)("T_Array",t,i);var o=(0,e.T_Tuple)(new Array(i).fill(t));(0,l.debug)("T_Array",o);var s=o.netSize,a=o.toNet,u=o.fromNet;return n(n({},g.BT_Array(t,i)),{netSize:s,toNet:a,fromNet:u,netName:"".concat(t.netName,"[").concat(i,"]")})},e.T_Tuple=function(t){return n(n({},g.BT_Tuple(t)),{netSize:t.reduce((function(t,e){return t+e.netSize}),0),toNet:function(e){var r=t.map((function(t,r){return t.toNet(e[r])}));return m.ethers.utils.concat(r)},fromNet:function(e){var r=new Array(t.length).fill(null),n=e;for(var i in t){var o=t[i];r[i]=o.fromNet(n.slice(0,o.netSize)),n=n.slice(o.netSize)}return r},netName:"(".concat(t.map((function(t){return t.netName})).join(","),")")})},e.T_Struct=function(t){return n(n({},g.BT_Struct(t)),{netSize:t.reduce((function(t,e){return t+e[1].netSize}),0),toNet:function(e){var r=t.map((function(t){var r=a(t,2),n=r[0];return r[1].toNet(e[n])}));return m.ethers.utils.concat(r)},fromNet:function(e){var r={},n=e;for(var i in t){var o=a(t[i],2),s=o[0],u=o[1];r[s]=u.fromNet(n.slice(0,u.netSize)),n=n.slice(u.netSize)}return r},netName:"(".concat(t.map((function(t){return t[1].netName})).join(","),")")})},e.T_Object=function(t){var e=Object.values(t),r=e.reduce((function(t,e){return t+e.netSize}),0),i=(0,l.labelMaps)(t).ascLabels;return n(n({},g.BT_Object(t)),{netSize:r,toNet:function(e){var r=i.map((function(r){return t[r].toNet(e[r])}));return m.ethers.utils.concat(r)},fromNet:function(e){var r={},n=e;for(var o in i){var s=parseInt(o),a=i[s],u=t[a];r[a]=u.fromNet(n.slice(0,u.netSize)),n=n.slice(u.netSize)}return r},netName:"(".concat(e.map((function(t){return t.netName})).join(","),")")})},e.T_Data=function(t){var e=Object.values(t),r=e.map((function(t){return t.netSize})),i=Math.max.apply(Math,u([],a(r),!1)),o=i+1;(0,l.debug)("T_Data",{cos:e,cosSizes:r,valSize:i,netSize:o});var s=(0,l.labelMaps)(t),c=s.ascLabels,f=s.labelMap;return n(n({},g.BT_Data(t)),{netSize:o,toNet:function(e){var r=a(e,2),n=r[0],o=r[1],s=f[n],u=new Uint8Array([s]),c=t[n].toNet(o),l=new Uint8Array(i-c.length);return m.ethers.utils.concat([u,c,l])},fromNet:function(e){var r=e[0],n=c[r],i=t[n];(0,l.debug)({nv:e,i:r,label:n,val_co:i});var o=e.slice(1),s=i.netSize;return[n,i.fromNet(o.slice(0,s))]},netName:"(byte,byte[".concat(i,"])")})},e.addressEq=(0,l.mkAddressEq)(e.T_Address),e.digestEq=f.bytesEq,e.digest_xor=f.digest_xor,e.bytes_xor=f.bytes_xor,e.btoiLast8=f.btoiLast8;var w=e.T_UInt;e.ctcAddrEq=function(t,r){(0,l.debug)("ctcAddrEq",{x:t,y:r});var n=e.T_Contract.canonicalize(t),i=e.T_Address.canonicalize(r),o=d.default.getApplicationAddress((0,h.bigNumberToBigInt)(n));return(0,l.debug)("ctcAddrEq",{addr_x:o,addr_y:i}),(0,e.addressEq)(o,i)},e.tokenEq=function(t,e){return w.canonicalize(t).eq(w.canonicalize(e))},e.typeDefs={T_Null:e.T_Null,T_Bool:e.T_Bool,T_UInt:e.T_UInt,T_UInt256:e.T_UInt256,T_Bytes:e.T_Bytes,T_Address:e.T_Address,T_Contract:e.T_Contract,T_Digest:e.T_Digest,T_Token:w,T_Object:e.T_Object,T_Data:e.T_Data,T_Array:e.T_Array,T_Tuple:e.T_Tuple,T_Struct:e.T_Struct},e.emptyContractInfo=0;var _=(0,l.makeArith)(e.UInt_max);e.stdlib=n(n(n(n({},f),_),e.typeDefs),{addressEq:e.addressEq,ctcAddrEq:e.ctcAddrEq,digestEq:e.digestEq,tokenEq:e.tokenEq,digest:e.digest,UInt_max:e.UInt_max,emptyContractInfo:e.emptyContractInfo})},1923:function(t,e,r){"use strict";var n=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s};e.__esModule=!0,e.BV_Data=e.BT_Data=e.BV_Object=e.BT_Object=e.BV_Struct=e.BT_Struct=e.BV_Tuple=e.BT_Tuple=e.BV_Array=e.BT_Array=e.BV_Address=e.BT_Address=e.BV_Digest=e.BT_Digest=e.BT_Bytes=e.BV_UInt=e.BT_UInt=e.BV_Bool=e.BT_Bool=e.BT_Null=e.BV_Null=e.bigNumberToNumber=e.bigNumberify=void 0;var i=r(3825),o=r(6549),s=r(3653),a=i.ethers.BigNumber;e.bigNumberify=function(t){var e="number"==typeof t?t.toString():t;return a.from(e)},e.bigNumberToNumber=function(t){return(0,e.bigNumberify)(t).toNumber()},e.BV_Null=null,e.BT_Null={name:"Null",defaultValue:e.BV_Null,canonicalize:function(t){if(null!=t)throw Error("Expected null, but got ".concat((0,s.j2s)(t)));return e.BV_Null}},e.BT_Bool={name:"Bool",defaultValue:!1,canonicalize:function(t){if("boolean"!=typeof t)throw Error("Expected boolean, but got ".concat((0,s.j2s)(t)));return t}},e.BV_Bool=function(t){return e.BT_Bool.canonicalize(t)},e.BT_UInt=function(t){return{name:"UInt",defaultValue:i.ethers.BigNumber.from(0),canonicalize:function(e){try{var r="BigNumber"===(null==e?void 0:e.type)?e:"function"==typeof(null==e?void 0:e.toString)?e.toString():e;return(0,o.checkedBigNumberify)("stdlib:CBR:BT_UInt",t,r)}catch(t){if("string"==typeof e)throw Error("String does not represent a BigNumber. ".concat((0,s.j2s)(e)));throw t}}}},e.BV_UInt=function(t,r){return(0,e.BT_UInt)(r).canonicalize(t)},e.BT_Bytes=function(t){return{name:"Bytes(".concat(t,")"),defaultValue:"".padEnd(t,"\0"),canonicalize:function(r){var n=(0,e.bigNumberToNumber)(t);if("string"!=typeof r)throw Error("Bytes expected string, but got ".concat((0,s.j2s)(r)));var i=function(e,n,i){if(r.length>n)throw Error("Bytes(".concat(t,") must be a ").concat(e,"string less than or equal to ").concat(n,", but given ").concat(e,"string of length ").concat(r.length));return r.padEnd(n,i)};return"0x"===r.slice(0,2)?i("hex ",2*n+2,"0"):i("",n,"\0")}}},e.BT_Digest={name:"Digest",defaultValue:"".padEnd(32,"\0"),canonicalize:function(t){if("string"!=typeof t)throw Error("".concat((0,s.j2s)(t)," is not a valid digest"));return t}},e.BV_Digest=function(t){return e.BT_Digest.canonicalize(t)},e.BT_Address={name:"Address",defaultValue:"".padEnd(32,"\0"),canonicalize:function(t){if("string"!=typeof t)throw Error("Address must be a string, but got: ".concat((0,s.j2s)(t)));if("0x"!==t.slice(0,2))throw Error("Address must start with 0x, but got: ".concat((0,s.j2s)(t)));if(!i.ethers.utils.isHexString(t))throw Error("Address must be a valid hex string, but got: ".concat((0,s.j2s)(t)));return t}},e.BV_Address=function(t){return e.BT_Address.canonicalize(t)},e.BT_Array=function(t,e){return{name:"Array(".concat(t.name,", ").concat(e,")"),defaultValue:Array(e).fill(t.defaultValue),canonicalize:function(r){if(!Array.isArray(r))throw Error("Expected an Array, but got ".concat((0,s.j2s)(r)));if(e!=r.length)throw Error("Expected array of length ".concat(e,", but got ").concat(r.length));for(var n=new Array(e),i=0;i<e;i++)n[i]=t.canonicalize(r[i]);return n}}},e.BV_Array=function(t,r){return function(n){return(0,e.BT_Array)(t,r).canonicalize(n)}},e.BT_Tuple=function(t){return{name:"Tuple(".concat(t.map((function(t){return" ".concat(t.name," ")})),")"),defaultValue:t.map((function(t){return t.defaultValue})),canonicalize:function(e){if(!Array.isArray(e))throw Error("Expected a Tuple, but got ".concat((0,s.j2s)(e)));if(t.length!=e.length)throw Error("Expected tuple of size ".concat(t.length,", but got ").concat(e.length));return e.map((function(e,r){return t[r].canonicalize(e)}))}}},e.BV_Tuple=function(t){return function(r){return(0,e.BT_Tuple)(t).canonicalize(r)}},e.BT_Struct=function(t){return{name:"Struct([".concat(t.map((function(t){var e=n(t,2),r=e[0],i=e[1];return" [".concat(r,", ").concat(i.name,"] ")})),"])"),defaultValue:(e={},t.forEach((function(t){var r=n(t,2),i=r[0],o=r[1];e[i]=o.defaultValue})),e),canonicalize:function(e){var r={};return t.forEach((function(t,i){var o=n(t,2),s=o[0],a=o[1];r[s]=a.canonicalize(Array.isArray(e)?e[i]:e[s])})),r}};var e},e.BV_Struct=function(t){return function(r){return(0,e.BT_Struct)(t).canonicalize(r)}},e.BT_Object=function(t){return{name:"Object(".concat(Object.keys(t).map((function(e){return" ".concat(e,": ").concat(t[e].name," ")})),")"),defaultValue:function(){var e={};for(var r in t)e[r]=t[r].defaultValue;return e}(),canonicalize:function(e){if("object"!=typeof e)throw Error("Expected object, but got ".concat((0,s.j2s)(e)));var r={};for(var n in t){if(!(0,s.hasProp)(e,n))throw Error("Expected prop ".concat(n,", but didn't find it in ").concat(Object.keys(e)));r[n]=t[n].canonicalize(e[n])}return r}}},e.BV_Object=function(t){return function(r){return(0,e.BT_Object)(t).canonicalize(r)}},e.BT_Data=function(t){var e,r=(0,s.labelMaps)(t).ascLabels;return{name:"Data(".concat(Object.keys(t).map((function(e){return" ".concat(e,": ").concat(t[e].name," ")})),")"),defaultValue:(e=r[0],[e,t[e].defaultValue]),canonicalize:function(e){if(!Array.isArray(e)||2!=e.length||"string"!=typeof e[0])throw Error("Expected an array of length two to represent a data instance, but got ".concat((0,s.j2s)(e)));var r=e[0];if(!(0,s.hasProp)(t,r))throw Error("Expected a variant in ".concat(Object.keys(t),", but got ").concat(r));return[r,t[r].canonicalize(e[1])]}}},e.BV_Data=function(t){return function(r){return(0,e.BT_Data)(t).canonicalize(r)}}},4828:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e},s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};e.__esModule=!0,e.setCustomHttpEventHandler=e.setMinMillisBetweenRequests=e.reachStdlib=e.launchToken=e.unsafeGetMnemonic=e.formatWithDecimals=e.formatAddress=e.formatCurrency=e.minimumBalance=e.parseCurrency=e.atomicUnit=e.standardUnit=e.verifyContract=e.waitUntilSecs=e.getNetworkSecs=e.wait=e.waitUntilTime=e.getTimeSecs=e.getNetworkTime=e.newTestAccounts=e.newTestAccount=e.fundFromFaucet=e.canFundFromFaucet=e.createAccount=e.setFaucet=e.getFaucet=e.getDefaultAccount=e.newAccountFromMnemonic=e.newAccountFromSecret=e.connectAccount=e.transfer=e.minimumBalanceOf=e.balancesOf=e.balanceOf=e.walletFallback=e.setWalletFallback=e.providerEnvByName=e.setProviderByName=e.setProviderByEnv=e.hasRandom=e.randomUInt=e.setProvider=e.getProvider=e.setValidQueryWindow=e.getValidQueryWindow=e.setQueryLowerBound=e.getQueryLowerBound=e.doCall=e.connector=e.ethers=void 0,e.btoiLast8=e.bytes_xor=e.digest_xor=e.digestEq=e.bytesEq=e.Array_set=e.assert=e.protect=e.muldiv=e.cast=e.sqrt256=e.sqrt=e.lt256=e.le256=e.gt256=e.ge256=e.eq256=e.bxor256=e.bior256=e.band256=e.div256=e.mul256=e.mod256=e.sub256=e.add256=e.lt=e.le=e.gt=e.ge=e.eq=e.bxor=e.bior=e.band=e.div=e.mul=e.mod=e.sub=e.add=e.setSigningMonitor=void 0;var a=o(r(2888)),u=r(3955);e.ethers=o(r(8690)),s(r(7734),e),e.connector="CFX";var c=(0,u.makeEthLike)(a);e.doCall=c.doCall,e.getQueryLowerBound=c.getQueryLowerBound,e.setQueryLowerBound=c.setQueryLowerBound,e.getValidQueryWindow=c.getValidQueryWindow,e.setValidQueryWindow=c.setValidQueryWindow,e.getProvider=c.getProvider,e.setProvider=c.setProvider,e.randomUInt=c.randomUInt,e.hasRandom=c.hasRandom,e.setProviderByEnv=c.setProviderByEnv,e.setProviderByName=c.setProviderByName,e.providerEnvByName=c.providerEnvByName,e.setWalletFallback=c.setWalletFallback,e.walletFallback=c.walletFallback,e.balanceOf=c.balanceOf,e.balancesOf=c.balancesOf,e.minimumBalanceOf=c.minimumBalanceOf,e.transfer=c.transfer,e.connectAccount=c.connectAccount,e.newAccountFromSecret=c.newAccountFromSecret,e.newAccountFromMnemonic=c.newAccountFromMnemonic,e.getDefaultAccount=c.getDefaultAccount,e.getFaucet=c.getFaucet,e.setFaucet=c.setFaucet,e.createAccount=c.createAccount,e.canFundFromFaucet=c.canFundFromFaucet,e.fundFromFaucet=c.fundFromFaucet,e.newTestAccount=c.newTestAccount,e.newTestAccounts=c.newTestAccounts,e.getNetworkTime=c.getNetworkTime,e.getTimeSecs=c.getTimeSecs,e.waitUntilTime=c.waitUntilTime,e.wait=c.wait,e.getNetworkSecs=c.getNetworkSecs,e.waitUntilSecs=c.waitUntilSecs,e.verifyContract=c.verifyContract,e.standardUnit=c.standardUnit,e.atomicUnit=c.atomicUnit,e.parseCurrency=c.parseCurrency,e.minimumBalance=c.minimumBalance,e.formatCurrency=c.formatCurrency,e.formatAddress=c.formatAddress,e.formatWithDecimals=c.formatWithDecimals,e.unsafeGetMnemonic=c.unsafeGetMnemonic,e.launchToken=c.launchToken,e.reachStdlib=c.reachStdlib,e.setMinMillisBetweenRequests=c.setMinMillisBetweenRequests,e.setCustomHttpEventHandler=c.setCustomHttpEventHandler,e.setSigningMonitor=c.setSigningMonitor,e.add=e.reachStdlib.add,e.sub=e.reachStdlib.sub,e.mod=e.reachStdlib.mod,e.mul=e.reachStdlib.mul,e.div=e.reachStdlib.div,e.band=e.reachStdlib.band,e.bior=e.reachStdlib.bior,e.bxor=e.reachStdlib.bxor,e.eq=e.reachStdlib.eq,e.ge=e.reachStdlib.ge,e.gt=e.reachStdlib.gt,e.le=e.reachStdlib.le,e.lt=e.reachStdlib.lt,e.add256=e.reachStdlib.add256,e.sub256=e.reachStdlib.sub256,e.mod256=e.reachStdlib.mod256,e.mul256=e.reachStdlib.mul256,e.div256=e.reachStdlib.div256,e.band256=e.reachStdlib.band256,e.bior256=e.reachStdlib.bior256,e.bxor256=e.reachStdlib.bxor256,e.eq256=e.reachStdlib.eq256,e.ge256=e.reachStdlib.ge256,e.gt256=e.reachStdlib.gt256,e.le256=e.reachStdlib.le256,e.lt256=e.reachStdlib.lt256,e.sqrt=e.reachStdlib.sqrt,e.sqrt256=e.reachStdlib.sqrt256,e.cast=e.reachStdlib.cast,e.muldiv=e.reachStdlib.muldiv,e.protect=e.reachStdlib.protect,e.assert=e.reachStdlib.assert,e.Array_set=e.reachStdlib.Array_set,e.bytesEq=e.reachStdlib.bytesEq,e.digestEq=e.reachStdlib.digestEq,e.digest_xor=e.reachStdlib.digest_xor,e.bytes_xor=e.reachStdlib.bytes_xor,e.btoiLast8=e.reachStdlib.btoiLast8,s(r(135),e)},7734:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e};e.__esModule=!0,e.tokenEq=e.addressEq=e.digest=e.UInt_max=e.T_Struct=e.T_Tuple=e.T_Array=e.T_Data=e.T_Object=e.T_Token=e.T_Digest=e.T_Contract=e.T_Address=e.T_Bytes=e.T_UInt256=e.T_UInt=e.T_Bool=e.T_Null=e.bxor256=e.bior256=e.band256=e.mod256=e.div256=e.mul256=e.sub256=e.add256=e.bxor=e.bior=e.band=e.mod=e.div=e.mul=e.sub=e.add=e.typeDefs=e.stdlib=e.setNetworkId=e.getNetworkId=void 0;var s=r(4980),a=o(r(3864)),u=(0,s.makeEthLikeCompiled)(a);e.getNetworkId=a.getNetworkId,e.setNetworkId=a.setNetworkId,e.stdlib=u.stdlib,e.typeDefs=u.typeDefs,e.add=e.stdlib.add,e.sub=e.stdlib.sub,e.mul=e.stdlib.mul,e.div=e.stdlib.div,e.mod=e.stdlib.mod,e.band=e.stdlib.band,e.bior=e.stdlib.bior,e.bxor=e.stdlib.bxor,e.add256=e.stdlib.add256,e.sub256=e.stdlib.sub256,e.mul256=e.stdlib.mul256,e.div256=e.stdlib.div256,e.mod256=e.stdlib.mod256,e.band256=e.stdlib.band256,e.bior256=e.stdlib.bior256,e.bxor256=e.stdlib.bxor256,e.T_Null=e.stdlib.T_Null,e.T_Bool=e.stdlib.T_Bool,e.T_UInt=e.stdlib.T_UInt,e.T_UInt256=e.stdlib.T_UInt256,e.T_Bytes=e.stdlib.T_Bytes,e.T_Address=e.stdlib.T_Address,e.T_Contract=e.stdlib.T_Contract,e.T_Digest=e.stdlib.T_Digest,e.T_Token=e.stdlib.T_Token,e.T_Object=e.stdlib.T_Object,e.T_Data=e.stdlib.T_Data,e.T_Array=e.stdlib.T_Array,e.T_Tuple=e.stdlib.T_Tuple,e.T_Struct=e.stdlib.T_Struct,e.UInt_max=e.stdlib.UInt_max,e.digest=e.stdlib.digest,e.addressEq=e.stdlib.addressEq,e.tokenEq=e.stdlib.tokenEq},3864:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(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)&&i(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.T_Address=e.getNetworkId=e.setNetworkId=void 0;var u=s(r(638)),c=a(r(2486)),f=r(8081),l=r(3653),h=c.default.Buffer,d=999;function p(){return m(u.T_Address.defaultValue)}function m(t){(0,l.debug)("address_ethToCfx","call",t),t=t.toLowerCase();var e=h.from(t.slice(2),"hex");return(0,f.encodeCfxAddress)(e,d)}e.setNetworkId=function(t){d=t,e.T_Address.defaultValue=p()},e.getNetworkId=function(){return d},e.T_Address=n(n({},u.T_Address),{canonicalize:function(t){if((0,l.debug)("address canonicalize",{uv:t}),"string"==typeof t){if("0x"===t.slice(0,2)){var r=m(t);return(0,f.address_cfxStandardize)(r)}return(0,f.address_cfxStandardize)(t)}if(!t)throw Error("Expected address, got ".concat((0,l.j2s)(t)));var n=t;if(n.networkAccount)return e.T_Address.canonicalize(n.networkAccount);if(n.address)return e.T_Address.canonicalize(n.address);throw Error("TODO: canonicalize non-string addr")},defaultValue:p(),munge:function(t){return function(t){(0,l.debug)("address_cfxToEth","call",t);var e=(0,f.decodeCfxAddress)(t),r="0x"+e.hexAddress.toString("hex");return d!==e.netId&&(0,l.debug)("Expected netId=".concat(d,", got netId=").concat(e.netId,"."),"You might want to select ".concat(d," in Conflux Portal.")),r}(t)},unmunge:function(t){return e.T_Address.canonicalize(t)}})},2888:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e},s=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},a=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},u=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.validQueryWindow=e.atomicUnit=e.standardUnit=e._warnTxNoBlockNumber=e.providerLib=e.ethers=e.ethLikeCompiled=e.setProvider=e._specialFundFromFaucet=e.canFundFromFaucet=e._getDefaultFaucetNetworkAccount=e._getDefaultNetworkAccount=e.canGetDefaultAccount=e.isWindowProvider=e.isIsolatedNetwork=void 0;var f=o(r(8690));e.ethers=f;var l=o(r(7734));e.ethLikeCompiled=l;var h=r(3653),d=r(135),p=r(2130),m=c(r(799)),g=c(r(4628)),b=c(r(138)),y=r(6529),v=c(r(2486)).default.Buffer,w=g.default.Conflux;function _(t){throw Error("".concat(t," not yet supported on CFX"))}var A="http://localhost:12537";e.isIsolatedNetwork=function(){return(0,h.truthyEnv)(R().REACH_ISOLATED_NETWORK)},e.isWindowProvider=function(){return!!p.window.conflux},e.canGetDefaultAccount=function(){return!0},e._getDefaultNetworkAccount=function(){return s(this,void 0,void 0,(function(){var t,e,r,n,i,o,s,u;return a(this,(function(a){switch(a.label){case 0:return[4,U()];case 1:return(t=a.sent())._rwfb?(r=t._rwfb(),[3,4]):[3,2];case 2:return i=(n=f.BrowserWallet).bind,o=[void 0,t],[4,t.enable()];case 3:r=new(i.apply(n,o.concat([a.sent()[0]]))),a.label=4;case 4:return(e=r).provider?[2,e]:[3,5];case 5:return u=(s=e).connect,[4,k()];case 6:return[2,u.apply(s,[a.sent()])]}}))}))};var E=new f.Wallet("0x091ca0785ec2bd9a5eca245fdc83baddd570644f3e0489b41e515f0e5c33f3d9");e._getDefaultFaucetNetworkAccount=(0,h.memoizeThunk)((function(){return s(void 0,void 0,void 0,(function(){var t;return a(this,(function(e){switch(e.label){case 0:return E.provider?[3,2]:[4,k()];case 1:t=e.sent(),E.provider||E.connect(t),e.label=2;case 2:return[2,E]}}))}))}));var S=function(t){return function(e,r){return s(void 0,void 0,void 0,(function(){var n,i,o,s,u,c;return a(this,(function(a){switch(a.label){case 0:return n="doURLFunder",e.getAddress?[4,e.getAddress()]:[3,2];case 1:return i=a.sent(),[3,3];case 2:i=e,a.label=3;case 3:return e=i,(0,h.debug)(n,e),f=e,o="0x"+v.from(g.default.address.decodeCfxAddress(f).hexAddress).toString("hex").toLowerCase(),s="".concat(t,"?address=").concat(o),r&&(s="".concat(s,"&amount=").concat((0,d.bigNumberify)(r))),(0,h.debug)(n,{toHex:o,u:s}),[4,p.window.fetch(s)];case 4:return[4,(u=a.sent()).json()];case 5:if(c=a.sent(),(0,h.debug)(n,{resJson:c}),!u.ok)throw c;return[2]}var f}))}))}};e.canFundFromFaucet=function(){return s(this,void 0,void 0,(function(){var t;return a(this,(function(e){return(0,h.debug)("canFundFromFaucet"),[2,1==(t=l.getNetworkId())||999==t]}))}))},e._specialFundFromFaucet=function(){return s(this,void 0,void 0,(function(){var t,e,r,n,i;return a(this,(function(o){return t=l.getNetworkId(),(0,h.debug)("_specialFundFromFaucet",{ni:t}),1==t?[2,S("http://test-faucet.confluxnetwork.org:18088/dev/ask")]:999==t?(e=R(),r="CFX_NODE_URI"in e?e.CFX_NODE_URI:A,(n=r.split(":")).pop(),i=n.join(":"),[2,S("".concat(i,":1337/faucet"))]):[2,null]}))}))};var M,x=u((0,h.replaceableThunk)((function(){return s(void 0,void 0,void 0,(function(){var t,e;return a(this,(function(r){switch(r.label){case 0:return[4,N(t=R())];case 1:return e=r.sent(),"CFX_NODE_URI"in t&&t.CFX_NODE_URI&&(0,h.truthyEnv)(t.REACH_DO_WAIT_PORT)?[4,(0,m.default)(t.CFX_NODE_URI)]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2,e]}}))}))})),2),k=x[0],T=x[1];function I(t){T(t),M||B({REACH_CONNECTOR_MODE:"CFX-unspecified",REACH_ISOLATED_NETWORK:"no"})}function C(t){var e=t.CFX_NODE_URI,r=t.CFX_NETWORK_ID,n=(0,h.envDefault)(t.REACH_CONNECTOR_MODE,function(t){return"CFX_NODE_URI"in t&&t.CFX_NODE_URI?t.CFX_NODE_URI.toLowerCase().includes("localhost")?"CFX-devnet":"CFX-live":void 0}(t)),i=(0,h.envDefault)(n,(0,y.canonicalizeConnectorMode)(t.REACH_CONNECTOR_MODE||"CFX")),o=function(t){return"CFX-devnet"===t?"yes":"no"}(i),s=(0,h.envDefault)(t.REACH_ISOLATED_NETWORK,o);if((0,h.truthyEnv)(e)){var a=(0,h.envDefault)(t.REACH_DO_WAIT_PORT,"yes");return{CFX_NODE_URI:e,CFX_NETWORK_ID:(0,h.envDefault)(r,P.CFX_NETWORK_ID),REACH_CONNECTOR_MODE:i,REACH_DO_WAIT_PORT:a,REACH_ISOLATED_NETWORK:s}}return p.window.conflux,P}function R(){if(!M){var t=C(p.process.env);M=t}return M}function B(t){if(M)throw Error("setProviderEnv called after it was already set");if(M=t,"CFX_NETWORK_ID"in t)try{var e=parseInt(t.CFX_NETWORK_ID);l.setNetworkId(e)}catch(e){throw Error("Invalid CFX_NETWORK_ID='".concat(t.CFX_NETWORK_ID,"'"))}}function N(t){return s(this,void 0,void 0,(function(){var e,r,n,i=this;return a(this,(function(o){if("CFX_NODE_URI"in t&&t.CFX_NODE_URI)return e=t.CFX_NODE_URI,r=t.CFX_NETWORK_ID,n=t.REACH_DO_WAIT_PORT,[2,s(i,void 0,void 0,(function(){var t;return a(this,(function(i){switch(i.label){case 0:return(0,h.truthyEnv)(n)?[4,(0,m.default)(e)]:[3,2];case 1:i.sent(),i.label=2;case 2:return t=r?parseInt(r):void 0,(0,h.debug)("waitProviderFromEnv","new Conflux",{url:e,networkId:t}),[2,new f.providers.Provider(new w({url:e,networkId:t}))]}}))}))];if(p.window.conflux)return[2,s(i,void 0,void 0,(function(){return a(this,(function(t){return[2,_("using window.conflux as provider.")]}))}))];throw Error("window.conflux is not defined")}))}))}function O(t){var e=C(t);B(e),I(N(e))}e.setProvider=I;var P={CFX_NODE_URI:A,CFX_NETWORK_ID:"999",REACH_CONNECTOR_MODE:"CFX-devnet",REACH_DO_WAIT_PORT:"yes",REACH_ISOLATED_NETWORK:"yes"};function D(t){switch(t){case"LocalHost":return P;case"window":return _("providerEnvByName('window')");case"MainNet":return D("tethys");case"TestNet":return L("TestNet");case"tethys":return L("tethys");case"BlockNumber":return L("BlockNumber");default:throw Error("Unrecognized provider name: ".concat(t))}}function L(t){var e=u("BlockNumber"==t?["http://52.53.235.44:12537","1"]:"TestNet"==t?["https://portal-test.confluxrpc.com","1"]:"tethys"==t?["https://portal-main.confluxrpc.com","1029"]:function(t){throw Error(t)}("network name not recognized: '".concat(t,"'")),2);return{CFX_NODE_URI:e[0],CFX_NETWORK_ID:e[1],REACH_DO_WAIT_PORT:"yes",REACH_CONNECTOR_MODE:"CFX-live",REACH_ISOLATED_NETWORK:"no"}}function U(){return s(this,void 0,void 0,(function(){var t,e;return a(this,(function(r){switch(r.label){case 0:t=10,e=1,r.label=1;case 1:return e<=t?p.window.conflux?[2,p.window.conflux]:[4,b.default.set(100)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:throw Error("Couldn't find window.conflux")}}))}))}e.providerLib={getProvider:k,setProvider:I,setProviderByName:function(t){O(D(t))},setProviderByEnv:O,providerEnvByName:D,setWalletFallback:function(t){p.window.conflux||(p.window.conflux=t())},walletFallback:function(t){return function(){var e={};if(null==t?void 0:t.providerEnv)throw Error("providerEnv not supported in this context");return e._rwfb=function(){var t=p.window.prompt("Please paste the mnemonic for your account, or enable ConfluxPortal and refresh the page.");return t?f.Wallet.fromMnemonic(t):f.Wallet.createRandom()},e}}},e._warnTxNoBlockNumber=!1,e.standardUnit="CFX",e.atomicUnit="Drip",e.validQueryWindow=990},8081:function(t,e,r){"use strict";var n=r(2486).Buffer,i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.address_cfxStandardize=e.defaultEpochTag=e.decodeCfxAddress=e.encodeCfxAddress=void 0;for(var u=a(r(9721)),c=r(3653),f="ABCDEFGHJKMNPRSTUVWXYZ0123456789",l={},h=0;h<f.length;h++){var d=f.charAt(h);if(void 0!==l[d])throw new TypeError(d+" is ambiguous");l[d]=h}var p=u.default.BigInt(0),m=u.default.BigInt(1),g=u.default.BigInt(5),b=u.default.BigInt(35),y=u.default.BigInt(1),v=u.default.BigInt(2),w=u.default.BigInt(4),_=u.default.BigInt(8),A=u.default.BigInt(16),E=u.default.BigInt(34359738367),S=u.default.BigInt(656907472481),M=u.default.BigInt(522768456162),x=u.default.BigInt(0xf33e5fb3c4),k=u.default.BigInt(748107326120),T=u.default.BigInt(130178868336);function I(t,e,r,n){var o,s;void 0===n&&(n=!1);var a=(1<<r)-1,u=[],c=0,f=0;try{for(var l=i(t),h=l.next();!h.done;h=l.next()){var d=h.value;for(c+=e,f=f<<e|d;c>=r;)c-=r,u.push(f>>>c&a)}}catch(t){o={error:t}}finally{try{h&&!h.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}if(f=f<<r-c&a,c&&n)u.push(f);else{if(f&&!n)throw new Error("Excess padding");if(c>=e&&!n)throw new Error("Non-zero padding")}return u}function C(t){var e,r,n=m;try{for(var o=i(t),s=o.next();!s.done;s=o.next()){var a=s.value,c=u.default.signedRightShift(n,b);n=u.default.bitwiseAnd(n,E),n=u.default.leftShift(n,g),n=a?u.default.bitwiseXor(n,u.default.BigInt(a)):n,u.default.notEqual(u.default.bitwiseAnd(c,y),p)&&(n=u.default.bitwiseXor(n,S)),u.default.notEqual(u.default.bitwiseAnd(c,v),p)&&(n=u.default.bitwiseXor(n,M)),u.default.notEqual(u.default.bitwiseAnd(c,w),p)&&(n=u.default.bitwiseXor(n,x)),u.default.notEqual(u.default.bitwiseAnd(c,_),p)&&(n=u.default.bitwiseXor(n,k)),u.default.notEqual(u.default.bitwiseAnd(c,A),p)&&(n=u.default.bitwiseXor(n,T))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return u.default.bitwiseXor(n,m)}var R=4294967295;function B(t){var e,r;if(t.length<1)throw new Error("Empty payload in address");switch(240&t[0]){case 16:return"user";case 128:return"contract";case 0:try{for(var n=i(t),o=n.next();!o.done;o=n.next())if(0!==o.value)return"builtin"}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return"null";default:throw new Error("hexAddress should start with 0x0, 0x1 or 0x8")}}e.encodeCfxAddress=function(t,e){var r=t instanceof n?t:n.from(t);if(r.length<20)throw new Error("hexAddress should be at least 20 bytes");var i=B(r).toUpperCase(),a=function(t){if(!Number.isInteger(t))throw new Error("netId should be passed as an integer");if(t<=0||t>R)throw new Error("netId should be passed as in range [1, 0xFFFFFFFF]");switch(t){case 1:return"cfxtest";case 1029:return"cfx";default:return"net".concat(t)}}(e).toUpperCase(),u=n.from(a).map((function(t){return 31&t})),c=I(s([0],o(r),!1),8,5,!0),l=C(s(s(s(s([],o(u),!1),[0],!1),o(c),!1),[0,0,0,0,0,0,0,0],!1)),h=I(s([],o(n.from(l.toString(16).padStart(10,"0"),"hex")),!1),8,5,!0),d=c.map((function(t){return f[t]})).join(""),p=h.map((function(t){return f[t]})).join("");return"".concat(a,":TYPE.").concat(i,":").concat(d).concat(p)},e.decodeCfxAddress=function(t){var e,r,a,u;(0,c.debug)("decode",{address:t});var f=t.toLowerCase(),h=t.toUpperCase();if(t!==f&&t!==h)throw new Error("Mixed-case address "+t);var d=t.toUpperCase().match(/^([^:]+):(.+:)?(.{34})(.{8})$/);if(!d)throw Error("Invalid address: ".concat(t));var p=o(d,5),m=p[1],g=p[2],b=p[3],y=p[4],v=s([],o(n.from(m)),!1).map((function(t){return 31&t})),w=[];try{for(var _=i(b),A=_.next();!A.done;A=_.next()){var E=A.value;w.push(l[E])}}catch(t){e={error:t}}finally{try{A&&!A.done&&(r=_.return)&&r.call(_)}finally{if(e)throw e.error}}var S=[];try{for(var M=i(y),x=M.next();!x.done;x=M.next())E=x.value,S.push(l[E])}catch(t){a={error:t}}finally{try{x&&!x.done&&(u=M.return)&&u.call(M)}finally{if(a)throw a.error}}var k=o(I(w,5,8)),T=k[0],N=k.slice(1);if(0!==T)throw new Error("Can not recognize version byte");var O=n.from(N),P=function(t){switch(t){case"cfxtest":return 1;case"cfx":return 1029;default:var e=t.slice(0,3),r=t.slice(3);if("net"!==e||!function(t){return/^([1-9]\d*)$/.test(t)&&Number(t)<=R}(r))throw new Error("netId prefix should be passed by 'cfx', 'cfxtest' or 'net[n]' ");if(1===Number(r)||1029===Number(r))throw new Error("net1 or net1029 are invalid");return Number(r)}}(m.toLowerCase()),D=B(O);if(g){var L="type.".concat(D,":"),U=g.toLowerCase();if(L!==U)throw new Error("Type of address doesn't match, got '".concat(L,"', expected '").concat(U,"'"))}var j=C(s(s(s(s([],o(v),!1),[0],!1),o(w),!1),o(S),!1));if(Number(j))throw new Error("Invalid checksum for ".concat(t));return{hexAddress:O,netId:P,type:D}},e.defaultEpochTag="latest_state",e.address_cfxStandardize=function(t){(0,c.debug)("address_cfxStandardize",{addrC:t});var e=t.split(":");if(3===e.length)t="".concat(e[0],":").concat(e[2]);else if(2!==e.length)throw Error("impossible: bad CFX addr: '".concat(t,"'"));return t.toUpperCase()}},6529:function(t,e,r){"use strict";var n,i,o,s,a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};e.__esModule=!0,e.getConnector=e.getConnectorMode=e.canonicalizeConnectorMode=void 0;var u=r(2130),c=r(3653),f={};try{for(var l=a(["ETH-devnet","ETH-live","ETH-browser","ALGO-devnet","ALGO-live","ALGO-browser","CFX-devnet","CFX-live","CFX-browser"]),h=l.next();!h.done;h=l.next()){var d=h.value,p=null;try{for(var m=(o=void 0,a(d.split("-"))),g=m.next();!g.done;g=m.next()){var b=g.value;p=p?"".concat(p,"-").concat(b):b,f[p]||(f[p]=d)}}catch(t){o={error:t}}finally{try{g&&!g.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}function y(t){var e=f[t];if(e)return e;throw Error("Unrecognized REACH_CONNECTOR_MODE='".concat(t,"'"))}function v(){return y((0,c.envDefault)(u.process.env.REACH_CONNECTOR_MODE,"ETH"))}e.canonicalizeConnectorMode=y,e.getConnectorMode=v,e.getConnector=function(t){var e,r=(t=t||v()).split("-")[0];if("ETH"===(e=r)||"ALGO"===e||"CFX"===e)return r;throw Error("impossible: unknown connector: ".concat(r))}},198:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e},s=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};e.__esModule=!0,e.setCustomHttpEventHandler=e.setMinMillisBetweenRequests=e.reachStdlib=e.launchToken=e.unsafeGetMnemonic=e.formatWithDecimals=e.formatAddress=e.formatCurrency=e.minimumBalance=e.parseCurrency=e.atomicUnit=e.standardUnit=e.verifyContract=e.waitUntilSecs=e.getTimeSecs=e.getNetworkSecs=e.wait=e.waitUntilTime=e.getNetworkTime=e.newTestAccounts=e.newTestAccount=e.fundFromFaucet=e.canFundFromFaucet=e.createAccount=e.setFaucet=e.getFaucet=e.getDefaultAccount=e.newAccountFromMnemonic=e.newAccountFromSecret=e.connectAccount=e.transfer=e.minimumBalanceOf=e.balancesOf=e.balanceOf=e.walletFallback=e.setWalletFallback=e.providerEnvByName=e.setProviderByName=e.setProviderByEnv=e.hasRandom=e.randomUInt=e.setProvider=e.getProvider=e.setValidQueryWindow=e.getValidQueryWindow=e.setQueryLowerBound=e.getQueryLowerBound=e.doCall=e.ethers=e.connector=void 0,e.btoiLast8=e.bytes_xor=e.digest_xor=e.digestEq=e.bytesEq=e.Array_set=e.assert=e.protect=e.muldiv=e.cast=e.sqrt256=e.sqrt=e.lt256=e.le256=e.gt256=e.ge256=e.eq256=e.bxor256=e.bior256=e.band256=e.div256=e.mul256=e.mod256=e.sub256=e.add256=e.lt=e.le=e.gt=e.ge=e.eq=e.bxor=e.bior=e.band=e.div=e.mul=e.mod=e.sub=e.add=e.setSigningMonitor=void 0;var a=r(3955),u=o(r(1274));s(r(1331),e),e.connector="ETH",e.ethers=o(r(3825));var c=(0,a.makeEthLike)(u);e.doCall=c.doCall,e.getQueryLowerBound=c.getQueryLowerBound,e.setQueryLowerBound=c.setQueryLowerBound,e.getValidQueryWindow=c.getValidQueryWindow,e.setValidQueryWindow=c.setValidQueryWindow,e.getProvider=c.getProvider,e.setProvider=c.setProvider,e.randomUInt=c.randomUInt,e.hasRandom=c.hasRandom,e.setProviderByEnv=c.setProviderByEnv,e.setProviderByName=c.setProviderByName,e.providerEnvByName=c.providerEnvByName,e.setWalletFallback=c.setWalletFallback,e.walletFallback=c.walletFallback,e.balanceOf=c.balanceOf,e.balancesOf=c.balancesOf,e.minimumBalanceOf=c.minimumBalanceOf,e.transfer=c.transfer,e.connectAccount=c.connectAccount,e.newAccountFromSecret=c.newAccountFromSecret,e.newAccountFromMnemonic=c.newAccountFromMnemonic,e.getDefaultAccount=c.getDefaultAccount,e.getFaucet=c.getFaucet,e.setFaucet=c.setFaucet,e.createAccount=c.createAccount,e.canFundFromFaucet=c.canFundFromFaucet,e.fundFromFaucet=c.fundFromFaucet,e.newTestAccount=c.newTestAccount,e.newTestAccounts=c.newTestAccounts,e.getNetworkTime=c.getNetworkTime,e.waitUntilTime=c.waitUntilTime,e.wait=c.wait,e.getNetworkSecs=c.getNetworkSecs,e.getTimeSecs=c.getTimeSecs,e.waitUntilSecs=c.waitUntilSecs,e.verifyContract=c.verifyContract,e.standardUnit=c.standardUnit,e.atomicUnit=c.atomicUnit,e.parseCurrency=c.parseCurrency,e.minimumBalance=c.minimumBalance,e.formatCurrency=c.formatCurrency,e.formatAddress=c.formatAddress,e.formatWithDecimals=c.formatWithDecimals,e.unsafeGetMnemonic=c.unsafeGetMnemonic,e.launchToken=c.launchToken,e.reachStdlib=c.reachStdlib,e.setMinMillisBetweenRequests=c.setMinMillisBetweenRequests,e.setCustomHttpEventHandler=c.setCustomHttpEventHandler,e.setSigningMonitor=c.setSigningMonitor,e.add=e.reachStdlib.add,e.sub=e.reachStdlib.sub,e.mod=e.reachStdlib.mod,e.mul=e.reachStdlib.mul,e.div=e.reachStdlib.div,e.band=e.reachStdlib.band,e.bior=e.reachStdlib.bior,e.bxor=e.reachStdlib.bxor,e.eq=e.reachStdlib.eq,e.ge=e.reachStdlib.ge,e.gt=e.reachStdlib.gt,e.le=e.reachStdlib.le,e.lt=e.reachStdlib.lt,e.add256=e.reachStdlib.add256,e.sub256=e.reachStdlib.sub256,e.mod256=e.reachStdlib.mod256,e.mul256=e.reachStdlib.mul256,e.div256=e.reachStdlib.div256,e.band256=e.reachStdlib.band256,e.bior256=e.reachStdlib.bior256,e.bxor256=e.reachStdlib.bxor256,e.eq256=e.reachStdlib.eq256,e.ge256=e.reachStdlib.ge256,e.gt256=e.reachStdlib.gt256,e.le256=e.reachStdlib.le256,e.lt256=e.reachStdlib.lt256,e.sqrt=e.reachStdlib.sqrt,e.sqrt256=e.reachStdlib.sqrt256,e.cast=e.reachStdlib.cast,e.muldiv=e.reachStdlib.muldiv,e.protect=e.reachStdlib.protect,e.assert=e.reachStdlib.assert,e.Array_set=e.reachStdlib.Array_set,e.bytesEq=e.reachStdlib.bytesEq,e.digestEq=e.reachStdlib.digestEq,e.digest_xor=e.reachStdlib.digest_xor,e.bytes_xor=e.reachStdlib.bytes_xor,e.btoiLast8=e.reachStdlib.btoiLast8,s(r(135),e)},1331:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e};e.__esModule=!0,e.tokenEq=e.addressEq=e.digest=e.UInt_max=e.T_Struct=e.T_Tuple=e.T_Array=e.T_Data=e.T_Object=e.T_Token=e.T_Digest=e.T_Contract=e.T_Address=e.T_Bytes=e.T_UInt256=e.T_UInt=e.T_Bool=e.T_Null=e.bxor256=e.bior256=e.band256=e.mod256=e.div256=e.mul256=e.sub256=e.add256=e.bxor=e.bior=e.band=e.mod=e.div=e.mul=e.sub=e.add=e.typeDefs=e.stdlib=void 0;var s=r(4980),a=o(r(638)),u=(0,s.makeEthLikeCompiled)(a);e.stdlib=u.stdlib,e.typeDefs=u.typeDefs,e.add=e.stdlib.add,e.sub=e.stdlib.sub,e.mul=e.stdlib.mul,e.div=e.stdlib.div,e.mod=e.stdlib.mod,e.band=e.stdlib.band,e.bior=e.stdlib.bior,e.bxor=e.stdlib.bxor,e.add256=e.stdlib.add256,e.sub256=e.stdlib.sub256,e.mul256=e.stdlib.mul256,e.div256=e.stdlib.div256,e.mod256=e.stdlib.mod256,e.band256=e.stdlib.band256,e.bior256=e.stdlib.bior256,e.bxor256=e.stdlib.bxor256,e.T_Null=e.stdlib.T_Null,e.T_Bool=e.stdlib.T_Bool,e.T_UInt=e.stdlib.T_UInt,e.T_UInt256=e.stdlib.T_UInt256,e.T_Bytes=e.stdlib.T_Bytes,e.T_Address=e.stdlib.T_Address,e.T_Contract=e.stdlib.T_Contract,e.T_Digest=e.stdlib.T_Digest,e.T_Token=e.stdlib.T_Token,e.T_Object=e.stdlib.T_Object,e.T_Data=e.stdlib.T_Data,e.T_Array=e.stdlib.T_Array,e.T_Tuple=e.stdlib.T_Tuple,e.T_Struct=e.stdlib.T_Struct,e.UInt_max=e.stdlib.UInt_max,e.digest=e.stdlib.digest,e.addressEq=e.stdlib.addressEq,e.tokenEq=e.stdlib.tokenEq},638:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(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)&&i(e,t,r);return o(e,t),e};e.__esModule=!0,e.T_Address=void 0;var a=s(r(1923));e.T_Address=n(n({},a.BT_Address),{canonicalize:function(t){var e=function(t){if("string"==typeof t)return"0x"!==t.slice(0,2)?"0x"+t:t;if(t.networkAccount&&t.networkAccount.address)return t.networkAccount.address;if(t.address)return t.address;throw Error("Failed to unwrap address ".concat(t))}(t);return a.BT_Address.canonicalize(e||t)},defaultValue:"0x"+Array(40).fill("0").join(""),munge:function(t){return t},unmunge:function(t){return e.T_Address.canonicalize(t)},paramType:"address"})},1274:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(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)&&i(e,t,r);return o(e,t),e},a=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},u=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},c=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},f=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.validQueryWindow=e.atomicUnit=e.standardUnit=e.providerLib=e.ethers=e.setProvider=e.getProvider=e.canGetDefaultAccount=e.isWindowProvider=e.isIsolatedNetwork=e.setProviderByName=e.canFundFromFaucet=e._getDefaultFaucetNetworkAccount=e._getDefaultNetworkAccount=e.ethLikeCompiled=void 0;var l=r(3825);e.ethers=l.ethers;var h=f(r(5359)),d=f(r(5237)),p=r(6529),m=s(r(1331));e.ethLikeCompiled=m;var g=r(3653),b=r(2130),y=f(r(799));function v(){return a(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return(0,g.debug)("_getDefaultAccount"),[4,P()];case 1:return[2,(t=e.sent())._rwfb?t._rwfb():t.getSigner()]}}))}))}e._getDefaultNetworkAccount=v,e._getDefaultFaucetNetworkAccount=function(){return a(this,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return B()?[2,new l.ethers.providers.JsonRpcProvider("http://localhost:8545").getSigner()]:[4,v()];case 1:return[2,t.sent()]}}))}))},e.canFundFromFaucet=function(){return a(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return[4,P()];case 1:return t=e.sent(),(0,g.debug)("ETH:canFundFromFaucet"),[2,t._network&&1337===t._network.chainId]}}))}))};var w=500;function _(t){if("ETH_NODE_URI"in t&&t.ETH_NODE_URI){var e=t.ETH_NODE_URI,r=t.REACH_DO_WAIT_PORT;return a(this,void 0,void 0,(function(){var t;return u(this,(function(n){switch(n.label){case 0:return(0,g.truthyEnv)(r)?[4,(0,y.default)(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[4,U(e)];case 3:return n.sent(),(t=new l.ethers.providers.JsonRpcProvider(e)).pollingInterval=w,[2,t]}}))}))}if("ETH_NET"in t&&t.ETH_NET){var n=t.ETH_NET;if("homestead"===n||"ropsten"===n){var i=l.ethers.getDefaultProvider(n);return i.pollingInterval=w,Promise.resolve(i)}if("window"===n){var o=b.window.ethereum;if(o)return a(this,void 0,void 0,(function(){var t;return u(this,(function(e){switch(e.label){case 0:return(t=o._rwfb?o:new l.ethers.providers.Web3Provider(o)).pollingInterval=w,[4,t.send("eth_requestAccounts",[])];case 1:return e.sent(),[2,t]}}))}));throw Error("window.ethereum is not defined")}throw Error("ETH_NET not recognized: '".concat(n,"'"))}throw Error("non-empty ETH_NET or ETH_NODE_URI is required, got: ".concat(Object.keys(t)))}function A(t){var e=N(t);C(e),L(_(e))}function E(t){A(T(t))}e.setProviderByName=E;var S,M={ETH_NODE_URI:"http://localhost:8545",REACH_CONNECTOR_MODE:"ETH-devnet",REACH_DO_WAIT_PORT:"yes",REACH_ISOLATED_NETWORK:"yes"};function x(t){return void 0===t&&(t="no"),{ETH_NET:"window",REACH_CONNECTOR_MODE:"ETH-browser",REACH_ISOLATED_NETWORK:t}}function k(t){return{ETH_NET:t,REACH_CONNECTOR_MODE:"ETH-live",REACH_ISOLATED_NETWORK:"no"}}function T(t){switch(t){case"LocalHost":return M;case"window":return x();case"MainNet":return T("homestead");case"TestNet":return T("ropsten");case"homestead":return k("homestead");case"ropsten":return k("ropsten");default:throw Error("Unrecognized provider name: ".concat(t))}}function I(){if(!S){var t=N(b.process.env);S=t}return S}function C(t){if(S)throw Error("setProviderEnv called after it was already set");S=t}function R(){return(0,g.truthyEnv)(I().REACH_ISOLATED_NETWORK)}function B(){var t=I();return"ETH_NET"in t&&"window"===t.ETH_NET&&!!b.window.ethereum}function N(t){var e=t.ETH_NET,r=t.ETH_NODE_URI,n=(0,g.envDefaultNoEmpty)(t.REACH_CONNECTOR_MODE,function(t){return"ETH_NODE_URI"in t&&t.ETH_NODE_URI?t.ETH_NODE_URI.toLowerCase().includes("localhost")?"ETH-devnet":"ETH-live":void 0}(t)),i=(0,g.envDefaultNoEmpty)(n,(0,p.canonicalizeConnectorMode)(t.REACH_CONNECTOR_MODE||"ETH")),o=e&&"window"!==e?"no":"window"===e||b.window.ethereum?!b.window.ethereum||"0xNaN"!==b.window.ethereum.chainId&&"0x539"!=b.window.ethereum.chainId?"no":"yes":"ETH-devnet"===i?"yes":"no",s=(0,g.envDefaultNoEmpty)(t.REACH_ISOLATED_NETWORK,o);return(0,g.truthyEnv)(e)?{ETH_NET:e,REACH_CONNECTOR_MODE:i,REACH_ISOLATED_NETWORK:s}:(0,g.truthyEnv)(r)?{ETH_NODE_URI:r,REACH_CONNECTOR_MODE:i,REACH_DO_WAIT_PORT:(0,g.envDefaultNoEmpty)(t.REACH_DO_WAIT_PORT,"yes"),REACH_ISOLATED_NETWORK:s}:b.window.ethereum?x(s):M}e.isIsolatedNetwork=R,e.isWindowProvider=B,e.canGetDefaultAccount=function(){return B()||R()};var O=c((0,g.replaceableThunk)((function(){return a(void 0,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:return[4,_(I())];case 1:return[2,t.sent()]}}))}))})),2),P=O[0],D=O[1];function L(t){D(Promise.resolve(t)),S||C({ETH_NET:"__custom_unspecified__",REACH_CONNECTOR_MODE:"ETH-unspecified",REACH_ISOLATED_NETWORK:"no"})}e.getProvider=P,e.setProvider=L;var U=function(t){return a(void 0,void 0,void 0,(function(){var e;return u(this,(function(r){switch(r.label){case 0:return(0,g.debug)("doHealthcheck"),(e=h.default&&h.default.parse&&h.default.parse(t))&&"http:"===e.protocol?[4,new Promise((function(t,r){var i=JSON.stringify({jsonrpc:"2.0",method:"web3_clientVersion",params:[],id:67});(0,g.debug)("Sending health check request...");var o=n(n({},e),{method:"POST",headers:{"Content-Type":"application/json","Content-Length":i.length}}),s=d.default.request(o,(function(e){(0,g.debug)("statusCode:",e.statusCode),e.on("data",(function(r){(0,g.debug)("rpc health check succeeded"),(0,g.getDEBUG)()&&b.process.stdout.write(r),t({res:e,d:r})}))}));s.on("error",(function(t){console.log("rpc health check failed"),console.log(t),r(t)})),s.write(i),(0,g.debug)("attached all the handlers..."),s.end(),(0,g.debug)("req.end...")}))]:[2];case 1:return r.sent(),[2]}}))}))};e.providerLib={getProvider:P,setProvider:L,setProviderByName:E,setProviderByEnv:A,providerEnvByName:T,setWalletFallback:function(t){b.window.ethereum||(b.window.ethereum=t())},walletFallback:function(t){return function(){var e=null==t?void 0:t.providerEnv,r="string"==typeof e?T(e):e||T("LocalHost"),n=function(t){var e;if("ETH_NODE_URI"in t&&t.ETH_NODE_URI)e=new l.ethers.providers.JsonRpcProvider(t.ETH_NODE_URI);else{if(!("ETH_NET"in t)||!t.ETH_NET)throw Error("_providerFromEnv: invalid env");var r=t.ETH_NET;if("homestead"!==r&&"ropsten"!==r)throw Error("ETH_NET not recognized: '".concat(r,"'"));e=l.ethers.getDefaultProvider(r)}return e.pollingInterval=w,e}(r);return D(Promise.resolve(n)),C({ETH_NET:"window",REACH_CONNECTOR_MODE:r.REACH_CONNECTOR_MODE||"ETH-browser",REACH_ISOLATED_NETWORK:r.REACH_ISOLATED_NETWORK||"no"}),n._rwfb=function(){var t=b.window.prompt("Please paste the mnemonic for your account, or enable MetaMask and refresh the page.");return(t?l.ethers.Wallet.fromMnemonic(t):l.ethers.Wallet.createRandom()).connect(n)},n}}},e.standardUnit="ETH",e.atomicUnit="WEI",e.validQueryWindow=!0},3955:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},o=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},s=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.makeEthLike=e.getQueryLowerBound=e.setQueryLowerBound=void 0;var f=c(r(138)),l=r(3825),h=r(6549),d=r(3653),p=r(135),m=c(r(8922)),g=r(3653);e.setQueryLowerBound=g.setQueryLowerBound,e.getQueryLowerBound=g.getQueryLowerBound;var b=function(t){return"_reach_e".concat(t)};e.makeEthLike=function(t){var e=this,r=t.ethLikeCompiled,c=t.ethers,y=t.standardDigits,v=void 0===y?18:y,w=t.providerLib,_=t.isIsolatedNetwork,A=t.canGetDefaultAccount,E=t._getDefaultNetworkAccount,S=t._getDefaultFaucetNetworkAccount,M=t._specialFundFromFaucet,x=void 0===M?function(){return i(e,void 0,void 0,(function(){return o(this,(function(t){return[2,null]}))}))}:M,k=t.canFundFromFaucet,T=t.standardUnit,I=t.atomicUnit,C=t.validQueryWindow,R=s((0,d.replaceableThunk)((function(){return C})),2),B=R[0],N=R[1],O=w.getProvider,P=r.stdlib,D=P.T_Address,L=P.T_Tuple,U=P.T_UInt,j=P.T_Contract,F=P.addressEq,q=P,z=function(t){return i(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:if("string"==typeof t)return[2,t];if(!t.networkAccount)throw Error("Expected acc.networkAccount");return t.networkAccount.address?[2,t.networkAccount.address]:t.networkAccount.getAddress?[4,t.networkAccount.getAddress()]:[3,2];case 1:return[2,e.sent()];case 2:throw Error("Expected acc.networkAccount.address or acc.networkAccount.getAddress")}}))}))},H=function(){return i(e,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,O()];case 1:return[4,t.sent().getBlockNumber()];case 2:return[2,t.sent()]}}))}))},K=function(t){return(0,p.bigNumberify)(t.blockNumber)},G=function(){return(0,d.makeEventQueue)({raw2proc:function(t){return t},alwaysIgnored:function(t){return!1},getTxns:function(t,r,n,s){return i(e,void 0,void 0,(function(){var e,i,a,u,c,l,h,m,g,b,y,v,w,_;return o(this,(function(o){switch(o.label){case 0:return e="".concat(t," getTxns"),i=r.ctcAddress,a=r.creationBlock,u=n.eq(0)?a:n.add(1),c=B(),(0,d.debug)(e,{address:i,fromBlock:u,qw:c,howMany:s}),s>0?[4,f.default.set(1e3)]:[3,2];case 1:o.sent(),o.label=2;case 2:return[4,vt()];case 3:return l=o.sent(),!0!==c&&(A=l,E=u.add(c),l=A.lt(E)?A:E),h=function(t,e){return t.lt(e)?e:t}(u,l),[4,O()];case 4:m=o.sent(),(0,d.debug)(e,{toBlock:l,toBlock_act:h}),g=[],o.label=5;case 5:return o.trys.push([5,7,,8]),[4,m.getLogs({fromBlock:(0,p.bigNumberToNumber)(u),toBlock:(0,p.bigNumberToNumber)(h),address:i})];case 6:return g=o.sent(),[3,8];case 7:if(b=o.sent(),y="".concat(b),(0,d.debug)(e,"err",b,y),!y.includes("Unable to find block hash"))throw b;return(0,d.debug)(e,"ignore"),l=void 0,[3,8];case 8:return(0,d.debug)(e,{logs:g}),v={},g.forEach((function(t){v[t.transactionHash]=!0})),w=Object.keys(v),(0,d.debug)(e,{txn_hs:w}),[4,Promise.all(w.map((function(t){return m.waitForTransaction(t)})))];case 9:return _=o.sent(),(0,d.debug)(e,{txns:_}),[2,{txns:_,gtime:l}]}var A,E}))}))},getTxnTime:K})},W=function(t,e,r,n){(0,d.debug)("makeLogRep",{evt:r,tys:n});var i=function(i){var o=i.address,s=t();if((0,d.debug)("parse",{evt:r,log:i,ctcAddress:s,address:o}),F(o,s)){var a=e.parseLog(i),u=a.name,c=a.args;if((0,d.debug)("parse",{name:u,args:c}),u===r){if(void 0===n)return c;var f=n.map((function(t,e){return t.unmunge(c[e])}));return(0,d.debug)("parse",{unargs:f}),f}}},o=function(t){var e,r;try{for(var n=a(t.logs),o=n.next();!o.done;o=n.next()){var s=o.value,u=i(s);if((0,d.debug)("parseA",{l:s,p:u}),u)return u}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}};return{parse:i,parseA:o,parseAb:function(t){return void 0!==o(t)}}},V=function(t,e,r,n){return(0,d.debug)("hasLogFor",r,n),W(t,e,b(r),[D,L([U,L(n)])])},$=function(t,e,r,n){return V(t,e,r,n).parseAb},X=(0,d.makeRandom)(32),Y=X.randomUInt,J=X.hasRandom,Z=function(t,r){return i(e,void 0,void 0,(function(){return o(this,(function(e){return[2,Promise.all(r.map((function(e){return Q(t,null!=e&&e)})))]}))}))},Q=function(t,r){return void 0===r&&(r=!1),i(e,void 0,void 0,(function(){var e;return o(this,(function(n){if(!(e="string"==typeof t?t:t.networkAccount))throw Error("Cannot get the address of: ".concat(t));return[2,tt(e,r)]}))}))},tt=function(t,r){return void 0===r&&(r=!1),i(e,void 0,void 0,(function(){var e,n,i,s,a,u,c;return o(this,(function(o){switch(o.label){case 0:return(e="string"==typeof t)?(i=t,[3,3]):[3,1];case 1:return[4,z({networkAccount:t})];case 2:i=o.sent(),o.label=3;case 3:if(!(n=i))throw Error("balanceOfNetworkAccount: address missing on ".concat(t));return r||e||!t.getBalance?[3,5]:(s=p.bigNumberify,[4,t.getBalance()]);case 4:return[2,s.apply(void 0,[o.sent()])];case 5:return r?[3,8]:[4,O()];case 6:return a=o.sent(),u=p.bigNumberify,[4,a.getBalance(n)];case 7:return[2,u.apply(void 0,[o.sent()])];case 8:return e?[3,9]:(c=t,[3,11]);case 9:return[4,pt()];case 10:c=o.sent(),o.label=11;case 11:return[4,nt(c,n,r)];case 12:return[2,o.sent()]}}))}))},et=m.default.contracts["sol/stdlib.sol:ReachToken"].abi,rt=m.default.contracts["sol/stdlib.sol:IERC20"].abi,nt=function(t,r,n){return i(e,void 0,void 0,(function(){var e,i;return o(this,(function(o){switch(o.label){case 0:return e=new c.Contract(n,rt,t),i=p.bigNumberify,[4,e.balanceOf(r)];case 1:return[2,i.apply(void 0,[o.sent()])]}}))}))},it=s((0,d.makeSigningMonitor)(),2),ot=it[0],st=it[1],at=function(t,r){return i(e,void 0,void 0,(function(){var n,a,u,c,f;return o(this,(function(l){switch(l.label){case 0:return(0,d.debug)(t,{step:"pre call"}),[4,st(t,r)];case 1:return n=s.apply(void 0,[l.sent(),2]),a=n[0],u=n[1],(0,d.debug)(t,{rt:a,step:"pre wait"}),[4,u(a.wait())];case 2:return c=l.sent(),(0,d.debug)(t,{rt:a,rm:c,step:"pre receipt"}),(0,h.assert)(null!==c,"receipt wait null"),[4,(p=c.transactionHash,i(e,void 0,void 0,(function(){var t,e;return o(this,(function(r){switch(r.label){case 0:return[4,O()];case 1:return[4,r.sent().getTransactionReceipt(p)];case 2:return t=r.sent(),e=function(t){throw Error(t)},t||e("No receipt for txHash: ".concat(p)),t.transactionHash!==p&&e("Bad txHash; ".concat(p," !== ").concat(t.transactionHash)),t.status||e("Transaction: ".concat(p," was reverted by EVM\n").concat(t)),[2,t]}}))})))];case 3:return f=l.sent(),(0,d.debug)(t,{rt:a,rm:c,ro:f,step:"post receipt"}),[2,f]}var p}))}))},ut=function(t,r,a,c,f,l,h){return i(e,void 0,void 0,(function(){var e,i;return o(this,(function(o){switch(o.label){case 0:return e="".concat(t," call ").concat(a),(0,d.debug)(e,{args:c,value:f,step:"pre call"}),i={value:f,gasLimit:l},void 0!==h&&(i=n(n({},i),{storageLimit:h})),[4,at(e,r[a].apply(r,u(u([],s(c),!1),[i],!1)))];case 1:return[2,o.sent()]}}))}))},ct=function(t,r,n,s){return void 0===s&&(s=!1),i(e,void 0,void 0,(function(){var e,i,a,u,f,l,h,m,g;return o(this,(function(o){switch(o.label){case 0:return e=t.networkAccount,"string"!=typeof r?[3,1]:(a=r,[3,3]);case 1:return[4,z(r)];case 2:a=o.sent(),o.label=3;case 3:return i=a,u=(0,p.bigNumberify)(n),f="transfer",s?[3,5]:(l={to:i,value:u},(0,d.debug)("sender.sendTransaction(",l,")"),[4,at(f,e.sendTransaction(l))]);case 4:return[2,o.sent()];case 5:return h=new c.Contract(s,rt,e),m=t.getGasLimit?t.getGasLimit():void 0,g=t.getStorageLimit?t.getStorageLimit():void 0,[4,ut(f,h,"transfer",[i,u],xt,m,g)];case 6:return[2,o.sent()]}}))}))},ft=function(t){return i(e,void 0,void 0,(function(){function e(t){return g=t,(0,d.debug)("setDebugLabel",{newLabel:t,address:f}),this}var r,f,m,g,b,y,v,w,A,E,S,M,x,k,T=this;return o(this,(function(I){switch(I.label){case 0:return!t.getAddress||t.address?[3,2]:(r=t,[4,z({networkAccount:t})]);case 1:r.address=I.sent(),I.label=2;case 2:return[4,z({networkAccount:t})];case 3:if(!(f=I.sent()))throw Error("Expected networkAccount.address: ".concat(t));return m=f.substring(2,6),g=m,b=function(t){if(F(t,f))return f;throw Error("I should be ".concat(t,", but am ").concat(f))},A=function(e,r){(0,d.ensureConnectorAvailable)(e,"ETH",16,7);var m=JSON.parse(e._Connectors.ETH.ABI),A=new l.ethers.utils.Interface(m),E=function(r,n){var s=r.getInfo,a=null;return function(){return i(T,void 0,void 0,(function(){var u,f,l,h=this;return o(this,(function(p){switch(p.label){case 0:return a?[2,a]:[4,s()];case 1:return u=p.sent(),[4,(0,d.stdVerifyContract)(r,(function(){return i(h,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,Mt(u,e,n,g)];case 1:return[2,t.sent()]}}))}))}))];case 2:return f=p.sent().creationBlock,l=u,n.isInited()||n.init({ctcAddress:l,creationBlock:f}),(0,d.debug)(g,"contract verified"),[2,a=new c.Contract(l,m,t)]}}))}))}},S=(0,d.stdGetABI)(m);return(0,d.stdContract)({bin:e,getABI:S,waitUntilTime:Et,waitUntilSecs:St,selfAddress:y,iam:b,stdlib:P,setupView:function(t){var r=G(),n=E(t,r),a={viewMapRef:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i(T,void 0,void 0,(function(){return o(this,(function(t){throw Error("viewMapRef not used by ETH backend")}))}))}},c=e._Connectors.ETH.views;return{getView1:function(t,e,r,a,f){return void 0===f&&(f=!0),function(){for(var t=[],l=0;l<arguments.length;l++)t[l]=arguments[l];return i(T,void 0,void 0,(function(){var i,l,h,p,m,b,y;return o(this,(function(o){switch(o.label){case 0:return i=a.ty,[4,n()];case 1:l=o.sent(),h=c[e],p="string"==typeof h?h:h[r],(0,d.debug)(g,"getView1",e,r,"args",t,p,i),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,l[p].apply(l,u([],s(t),!1))];case 3:return m=o.sent(),(0,d.debug)(g,"getView1",e,r,"val",m),b=i.unmunge(m),[2,f?["Some",b]:b];case 4:if(y=o.sent(),(0,d.debug)(g,"getView1",e,r,"error",y),f)return[2,["None",null]];throw Error("View ".concat(e,".").concat(r," is not set."));case 5:return[2]}}))}))}},viewLib:a}},setupEvents:function(t){return{createEventStream:function(e,r){var n=G(),s=E(t,n),a="",u=W((function(){return a}),A,e,r).parse;return(0,d.makeEventStream)({eq:n,getTxnTime:K,sync:function(){return i(T,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,s()];case 1:return t=e.sent(),a=t.address,[2]}}))}))},getNetworkTime:vt,getLogs:function(t){return t.logs},parseLog:u})}}},_setup:function(r){var u=r.setInfo,b=r.getInfo,y=r.setTrustedVerifyResult,S=G(),M=E(r,S),x=function(e,r,a,u){return i(T,void 0,void 0,(function(){var l,p,m,g,b,y,_,A=this;return o(this,(function(E){switch(E.label){case 0:return l=s(u,2),p=l[0],m=l[1],[4,M()];case 1:return g=E.sent(),b=function(){return i(A,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,ut("".concat(e," callC::reach"),g,r,[a],p,v,w)];case 1:return[2,t.sent()]}}))}))},y=function(r,s){return i(A,void 0,void 0,(function(){var i,a;return o(this,(function(o){switch(o.label){case 0:return[4,nt(t,f,r)];case 1:return i=o.sent(),(0,d.debug)(n(n({},e),{kind:"token"}),"balanceOf",i),(0,h.assert)(i.gte(s),"local account token balance is insufficient: ".concat(i," < ").concat(s)),a=new c.Contract(r,rt,t),[4,ut("".concat(e," callC::token"),a,"approve",[g.address,s],xt,v,w)];case 2:return o.sent(),[2]}}))}))},_=function(t){return i(A,void 0,void 0,(function(){var e,r,n,i;return o(this,(function(o){switch(o.label){case 0:return t<m.length?(e=s(m[t],2),r=e[0],n=e[1],r.gt(0)?[4,y(n,r)]:[3,7]):[3,10];case 1:o.sent(),o.label=2;case 2:return o.trys.push([2,4,,6]),[4,_(t+1)];case 3:return[2,o.sent()];case 4:return i=o.sent(),[4,y(n,xt)];case 5:throw o.sent(),i;case 6:return[3,9];case 7:return[4,_(t+1)];case 8:return[2,o.sent()];case 9:return[3,12];case 10:return[4,b()];case 11:return[2,o.sent()];case 12:return[2]}}))}))},[4,_(0)];case 2:return[2,E.sent()]}}))}))},k=l.ethers.utils.defaultAbiCoder,I=!1,C=function(t){return i(T,void 0,void 0,(function(){var e,r,n,i;return o(this,(function(o){switch(o.label){case 0:return t.eq(0)?[2,!0]:[4,M()];case 1:e=o.sent(),r=!0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,e._reachCurrentTime()];case 3:return n=o.sent(),r=t.eq(n),(0,d.debug)(g,"canIWin",{lct:t,val:n}),[3,5];case 4:return i=o.sent(),(0,d.debug)(g,"canIWin",{e:i}),[3,5];case 5:return(0,d.debug)(g,"canIWin",{ret:r}),[2,r]}}))}))},R=function(){return i(T,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,M()];case 1:return[4,t.sent()._reachCurrentState()];case 2:return[2,t.sent()]}}))}))},B=function(t){return i(T,void 0,void 0,(function(){var e,r,n,s,u,c,f,l,h,m,g,b,y,v,w=this;return o(this,(function(_){switch(_.label){case 0:return e=t.dhead,r=t.out_tys,n=t.didSend,s=t.funcNum,u=t.ok_r,(0,d.debug)(e,"OKR",u),(0,d.debug)(e,"OKR.L",u.logs),c=u.blockNumber,(0,d.debug)(e,"AT",c),[4,M()];case 1:if(f=_.sent(),!(h=V(l=function(){return f.address},A,s,r).parseA(u)))throw Error("no event log");return(0,d.debug)(e,"Event",h),m=h[0],g=h[1][1],(0,d.debug)(e,"OKAY",g),b=(0,p.bigNumberify)(c),(0,d.debug)(e,"from",{from:m}),[4,wt(b)];case 2:return y=_.sent(),v=function(t,r,n,s){return i(w,void 0,void 0,(function(){var t,i,s,c,f,h,p,m;return o(this,(function(o){t="_reach_oe_".concat(r),i=W(l,A,t,[n]);try{for(s=a(u.logs),c=s.next();!c.done;c=s.next())if(f=c.value,h=i.parse(f),(0,d.debug)(e,"getOutput",t,h),h)return[2,h[0]]}catch(t){p={error:t}}finally{try{c&&!c.done&&(m=s.return)&&m.call(s)}finally{if(p)throw p.error}}throw Error("no log for ".concat(t))}))}))},[2,{data:g,getOutput:v,from:m,didSend:n,didTimeout:!1,time:b,secs:y}]}}))}))},N=function(t){return i(T,void 0,void 0,(function(){var e,r,n,s,a,u,c,f,l,h,p,m,b=this;return o(this,(function(y){switch(y.label){case 0:return e=t.funcNum,r=t.out_tys,n=t.didSend,s=t.timeoutAt,a=t.waitIfNotPresent,u="m".concat(e),c="".concat(g,": recv ").concat(u," ").concat(s),(0,d.debug)(c,"start"),[4,M()];case 1:return f=y.sent(),l=function(t){return i(b,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:return e=t.add(1),(0,d.debug)(c,"TIMECHECK",{timeoutAt:s,cr_bn:t,crp:e}),[4,(0,d.checkTimeout)(_,wt,s,e)];case 1:return r=n.sent(),(0,d.debug)(c,"TIMECHECK",{r,waitIfNotPresent:a}),r||!a?[3,3]:[4,Et(e)];case 2:n.sent(),n.label=3;case 3:return[2,r]}}))}))},[4,S.peq(c,l)];case 2:return h=y.sent(),(0,d.debug)(c,"res",h),p=$((function(){return f.address}),A,e,r),!h.timeout&&p(h.txn)?[4,S.deq(c)]:[3,5];case 3:return y.sent(),m=h.txn,[4,B({dhead:c,out_tys:r,didSend:n,funcNum:e,ok_r:m})];case 4:return[2,y.sent()];case 5:if(s)return(0,d.debug)(c,"timeout"),[2,{didTimeout:!0}];throw Error("impossible: not good, but no timeout");case 6:return[2]}}))}))};return{getContractInfo:b,getContractAddress:b,getContractCompanion:function(){return i(T,void 0,void 0,(function(){return o(this,(function(t){return[2,["None",null]]}))}))},getBalance:function(e){return void 0===e&&(e=!1),tt(t,e)},getCurrentStep:function(){return i(T,void 0,void 0,(function(){var t,e;return o(this,(function(r){switch(r.label){case 0:return[4,R()];case 1:return t=s.apply(void 0,[r.sent(),2]),e=t[0],t[1],[2,e]}}))}))},sendrecv:function(r){return i(T,void 0,void 0,(function(){var n,a,f,l,h,b,E,k,T,R,O,P,D,j,F,q,z,K,G,W,V,X,Y,J,Z,Q,tt,et,rt,nt,it,ot,at,ut=this;return o(this,(function(ct){switch(ct.label){case 0:return n=r.funcNum,a=r.evt_cnt,f=r.lct,l=r.tys,h=r.args,b=r.pay,E=r.out_tys,k=r.onlyIf,T=r.soloSend,R=r.timeoutAt,O=function(t,e,r){return i(ut,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:if((0,d.debug)(D,"doRecv",r),!t&&f.eq(0))throw new Error("API call failed: ".concat(r));return[4,N({funcNum:n,evt_cnt:a,out_tys:E,didSend:t,waitIfNotPresent:e,timeoutAt:R})];case 1:return[2,i.sent()]}}))}))},k?[3,2]:[4,O(!1,!0,"onlyIf false")];case 1:return[2,ct.sent()];case 2:return P="_reach_m".concat(n),D="".concat(g," send ").concat(P," ").concat(R),j=function(t){return i(ut,void 0,void 0,(function(){var e,r,i;return o(this,(function(o){switch(o.label){case 0:return e=!0,I?[3,2]:[4,O(e,!1,"succeeded")];case 1:case 4:return[2,o.sent()];case 2:return[4,M()];case 3:return r=o.sent(),i=$((function(){return r.address}),A,n,E),S.pushIgnore(i),[4,B({dhead:D,out_tys:E,didSend:e,funcNum:n,ok_r:t})]}}))}))},(0,d.debug)(D,"ARGS",h),F=function(t,e,r,n){var i=s((0,d.argsSplit)(e,n),2),o=(i[0],i[1]),a=s((0,d.argsSplit)(r,n),2),u=(a[0],a[1]);return L([U,L(u)]).munge([t,o])}(f,h,l,a),(0,d.debug)(D,"START",F),0!=n?[3,6]:((0,d.debug)(D,"deploying"),q=e._Connectors.ETH.Bytecode,(0,d.debug)(g,"making contract factory"),z=new c.ContractFactory(m,q,t),(0,d.debug)(g,"deploying factory"),K=s(b,2),G=K[0],K[1],W={value:G,gasLimit:v},void 0!==w&&(W.storageLimit=w),[4,st("".concat(D," deploy"),z.deploy(F,W))]);case 3:return V=s.apply(void 0,[ct.sent(),2]),X=V[0],Y=V[1],(0,d.debug)(g,"waiting for receipt:",X.deployTransaction.hash),[4,Y(X.deployTransaction.wait())];case 4:return J=ct.sent(),Z=X.address,Q=(0,p.bigNumberify)(J.blockNumber),(0,d.debug)(g,"deployed",{ctcAddress:Z,creationBlock:Q}),S.init({ctcAddress:Z,creationBlock:Q}),y({creationBlock:Q}),u(Z),[4,j(J)];case 5:return[2,ct.sent()];case 6:return[4,M()];case 7:ct.sent(),ct.label=8;case 8:return(0,d.debug)(D,"TIMECHECK",{timeoutAt:R}),tt=d.checkTimeout,et=[_,wt,R],rt=p.bigNumberify,[4,H()];case 9:return[4,tt.apply(void 0,et.concat([rt.apply(void 0,[ct.sent()]).add(1)]))];case 10:return ct.sent()?((0,d.debug)(D,"FAIL/TIMEOUT"),[4,O(!1,!1,"timeout")]):[3,12];case 11:return[2,ct.sent()];case 12:return(nt=!T)?[4,C(f)]:[3,14];case 13:nt=!ct.sent(),ct.label=14;case 14:return nt?((0,d.debug)(D,"CANNOT WIN"),[4,O(!1,!1,"cannot win ".concat(f))]):[3,16];case 15:return[2,ct.sent()];case 16:it=void 0,ct.label=17;case 17:return ct.trys.push([17,19,,22]),(0,d.debug)(D,"ARG",F,b),[4,x(D,P,F,b)];case 18:return it=ct.sent(),[3,22];case 19:return ot=ct.sent(),(0,d.debug)(D,"ERROR",{stack:ot.stack},ot),at=(0,d.j2s)(ot),T?[3,21]:((0,d.debug)(D,"LOST"),[4,O(!1,!1,at)]);case 20:return[2,ct.sent()];case 21:if(R)return(0,d.debug)(D,"CONTINUE"),[3,8];throw Error("".concat(g," failed to call ").concat(P,": ").concat(at));case 22:return(0,d.debug)(D,"SUCC"),[4,j(it)];case 23:return[2,ct.sent()];case 24:return[2]}}))}))},recv:N,getState:function(t,r){return i(T,void 0,void 0,(function(){var n,i,a,u,c;return o(this,(function(o){switch(o.label){case 0:return I=!0,[4,R()];case 1:if(n=s.apply(void 0,[o.sent(),2]),i=n[0],a=n[1],(0,d.debug)("getState",{vibne:t,vibna:i,vsbs:a}),!t.eq(i))throw(0,d.apiStateMismatchError)(e,t,i);return u=L(r),c=function(t,e){var r=[g,"decodeEm"];(0,d.debug)(r,t,e);var n=s(k.decode([t.paramType],e),1)[0];(0,d.debug)(r,n);var i=t.unmunge(n);return(0,d.debug)(r,i),i}(u,a),(0,d.debug)("getState",c),[2,c]}}))}))},apiMapRef:function(t,e){return function(r){return i(T,void 0,void 0,(function(){var n,i,s,a,u;return o(this,(function(o){switch(o.label){case 0:return n=[g,"apiMapRef"],(0,d.debug)(n,{i:t,ty:e,f:r}),[4,M()];case 1:return i=o.sent(),s="_reachMap".concat(t,"Ref"),(0,d.debug)(n,s),[4,i[s](r)];case 2:return a=o.sent(),(0,d.debug)(n,{mfv:a}),u=e.unmunge(a),(0,d.debug)(n,u),[2,u]}}))}))}}}},givenInfoP:r})},E=function(e){return i(T,void 0,void 0,(function(){var r,n,s,a,u,f,l=this;return o(this,(function(h){switch(h.label){case 0:return r="tokenMetadata",(0,d.debug)(r,e),n=new c.Contract(e,et,t),s=function(t,e){return i(l,void 0,void 0,(function(){var i,s;return o(this,(function(o){switch(o.label){case 0:return(0,d.debug)(r,{m:e}),[4,n[e]()];case 1:return i=o.sent(),(0,d.debug)(r,{m:e,rv:i}),s=t?t.unmunge(i):i,(0,d.debug)(r,{m:e,v:s}),[2,s]}}))}))},f={},[4,s(U,"totalSupply")];case 1:return f.supply=h.sent(),a=f,u=function(t,e,n){return void 0===n&&(n=e),i(l,void 0,void 0,(function(){var i,u,c;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),i=a,u=e,[4,s(t,n)];case 1:return i[u]=o.sent(),[3,3];case 2:return c=o.sent(),(0,d.debug)(r,{f:e,m:n,e:c}),[3,3];case 3:return[2]}}))}))},[4,u(!1,"name")];case 2:return h.sent(),[4,u(!1,"symbol")];case 3:return h.sent(),[4,u(!1,"url")];case 4:return h.sent(),[4,u(!1,"metadata")];case 5:return h.sent(),[4,u(U,"decimals")];case 6:return h.sent(),(0,d.debug)(r,e,a),[2,a]}}))}))},M=S={networkAccount:t,getAddress:y=function(){return f},stdlib:P,setDebugLabel:e,tokenAccepted:function(t){return i(T,void 0,void 0,(function(){return o(this,(function(e){return(0,d.debug)("tokenAccepted: Unnecessary on ETHlike",t),[2,!0]}))}))},tokenAccept:function(t){return i(T,void 0,void 0,(function(){return o(this,(function(e){return(0,d.debug)("tokenAccept: Unnecessary on ETHlike",t),[2]}))}))},tokenMetadata:E,contract:A,setGasLimit:function(t){v=(0,p.bigNumberify)(t)},getGasLimit:function(){return v},setStorageLimit:function(t){w=(0,p.bigNumberify)(t)},getStorageLimit:function(){return w}},x=function(t){return Q(M,t)},k=function(t){return Z(M,t)},[2,(0,d.stdAccount)(n(n({},S),{balanceOf:x,balancesOf:k}))]}}))}))},lt=s((0,d.replaceableThunk)((function(){return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return t=ft,[4,S()];case 1:return[4,t.apply(void 0,[e.sent()])];case 2:return[2,e.sent()]}}))}))})),2),ht=lt[0],dt=lt[1],pt=function(){return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,O()];case 1:return t=e.sent(),[2,c.Wallet.createRandom().connect(t)]}}))}))},mt=function(){return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return(0,d.debug)("createAccount with 0 balance."),[4,pt()];case 1:return t=e.sent(),[4,ft(t)];case 2:return[2,e.sent()]}}))}))},gt=function(t,r){return i(e,void 0,void 0,(function(){var e,n;return o(this,(function(i){switch(i.label){case 0:return[4,x()];case 1:return(e=i.sent())?[4,e(t,r)]:[3,3];case 2:return[2,i.sent()];case 3:return[4,ht()];case 4:return n=i.sent(),[4,ct(n,t,r)];case 5:i.sent(),i.label=6;case 6:return[2]}}))}))},bt=function(t){return i(e,void 0,void 0,(function(){var e,r,n;return o(this,(function(i){switch(i.label){case 0:return(0,d.debug)("newTestAccount(",t,")"),[4,mt()];case 1:return e=i.sent(),[4,z(e)];case 2:if(r=i.sent(),!xt.lt(t))return[3,6];i.label=3;case 3:return i.trys.push([3,5,,6]),(0,d.debug)("newTestAccount awaiting transfer:",r),[4,gt(e,t)];case 4:return i.sent(),(0,d.debug)("newTestAccount got transfer:",r),[3,6];case 5:throw n=i.sent(),console.log("newTestAccount: Trouble with account ".concat(r)),n;case 6:return[2,e]}}))}))},yt=(0,d.make_newTestAccounts)(bt).serial,vt=function(){return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return t=p.bigNumberify,[4,H()];case 1:return[2,t.apply(void 0,[e.sent()])]}}))}))},wt=function(t){return i(e,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:return e=(0,p.bigNumberToNumber)(t),[4,O()];case 1:return[4,n.sent().getBlock(e)];case 2:return r=n.sent().timestamp,[2,(0,p.bigNumberify)(r)]}}))}))},_t=function(){return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return t=wt,[4,vt()];case 1:return[4,t.apply(void 0,[e.sent()])];case 2:return[2,e.sent()]}}))}))},At=function(t){return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return _()?(t=gt,[4,ht()]):[3,3];case 1:return[4,t.apply(void 0,[e.sent(),0])];case 2:return e.sent(),[3,5];case 3:return[4,f.default.set(500)];case 4:e.sent(),e.label=5;case 5:return[4,vt()];case 6:return[2,e.sent()]}}))}))},Et=(0,d.make_waitUntilX)("time",vt,At),St=(0,d.make_waitUntilX)("secs",_t,(function(t){return i(e,void 0,void 0,(function(){var t,e;return o(this,(function(r){switch(r.label){case 0:return e=At,[4,vt()];case 1:return[4,e.apply(void 0,[r.sent().add(1)])];case 2:return t=r.sent(),[4,wt(t)];case 3:return[2,r.sent()]}}))}))})),Mt=function(t,r,n,s){return i(e,void 0,void 0,(function(){var e,a,u,f,m,g,y,v,w,_,A,E,S,M,x,k,T,I,C,R,B,N=this;return o(this,(function(P){switch(P.label){case 0:e="".concat(s,": verifyContract"),(0,d.debug)(e,{ctcInfo:t}),a=r._Connectors.ETH,u=a.ABI,f=a.Bytecode,m=(0,h.protect)(j,t),g=new l.ethers.utils.Interface(u),(0,d.debug)(e,{ctcAddress:m}),y=function(t,e){if(!t)throw Error("verifyContract failed: ".concat(e))},v=xt,P.label=1;case 1:return P.trys.push([1,4,,5]),[4,mt()];case 2:return w=P.sent(),[4,new c.Contract(m,u,w.networkAccount)._reachCreationTime()];case 3:return _=P.sent(),A=U.unmunge(_),v=(0,p.bigNumberify)(A),[3,5];case 4:return E=P.sent(),y(!1,"Failed to call the '_reachCreationTime' method on the contract ".concat(m," during contract bytecode verification. This could mean that there is a general network fault, or it could mean that the given address is not a Reach contract and does not provide this function. The internal error we caught is: ").concat(E)),[3,5];case 5:return n.init({ctcAddress:m,creationBlock:v}),S=function(t,e,r){var n=(0,d.j2sf)(t),i=(0,d.j2sf)(e);y(n===i,"".concat(r,": expected ").concat(i,", got ").concat(n))},[4,n.peq(e,(function(t){return i(N,void 0,void 0,(function(){return o(this,(function(e){return[2,t.gt(v)]}))}))}))];case 6:if(M=P.sent(),(0,d.debug)(e,{r0:M}),M.timeout)throw y(!1,"Contract was claimed to be deployed, but the current block is ".concat(M.time," and it hasn't been deployed yet.")),Error("impossible");if(x=M.txn,k=W((function(){return m}),g,b(0)),T=k.parseA(x),(0,d.debug)(e,{e0rec:x,ctorArg_r:T}),!T)throw y(!1,"Contract deployment doesn't have first event"),Error("impossible");return I=T.slice(1),(0,d.debug)(e,{ctorArg:I}),[4,O()];case 7:return[4,P.sent().getTransaction(x.transactionHash)];case 8:return C=P.sent(),(0,d.debug)(e,{dt:C}),R=C.data,B=f+g.encodeDeploy(I).slice(2),S(R,B,"Contract bytecode does not match expected bytecode."),[2,{creationBlock:v}]}}))}))},xt=(0,p.bigNumberify)(0),kt=xt,Tt=n(n(n({},r),w),{doCall:ut,getQueryLowerBound:g.getQueryLowerBound,setQueryLowerBound:g.setQueryLowerBound,getValidQueryWindow:B,setValidQueryWindow:N,getFaucet:ht,setFaucet:dt,randomUInt:Y,hasRandom:J,balanceOf:Q,balancesOf:Z,minimumBalanceOf:function(t){return i(e,void 0,void 0,(function(){return o(this,(function(t){return[2,xt]}))}))},transfer:ct,connectAccount:ft,newAccountFromSecret:function(t){return i(e,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:return[4,O()];case 1:return e=n.sent(),r=new c.Wallet(t).connect(e),[4,ft(r)];case 2:return[2,n.sent()]}}))}))},newAccountFromMnemonic:function(t){return i(e,void 0,void 0,(function(){var e,r;return o(this,(function(n){switch(n.label){case 0:return[4,O()];case 1:return e=n.sent(),r=c.Wallet.fromMnemonic(t).connect(e),[4,ft(r)];case 2:return[2,n.sent()]}}))}))},getDefaultAccount:function(){return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:if((0,d.debug)("getDefaultAccount"),!A())throw Error("Default account not available");return t=ft,[4,E()];case 1:return[2,t.apply(void 0,[e.sent()])]}}))}))},createAccount:mt,canFundFromFaucet:k,fundFromFaucet:gt,newTestAccount:bt,newTestAccounts:yt,getNetworkTime:vt,waitUntilTime:Et,wait:function(t,r){return i(e,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,vt()];case 1:return e=n.sent(),[4,Et(e.add(t),r)];case 2:return[2,n.sent()]}}))}))},getNetworkSecs:_t,waitUntilSecs:St,verifyContract:function(t,r){return i(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,Mt(t,r,G(),"stdlib")];case 1:return[2,e.sent()]}}))}))},standardUnit:T,atomicUnit:I,parseCurrency:function(t){return(0,p.bigNumberify)(l.ethers.utils.parseUnits(t.toString(),v))},minimumBalance:kt,formatCurrency:function(t,e){return void 0===e&&(e=v),(0,d.handleFormat)(t,e,18)},formatAddress:function(t){return D.canonicalize(t)},formatWithDecimals:g.formatWithDecimals,unsafeGetMnemonic:function(t){var e=t.networkAccount||t;if(e._mnemonic)return e._mnemonic().phrase;throw Error("unsafeGetMnemonic: Secret key not accessible for account")},launchToken:function(t,e,r,n){var s,a;return void 0===n&&(n={}),i(this,void 0,void 0,(function(){var u,f,l,h,g,b,y,w,_,A,E,S,M,x=this;return o(this,(function(k){switch(k.label){case 0:return(0,d.debug)("Launching token, ".concat(e," (").concat(r,")")),u=function(t){return t.networkAccount.address},f=m.default.contracts["sol/stdlib.sol:ReachToken"],l=f.abi,h=f.bin,g=new c.ContractFactory(l,h,t.networkAccount),(0,d.debug)("".concat(r,": deploy")),b=n.supply&&(0,p.bigNumberify)(n.supply)||(0,p.bigNumberify)(2).pow(256).sub(1),y=void 0!==n.decimals?n.decimals:v,w=null!==(s=n.url)&&void 0!==s?s:"",_=null!==(a=n.metadataHash)&&void 0!==a?a:"",[4,g.deploy(e,r,w,_,b,y)];case 1:return A=k.sent(),(0,d.debug)("".concat(r,": wait for deploy: ").concat(A.deployTransaction.hash)),[4,A.deployTransaction.wait()];case 2:return E=k.sent(),(0,d.debug)("".concat(r,": saw deploy: ").concat(E.blockNumber)),S=A.address,(0,d.debug)("".concat(r,": deployed: ").concat(S)),M=function(e,n){return i(x,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return(0,d.debug)("".concat(r,": transferring ").concat(n," ").concat(r," for ").concat(u(e))),[4,ct(t,e,n,S)];case 1:return i.sent(),[2]}}))}))},[2,{name:e,sym:r,id:S,mint:M,optOut:function(e,n){return void 0===n&&(n=t),i(x,void 0,void 0,(function(){return o(this,(function(t){return(0,d.debug)("".concat(r,": optOut unnecessary on ETHlike"),e,n),[2]}))}))}}]}}))}))},reachStdlib:q,setMinMillisBetweenRequests:function(){console.warn("setMinMillisBetweenRequests is not supported on this connector")},setCustomHttpEventHandler:function(){console.warn("setCustomHttpEventHandler is not supported on this connector")},setSigningMonitor:ot,getTimeSecs:wt});return Tt}},4980:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(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)&&i(e,t,r);return o(e,t),e},a=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};e.__esModule=!0,e.makeEthLikeCompiled=void 0;var c=r(3825),f=s(r(6549)),l=s(r(1923)),h=l.bigNumberify,d=l.bigNumberToNumber,p=r(3653);e.makeEthLikeCompiled=function(t){var e=t.T_Address,r=p.UInt256_max,i=(0,p.makeDigest)("keccak256",(function(t,e){if("tuple()"===t.paramType){if(Array.isArray(e)&&0===e.length)return e;throw Error("impossible: digest tuple() with non-empty array: ".concat((0,p.j2s)(e)))}return c.ethers.utils.defaultAbiCoder.encode([t.paramType],[t.munge(e)])})),o=n(n({},l.BT_Null),{munge:function(t){return!1},unmunge:function(t){return null},paramType:"bool"}),s=n(n({},l.BT_Bool),{munge:function(t){return t},unmunge:function(t){return m(t)},paramType:"bool"}),m=function(t){return s.canonicalize(t)},g=n(n({},l.BT_UInt(r)),{munge:function(t){return h(t)},unmunge:function(t){return y(t)},paramType:"uint256"}),b=g,y=function(t){return g.canonicalize(t)},v=n(n({},l.BT_Digest),{defaultValue:c.ethers.utils.keccak256([]),munge:function(t){return c.ethers.BigNumber.from(t)},unmunge:function(t){return w(t.toHexString())},paramType:"uint256"}),w=function(t){return v.canonicalize(t)},_=function(t,e){var r=d(h(e));return n(n({},l.BT_Array(t,r)),{munge:function(e){return 0!=r&&e.map((function(e){return t.munge(e)}))},unmunge:function(e){return 0==r?[]:A(t,r)(e.map((function(e){return t.unmunge(e)})))},paramType:"".concat(t.paramType,"[").concat(r,"]")})},A=function(t,e){return function(r){return _(t,e).canonicalize(r)}},E=function(t){return n(n({},l.BT_Tuple(t)),{munge:function(e){return 0!=t.length&&e.map((function(e,r){return t[r].munge(e)}))},unmunge:function(e){return S(t)(t.map((function(t,r){return t.unmunge(e[r])})))},paramType:"tuple(".concat(t.map((function(t){return t.paramType})).join(","),")")})},S=function(t){return function(e){return E(t).canonicalize(e)}},M=function(t){return n(n({},l.BT_Struct(t)),{munge:function(e){return 0!=t.length&&t.map((function(t){var r=a(t,2),n=r[0];return r[1].munge(e[n])}))},unmunge:function(e){return x(t)(t.map((function(t,r){var n=a(t,2);return n[0],n[1].unmunge(e[r])})))},paramType:"tuple(".concat(t.map((function(t){var e=a(t,2);return e[0],e[1].paramType})).join(","),")")})},x=function(t){return function(e){return M(t).canonicalize(e)}},k=function(t){return n(n({},l.BT_Object(t)),{munge:function(e){var r={},n=!0;for(var i in t)n=!1,r["_"+i]=t[i].munge(e[i]);return!n&&r},unmunge:function(e){var r={};for(var n in t)r[n]=t[n].unmunge(e["_"+n]);return T(t)(r)},paramType:(e=(0,p.labelMaps)(t).ascLabels.map((function(e){return"".concat(t[e].paramType," _").concat(e)})).join(","),"tuple(".concat(e,")"))});var e},T=function(t){return function(e){return k(t).canonicalize(e)}},I=function(t){var e,r,i=(0,p.labelMaps)(t),o=i.ascLabels,s=i.labelMap;return n(n({},l.BT_Data(t)),{munge:function(e){var r=a(e,2),n=r[0],i=r[1],u=s[n],c=o.map((function(e){var r=t[e];return r.munge(r.defaultValue)}));return c[u]=t[n].munge(i),[u].concat(c)},unmunge:function(e){var r=g.unmunge(e[0]),n=d(r),i=o[n],s=e[n+1];return C(t)([i,t[i].unmunge(s)])},paramType:(e=(0,p.labelMaps)(t).ascLabels.map((function(e){return"".concat(t[e].paramType," _").concat(e)})),r=["".concat(g.paramType," which")].concat(e).join(","),"tuple(".concat(r,")"))})},C=function(t){return function(e){return I(t).canonicalize(e)}},R=n(n({},e),{name:"Contract"}),B=(0,p.mkAddressEq)(e),N=f.eq,O=f.digest_xor,P=f.bytes_xor,D=f.btoiLast8,L=B,U={T_Null:o,T_Bool:s,T_UInt:g,T_UInt256:b,T_Bytes:function(t){var e=n(n({},l.BT_Bytes(t)),{munge:function(t){return function(t,e){for(var r=[],n=0;n<Math.ceil(t.length/32);n++)r.push(t.slice(32*n,32*(n+1)));return r}(Array.from(c.ethers.utils.toUtf8Bytes(t)))},unmunge:function(t){var r=t.map((function(t){return(0,p.hexToString)(c.ethers.utils.hexlify((e=t,Array.isArray(e)?e.map((function(t){if("bigint"==typeof t){if(t>=256)throw Error("unBigInt expected n < 256");return Number(t)}return t})):e)));var e})),n="".concat.apply("",u([],a(r),!1));return e.canonicalize(n)},paramType:function(){for(var e=t,r=[];0<e;){var n=Math.min(32,e);r.push("bytes".concat(n)),e-=n}return"tuple(".concat(r.join(","),")")}()});return e},T_Address:e,T_Contract:R,T_Digest:v,T_Token:e,T_Object:k,T_Data:I,T_Array:_,T_Tuple:E,T_Struct:M},j=(0,p.makeArith)(r),F=n(n(n(n({},f),j),U),{addressEq:B,ctcAddrEq:function(t,e){return(0,p.debug)("ctcAddrEq",{x:t,y:e}),B(t,e)},digestEq:N,digest_xor:O,bytes_xor:P,btoiLast8:D,tokenEq:L,digest:i,UInt_max:r,emptyContractInfo:"0x00000000000000000000000000000000"});return n(n({},F),{typeDefs:U,stdlib:F})}},8690:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},o=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},s=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.Wallet=e.BrowserWallet=e.ContractFactory=e.Contract=e.Signer=e.providers=e.utils=e.BigNumber=void 0;var f=c(r(4628)),l=c(r(138)),h=f.default.format,d=r(3825),p=d.ethers.BigNumber,m=d.ethers.utils;e.BigNumber=p,e.utils=m;var g,b,y,v=r(8081),w=r(3653),_=r(3864),A=function(t,e){return i(void 0,void 0,void 0,(function(){var r,s,a,u,c,f,l,h,d,p,m;return o(this,(function(g){switch(g.label){case 0:for(l in r=function(e){return i(void 0,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return(0,w.debug)("actuallyLookup",{blockHash:e}),[4,t.getBlockByHash(e)];case 1:return r=n.sent(),(0,w.debug)("actuallyLookup",{blockHash:e},"res",r),[2,parseInt(r.blockNumber)]}}))}))},s={},a=function(t){return i(void 0,void 0,void 0,(function(){var e,n;return o(this,(function(i){switch(i.label){case 0:return t in s?[3,2]:(e=s,n=t,[4,r(t)]);case 1:e[n]=i.sent(),i.label=2;case 2:return[2,s[t]]}}))}))},u=function(t){return i(void 0,void 0,void 0,(function(){var e,r;return o(this,(function(i){switch(i.label){case 0:return t.blockNumber?[2,t]:[3,1];case 1:return t.blockHash?(e=t.blockHash,[4,a(e)]):[3,3];case 2:return r=i.sent(),[2,n(n({},t),{blockNumber:r})];case 3:throw Error("No blockNumber or blockHash on log: ".concat(Object.keys(t)))}}))}))},c=[],f=[],e)f.push(l);h=0,g.label=1;case 1:return h<f.length?(d=f[h],p=c,m=d,[4,u(e[d])]):[3,4];case 2:p[m]=g.sent(),g.label=3;case 3:return h++,[3,1];case 4:return[2,c]}}))}))},E=function(t){if(0!==t.outcomeStatus)throw Error("Receipt outcomeStatus is nonzero: ".concat(t.outcomeStatus));return n({status:"ok"},t)},S=function(t){if(0!==t.status)throw Error("Txn status is not 0: ".concat(t.status));return t};g=e.providers||(e.providers={}),b=function(t){return d.ethers.BigNumber.from(t.toString())},y=function(){function t(t){this.conflux=t}return t.prototype.getBalance=function(t,e){return i(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return r=b,[4,this.conflux.getBalance(t,e)];case 1:return[2,r.apply(void 0,[n.sent()])]}}))}))},t.prototype.getBlockNumber=function(){return i(this,void 0,void 0,(function(){var t,e;return o(this,(function(r){switch(r.label){case 0:return[4,this.conflux.getEpochNumber(v.defaultEpochTag)];case 1:return t=r.sent(),[4,this.conflux.getBlockByEpochNumber(t,!0)];case 2:return e=r.sent(),(0,w.debug)("getBlockNumber",t,e.epochNumber,e.blockNumber),[2,parseInt(e.blockNumber)]}}))}))},t.prototype.getBlock=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return(0,w.debug)("getBlock",t),[4,this.conflux.getBlockByBlockNumber(t,!0)];case 1:return[2,e.sent()]}}))}))},t.prototype.getTransactionReceipt=function(t){return i(this,void 0,void 0,(function(){var e,r,n;return o(this,(function(i){switch(i.label){case 0:return[4,this.conflux.getTransactionReceipt(t)];case 1:return(e=i.sent())?[4,A(this.conflux,[e])]:[2,e];case 2:return r=s.apply(void 0,[i.sent(),1]),n=r[0],[2,E(n)]}}))}))},t.prototype.getCode=function(t,e){return void 0===e&&(e=void 0),i(this,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,this.conflux.getCode(t,e)];case 1:return[2,r.sent()]}}))}))},t.prototype.on=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];throw Error("on not yet implemented")},t.prototype.off=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];throw Error("off not yet implemented")},t.prototype.getLogs=function(t){return i(this,void 0,void 0,(function(){var e,r,n;return o(this,(function(i){switch(i.label){case 0:return e=t,(0,w.debug)("getLogs","opts",e),0===e.fromBlock&&(e.fromBlock=1,(0,w.debug)("getLogs","opts",e)),[4,this.conflux.getLogs(e)];case 1:return r=i.sent(),(0,w.debug)("getLogs","result",r),[4,A(this.conflux,r)];case 2:return n=i.sent(),(0,w.debug)("getLogs","aresult",n),[2,n]}}))}))},t.prototype.getTransaction=function(t){return i(this,void 0,void 0,(function(){var e;return o(this,(function(r){switch(r.label){case 0:return e=S,[4,this.conflux.getTransactionByHash(t)];case 1:return[2,e.apply(void 0,[r.sent()])]}}))}))},t.prototype.waitForTransaction=function(t){return i(this,void 0,void 0,(function(){var e,r,n;return o(this,(function(i){switch(i.label){case 0:e="waitForTransaction",r=void 0,n=0,i.label=1;case 1:return r?[3,5]:n++>0?[4,l.default.set(500)]:[3,3];case 2:i.sent(),i.label=3;case 3:return(0,w.debug)(e,t),[4,this.getTransactionReceipt(t)];case 4:return r=i.sent(),(0,w.debug)(e,t,r),[3,1];case 5:if(0!==r.outcomeStatus)throw Error("Transaction failed, outcomeStatus: ".concat(r.outcomeStatus));return[2,r]}}))}))},t}(),g.Provider=y;var M=function(t){var e,r;if(!t)return t;if(t._isBigNumber)return t.toString();if(Array.isArray(t))return t.map(M);if("string"==typeof t)return t;if(Object.keys(t).length>0){var n={};try{for(var i=a(Object.keys(t)),o=i.next();!o.done;o=i.next()){var s=o.value;n[s]=M(t[s])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}return t},x=function(t){if("boolean"==typeof t)return t;if("number"==typeof t)return 0!==t;if(Array.isArray(t)&&1===t.length)return x(t[0]);throw Error("don't know how to booleanize '".concat(t,"': ").concat(typeof t))},k=function(t,e){if(t=M(t),Array.isArray(t)){if(t.length!==e.length)throw(0,w.debug)("conform","err",{args:t,tys:e}),Error("impossible: number of args (".concat(t.length,") does not match number of tys (").concat(e.length,")"));for(var r in e){var n=e[r].type;"tuple"===n?t[r]=k(t[r],e[r].components):"bool"===n?t[r]=x(t[r]):"address"===n?t[r]=_.T_Address.munge(_.T_Address.canonicalize(t[r])):(0,w.debug)("conform untouched:",t[r],e[r])}}return t},T=function(t,e){return i(void 0,void 0,void 0,(function(){var r,n,i,s,a,u,c,f,l,d,p,m,g;return o(this,(function(o){switch(o.label){case 0:r="addEstimates",(0,w.debug)(r,"1: start:",e),n=function(t){return BigInt((null==t?void 0:t.toString())||"0")},s=(i=function(t){var r=e[t];return delete e[t],n(r)})("gas"),a=i("storageLimit"),(0,w.debug)(r,"2:  orig:",{gas:s,storage:a}),u=void 0,c=void 0,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.getNextNonce(e.from)];case 2:return f=o.sent(),e.nonce=f,(0,w.debug)(r,"n:nonce:",{n:f}),[3,4];case 3:return l=o.sent(),(0,w.debug)(r,"n:nonce:",{e:l}),[3,4];case 4:return o.trys.push([4,6,,7]),[4,t.estimateGasAndCollateral(e)];case 5:return u=o.sent(),[3,7];case 6:return d=o.sent(),c=d,[3,7];case 7:return(0,w.debug)(r,"3:   est:",{est:u,est_err:c}),u&&(s=(p=function(t,e){return e>t?e:t})(s,n(null==u?void 0:u.gasUsed)),a=p(a,n(null==u?void 0:u.storageCollateralized))),(0,w.debug)(r,"4: eused:",{gas:s,storage:a}),void 0!==a&&a!==n(0)||(a=n(2048)),(0,w.debug)(r,"5:  non0:",{gas:s,storage:a}),s=(m=function(t,e){return n(h.big(t).times(e).toFixed(0))})(s,t.defaultGasRatio),a=m(a,t.defaultStorageRatio),(0,w.debug)(r,"6: ratio:",{gas:s,storage:a}),g=s,s===n("0")&&(g=void 0),(0,w.debug)(r,"7:   und:",{gasu:g,storage:a}),e.gas=null==g?void 0:g.toString(),e.storageLimit=a.toString(),[2,e]}}))}))},I=function(){function t(){}return t.isSigner=function(t){return t&&t.sendTransaction instanceof Function},t}();e.Signer=I;var C=function(){function t(t,e,r,n,s){var u,c,f=this;this.address=t||void 0;var l=Object.keys(this).filter((function(t){return"_"===t[0]}));this._abi="string"==typeof e?JSON.parse(e):e,this._wallet=r,this._receiptP=n,this._contract=this._wallet.provider.conflux.Contract({abi:this._abi,address:this.address});var h=this;this.deployTransaction={transactionHash:s,wait:function(){return i(f,void 0,void 0,(function(){var t,e,r,i;return o(this,(function(o){switch(o.label){case 0:if((0,w.debug)("cfxers:Contract.wait","start"),!n)throw Error("No receipt promise to wait on");return[4,h._receiptP];case 1:if(t=o.sent(),(0,w.debug)("cfxers:Contract.wait","got receipt",t),e=(0,v.address_cfxStandardize)(t.contractCreated),h.address&&h.address!==e)throw Error("Impossible: ctc addresses don't match: ".concat(h.address," vs ").concat(e));if(h.address=h.address||e,r=t.transactionHash,(i=h.deployTransaction).transactionHash&&i.transactionHash!==r)throw Error("Impossible: txn hashes don't match: ".concat(i.transactionHash," vs ").concat(r));return i.transactionHash=r,[2,E(t)]}}))}))}},this.interface=new d.ethers.utils.Interface(this._abi);try{for(var p=a(this._abi),m=p.next();!m.done;m=p.next()){var g=m.value;"function"===g.type&&(l.includes(g.name)||"address"===g.name||"deployTransaction"===g.name||"interface"===g.name||(this[g.name]=this._makeHandler(g)))}}catch(t){u={error:t}}finally{try{m&&!m.done&&(c=p.return)&&c.call(p)}finally{if(u)throw u.error}}}return t.prototype._makeHandler=function(t){var e=this,r=this._wallet,a=this.interface,c=t.name,f=t.stateMutability,l=r.getAddress(),h=this,d=a.fragments.filter((function(t){return t.name==c}))[0].inputs;return function(){for(var t=[],a=0;a<arguments.length;a++)t[a]=arguments[a];return i(e,void 0,void 0,(function(){var e,i,a,p,m,g,b;return o(this,(function(o){switch(o.label){case 0:return(0,w.debug)("cfxers:handler",c,"call",{args:t}),e={from:l,value:"0"},t.length===d.length+1&&(e=M(t.pop()),e=n(n({from:l},e),{value:(e.value||"0").toString()})),t=M(t),void 0!==e.gasLimit&&(e.gas=e.gasLimit),delete e.gasLimit,(0,w.debug)("cfxers:handler",c,"txn",{txn:e,args:t}),i=k(t,d),(0,w.debug)("cfxers:handler",c,"conform",i),"view"===f||"pure"===f?[3,3]:((0,w.debug)("cfxers:handler",c,"waitable"),a=(g=h._contract[c]).call.apply(g,u([],s(i),!1)),(0,w.debug)("cfxers:handler",c,"cfc",a),p=a.to,m=a.data,p=p||h.address,e=n(n({},e),{to:p,data:m}),[4,T(this._wallet.provider.conflux,e)]);case 1:return e=o.sent(),(0,w.debug)("cfxers:handler",c,"txn",e),[4,r.sendTransaction(e)];case 2:case 4:return[2,o.sent()];case 3:return(0,w.debug)("cfxers:handler",c,"view"),[4,(b=h._contract[c]).call.apply(b,u([],s(i),!1))]}}))}))}},t}();e.Contract=C;var R=function(){function t(t,e,r){this.abi="string"==typeof t?JSON.parse(t):t,this.bytecode=e,this.wallet=r,this.interface=new d.ethers.utils.Interface(this.abi)}return t.prototype.deploy=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i(this,void 0,void 0,(function(){var e,r,n,i,a,c,f,l;return o(this,(function(o){switch(o.label){case 0:if(r=(e=this).abi,n=e.wallet,(0,w.debug)("deploy",{wallet:n}),n._requireConnected(),!n.provider)throw Error("Impossible: provider is undefined");return i=n.provider.conflux,a=this.getDeployTransaction.apply(this,u([],s(t),!1)),[4,n.sendTransaction(a)];case 1:return c=o.sent().transactionHash,f=n.provider.waitForTransaction(c),[4,i.getTransactionByHash(c)];case 2:return l=o.sent(),(0,w.debug)("deploy result",{hash:c,txnRes:l}),[2,new C(void 0,r,n,f,c)]}}))}))},t.prototype.getDeployTransaction=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=this,o=i.abi,a=i.bytecode,c=i.interface,f=i.wallet;(0,w.debug)("getDeployTransaction",{wallet:f});var l="0x"===a.slice(0,2)||""===a?a:"0x"+a;if(!f.provider)throw Error("Impossible: provider is undefined");var h=f.provider.conflux,d={};e.length===c.deploy.inputs.length+1&&(d=M(e.pop()));var m=c.deploy.inputs.length;if(e.length!==m)throw Error("cfxers: contract deployment expected ".concat(m," args but got ").concat(e.length));var g=h.Contract({abi:o,bytecode:l}),b=f.getAddress(),y=p.from(0).toString(),v=n({from:b,value:y},d),_=k(e,c.deploy.inputs);(0,w.debug)("cfxers:Contract.deploy",{argsConformed:_,txn:v});var A=(t=g.constructor).call.apply(t,u([],s(_),!1)),E=A.data;return n(n({},v),{data:E})},t}();e.ContractFactory=R;var B=function(){function t(t,e,r){this.cp=t,this.address=(0,v.address_cfxStandardize)(e),this.provider=r}return t.prototype.connect=function(t){if(this.provider)throw Error("impossible: BrowserWallet already connected");return this.provider=t,this},t.prototype._requireConnected=function(){if(!this.provider)throw Error("Wallet has no Provider, please call .connect()")},t.prototype.getAddress=function(){return this.address},t.prototype.sendTransaction=function(t){return i(this,void 0,void 0,(function(){var e,r,i,s,u,c,f,l=this;return o(this,(function(o){switch(o.label){case 0:if(this._requireConnected(),r=(e=this).provider,i=e.address,!r)throw Error("Impossible: provider is undefined");return s=function(t){var e,r,i=function(t){return"0x"+BigInt(t||"0").toString(16)},o=n({},t);o.value=i(t.value);try{for(var s=a(["storageLimit","gas","nonce"]),u=s.next();!u.done;u=s.next()){var c=u.value;void 0!==o[c]&&(o[c]=i(t[c]))}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return o}(n(n({},t),{from:i})),u=s.value,[4,new Promise((function(t,e){return l.cp.sendAsync({from:i,value:u,method:"cfx_sendTransaction",params:[s]},(function(r,n){r?e(r):t(n)}))}))];case 1:if(c=o.sent(),(0,w.debug)("sendTransaction",{txn:s,data:c}),!c)throw Error("No data returned from ConfluxPortal.sendAsync");return[2,{transactionHash:f=c.result,wait:function(){return r.waitForTransaction(f)}}]}}))}))},t}();e.BrowserWallet=B;var N={},O=function(){function t(t,e,r){this.privateKey=t,r&&(this._mnemonic=function(){return{phrase:r}}),e&&this.connect(e)}return t.prototype.connect=function(t){if(this.provider)throw Error("Wallet already connected");if(this.provider=t,!this.privateKey)throw Error("no privateKey given");var e,r,n;return this.account=(e=this.provider.conflux,r=this.privateKey,(n=N[r])||(n=e.wallet.addPrivateKey(r),N[r]=n),n),this},t.prototype._requireConnected=function(){if(!this.provider)throw Error("Wallet has no Provider, please call .connect()");if(!this.account)throw Error("Wallet has no Account, please call .connect()")},t.prototype.getAddress=function(){if(this._requireConnected(),!this.account)throw Error("Impossible: account is undefined");return(0,v.address_cfxStandardize)(this.account.toString())},t.prototype.sendTransaction=function(t){return i(this,void 0,void 0,(function(){var e,r,i,s,a,u,c;return o(this,(function(f){switch(f.label){case 0:if(this._requireConnected(),!(e=this.provider))throw Error("Impossible: provider is undefined");return r=this.getAddress(),t=n(n({from:r},t),{value:(t.value||"0").toString()}),[4,T(e.conflux,t)];case 1:return(t=f.sent()).to instanceof Promise?(i=t,[4,t.to]):[3,3];case 2:i.to=f.sent(),f.label=3;case 3:s="retryingSendTxn",a=0,u=function(){var r,i,u,c,f,h;return o(this,(function(o){switch(o.label){case 0:return a++>0?[4,l.default.set(500)]:[3,2];case 1:o.sent(),o.label=2;case 2:(0,w.debug)(s,"attempt",a,t),r=n({},t),o.label=3;case 3:return o.trys.push([3,9,,10]),[4,e.conflux.sendTransaction(r)];case 4:i=o.sent(),(0,w.debug)(s,"sent",{txn:t,txnMut:r,th:i}),u=null,c=0,o.label=5;case 5:if(u&&u.blockHash)return[3,8];if(c++>600)throw Error("".concat(s," timeout in mining ").concat(i));return(0,w.debug)(s,"get",c,i),[4,l.default.set(500)];case 6:return o.sent(),[4,e.conflux.getTransactionByHash(i)];case 7:return u=o.sent(),[3,5];case 8:return[2,{value:n(n({},u),{transactionHash:i,wait:function(){return e.waitForTransaction(i)}})}];case 9:if(f=o.sent(),h=(0,w.j2s)(f),(0,w.debug)(s,"err",{txn:t,e:f,es:h}),-32077!==f.code)throw f;return(0,w.debug)(s,"catchingUp"),[3,10];case 10:return[2]}}))},f.label=4;case 4:return[5,u()];case 5:return"object"==typeof(c=f.sent())?[2,c.value]:[3,4];case 6:return[2]}}))}))},t.createRandom=function(){var e=d.ethers.Wallet.createRandom()._mnemonic().phrase;return t.fromMnemonic(e)},t.fromMnemonic=function(e,r){return new t(d.ethers.Wallet.fromMnemonic(e)._signingKey().privateKey,r,e)},t}();e.Wallet=O},8403:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e},s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.util=e.test=e.ALGO_WalletConnect=e.ALGO_MyAlgoConnect=e.rpc_server=e.getConnectorMode=e.getConnector=e.unsafeAllowMultipleStdlibs=e.loadStdlib=e.ask=void 0,e.ask=o(r(800));var a=r(7921);n(e,a,"loadStdlib"),n(e,a,"unsafeAllowMultipleStdlibs");var u=r(6529);n(e,u,"getConnector"),n(e,u,"getConnectorMode"),e.rpc_server=o(r(1787));var c=s(r(9539));e.ALGO_MyAlgoConnect=c.default;var f=s(r(1825));e.ALGO_WalletConnect=f.default,e.test=o(r(1316)),e.util=o(r(1218))},7921:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(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)&&n(e,t,r);return i(e,t),e};e.__esModule=!0,e.loadStdlib=e.getConnector=e.getConnectorMode=e.unsafeAllowMultipleStdlibs=void 0;var s=o(r(198)),a=o(r(4660)),u=o(r(4828)),c=r(6529);e.getConnectorMode=c.getConnectorMode,e.getConnector=c.getConnector;var f=r(2130),l=r(2764),h=r(2764);function d(t){return t?"string"==typeof t?d({REACH_CONNECTOR_MODE:t}):((0,f.updateProcessEnv)(t),f.process.env.REACH_CONNECTOR_MODE||(console.log("WARNING: `REACH_CONNECTOR_MODE` defaulting behavior is deprecated as of version 0.1.6; please update your code to set this value explicitly."),"ETH")):d(f.process.env)}n(e,h,"unsafeAllowMultipleStdlibs"),e.loadStdlib=function(t){var e,r=d(t),n=(0,c.canonicalizeConnectorMode)(r),i=(0,c.getConnector)(n);switch((0,l.doStdlibLoad)(i),i){case"ETH":e=s;break;case"ALGO":e=a;break;case"CFX":e=u;break;default:throw Error("impossible: unknown connector ".concat(i))}return f.window.reach=e,e}},2764:(t,e)=>{"use strict";e.__esModule=!0,e.doStdlibLoad=e.unsafeAllowMultipleStdlibs=void 0;var r=null;e.unsafeAllowMultipleStdlibs=function(){r=!0},e.doStdlibLoad=function(t){if(null!=r&&1!=r&&r!=t)throw new Error("Cannot load multiple stdlib connectors without using `unsafeAllowMultipleStdlibs`");r=r||t}},6549:function(t,e,r){"use strict";var n=r(2486).Buffer,i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},o=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},s=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};e.__esModule=!0,e.simTokenDestroy=e.simTokenBurn=e.simTokenNew=e.simMapSet=e.simMapRef=e.simMapDupe=e.Array_asyncReduce=e.Array_asyncMap=e.mapRef=e.mapSet=e.newMap=e.Array_set=e.btoiLast8=e.bytes_xor=e.digest_xor=e.lt256=e.le256=e.gt256=e.ge256=e.eq256=e.lt=e.le=e.gt=e.ge=e.eq=e.bytesConcat=e.bytesEq=e.stringToHex=e.isHex=e.hexlify=e.protect=e.checkedBigNumberify=e.assert=e.formatAssertInfo=e.fromSome=e.asMaybe=e.bigNumberToNumber=void 0;var c=r(3825),f=r(1923);e.bigNumberToNumber=f.bigNumberToNumber;var l=r(3653);function h(t,e){return e in t}l.debug,e.asMaybe=function(t){return void 0===t?["None",null]:["Some",t]},e.fromSome=function(t,e){return"Some"===t[0]?t[1]:e},e.formatAssertInfo=function(t){var e,r,n,i="";if("string"==typeof t)i=": ".concat(t);else if(null==t);else if("object"==typeof t){h(t,"who")&&(i+=": ".concat(t.who),delete t.who),h(t,"msg")&&(null!==t.msg&&(i+=": ".concat(t.msg)),delete t.msg),h(t,"at")&&(i+="\n  at ".concat(t.at),delete t.at);var o=":";if(h(t,"fs")&&Array.isArray(t.fs)){try{for(var a=s(t.fs),u=a.next();!u.done;u=a.next()){var c=u.value;i+="\n  ".concat(c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}delete t.fs,o="\n"}(n=t)&&0===Object.keys(n).length&&Object.getPrototypeOf(n)===Object.prototype||(i+="".concat(o," ").concat((0,l.j2s)(t)))}return i},e.assert=function(t,r){if(void 0===r&&(r={}),!t)throw Error("Assertion failed".concat((0,e.formatAssertInfo)(r)))},e.checkedBigNumberify=function(t,e,r){var n=(0,f.bigNumberify)(r);if(n.gte(0)&&n.lte(e))return n;throw Error("bigNumberify: ".concat(r," out of range [0, ").concat(e,"] at ").concat(t))},e.protect=function(t,r,n){void 0===n&&(n=null),(0,l.debug)("protect",t.name,r);try{return t.canonicalize(r)}catch(i){throw Error("Protect failed: expected ".concat(t.name," but got ").concat((0,l.j2s)(r)).concat((0,e.formatAssertInfo)(n),"\n").concat((0,l.j2s)(i)))}};var d=c.ethers.utils,p=d.toUtf8Bytes,m=d.isHexString;e.hexlify=c.ethers.utils.hexlify,e.isHex=m,e.stringToHex=function(t){return(0,e.hexlify)(p(t))};var g=function(t){return(0,e.isHex)(t)?t:(0,e.stringToHex)(t)};e.bytesEq=function(t,e){return g(t)===g(e)},e.bytesConcat=function(t,e){return t.concat(e)},e.eq=function(t,e){return(0,f.bigNumberify)(t).eq((0,f.bigNumberify)(e))},e.ge=function(t,e){return(0,f.bigNumberify)(t).gte((0,f.bigNumberify)(e))},e.gt=function(t,e){return(0,f.bigNumberify)(t).gt((0,f.bigNumberify)(e))},e.le=function(t,e){return(0,f.bigNumberify)(t).lte((0,f.bigNumberify)(e))},e.lt=function(t,e){return(0,f.bigNumberify)(t).lt((0,f.bigNumberify)(e))},e.eq256=e.eq,e.ge256=e.ge,e.gt256=e.gt,e.le256=e.le,e.lt256=e.lt,e.digest_xor=function(t,e){var r=function(t){return"0x"===t.slice(0,2)?t.slice(2):t},n=r(t),i=r(e),o=function(t){for(var e,r=[],n=0;n<t.length;n+=2)r.push((e=t.substr(n,2),parseInt(e,16)));return r},s=o(n),a=o(i);return"0x"+s.map((function(t,e){return(t^a[e]).toString(16).padStart(2,"0")})).join("")},e.bytes_xor=function(t,e){var r=n.from(t),i=n.from(e),o=r.map((function(t,e){return t^i[e]}));return String.fromCharCode.apply(String,u([],a(o),!1))},e.btoiLast8=function(t){for(var e=t.length<8?0:t.length-8,r=n.from(t),i=(0,f.bigNumberify)(0),o=e;o<t.length;o++)i=i.mul(256).add(r[o]);return i},e.Array_set=function(t,e,r){var n=t.slice();return n[e]=r,n};var b=function(){var t={};return{ref:function(r){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){return[2,(0,e.asMaybe)(t[r])]}))}))},set:function(e,r){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){return t[e]=r,[2]}))}))}}},y=function(t){var r=b(),n={},s=function(t,s){return i(void 0,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return n[t]=!0,[4,(0,e.mapSet)(r,t,s)];case 1:return i.sent(),[2]}}))}))};return{ref:function(a){return i(void 0,void 0,void 0,(function(){var i;return o(this,(function(o){switch(o.label){case 0:return n[a]?[3,3]:[4,t(a)];case 1:return i=o.sent(),[4,s(a,"Some"===i[0]?i[1]:void 0)];case 2:o.sent(),o.label=3;case 3:return[4,(0,e.mapRef)(r,a)];case 4:return[2,o.sent()]}}))}))},set:s}};e.newMap=function(t){return t.isAPI?y(t.ctc.apiMapRef(t.idx,t.ty)):b()},e.mapSet=function(t,e,r){return i(void 0,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,t.set(e,r)];case 1:return n.sent(),[2]}}))}))},e.mapRef=function(t,e){return i(void 0,void 0,void 0,(function(){return o(this,(function(r){switch(r.label){case 0:return[4,t.ref(e)];case 1:return[2,r.sent()]}}))}))},e.Array_asyncMap=function(t,e){return i(void 0,void 0,void 0,(function(){var r;return o(this,(function(n){return r=function(r,n){return e(t.map((function(t){return t[n]})),n)},[2,Promise.all(t[0].map(r))]}))}))},e.Array_asyncReduce=function(t,e,r){return i(void 0,void 0,void 0,(function(){var n,i,s;return o(this,(function(o){switch(o.label){case 0:n=e,i=0,i=0,o.label=1;case 1:return i<t[0].length?(s=t.map((function(t){return t[i]})),[4,r(s,n,i)]):[3,4];case 2:n=o.sent(),o.label=3;case 3:return i++,[3,1];case 4:return[2,n]}}))}))},e.simMapDupe=function(t,e,r){t.maps[e]=y(r.ref)};var v=function(t,e){t.mapRefs.push(e)};e.simMapRef=function(t,r,n){return i(void 0,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return v(t,n),[4,(0,e.mapRef)(t.maps[r],n)];case 1:return[2,i.sent()]}}))}))},e.simMapSet=function(t,r,n,s){return i(void 0,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return v(t,n),[4,(0,e.mapSet)(t.maps[r],n,s)];case 1:return[2,i.sent()]}}))}))},e.simTokenNew=function(t,e,r,n,i,o,s,a){return t.txns.push({kind:"tokenNew",n:e,s:r,u:n,m:i,p:o,d:s}),a},e.simTokenBurn=function(t,e,r){t.txns.push({kind:"tokenBurn",tok:e,amt:r})},e.simTokenDestroy=function(t,e){t.txns.push({kind:"tokenDestroy",tok:e})}},3653:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},s=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},a=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},c=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.handleFormat=e.makeSigningMonitor=e.retryLoop=e.None=e.Some=e.isSome=e.isNone=e.Lock=e.Signal=e.setQueryLowerBound=e.getQueryLowerBound=e.makeEventStream=e.makeEventQueue=e.checkTimeout=e.make_waitUntilX=e.make_newTestAccounts=e.argMin=e.argMax=e.checkVersion=e.ensureConnectorAvailable=e.mkAddressEq=e.objectMap=e.argsSplit=e.argsSlice=e.makeArith=e.UInt256_max=e.makeRandom=e.hexToBigNumber=e.hexToString=e.makeDigest=e.envDefaultNoEmpty=e.envDefault=e.truthyEnv=e.labelMaps=e.memoizeThunk=e.replaceableThunk=e.stdAccount=e.stdAccount_unsupported=e.stdContract=e.stdGetABI=e.stdABIFilter=e.stdVerifyContract=e.debug=e.getDEBUG=e.hideWarnings=e.setDEBUG=e.j2s=e.j2sf=e.hasProp=e.hexlify=void 0,e.apiStateMismatchError=e.formatWithDecimals=void 0;var f=c(r(9842)),l=c(r(138)),h=r(3825),d=r(1923),p=c(r(4258)),m=r(6549),g=r(2130),b=r(6549);i(e,b,"hexlify"),e.hasProp=function(t,e){return t&&{}.hasOwnProperty.call(t,e)},e.j2sf=function(t){var e=[];return JSON.stringify(t,(function(t,r){if(null!=r&&"object"==typeof r){var n=e.indexOf(r);if(n>=0)return"@".concat(n);e.push(r)}return r}),2)},e.j2s=function(t){var r="".concat(t);return t&&t._isBigNumber||"{}"!==r&&!r.startsWith("[object")?r:(0,e.j2sf)(t)};var y=w(g.process.env.REACH_DEBUG);function v(t){var e=!1,r=null;return[function(){return e||(e=!0,r=t()),r},function(t){if(e)throw Error("Cannot re-set value once already set");r=t,e=!0}]}function w(t){return!!t&&!["0","false","f","#f","no","off","n",""].includes(t&&t.toLowerCase&&t.toLowerCase())}e.setDEBUG=function(t){if(!1!==t&&!0!==t)throw Error("Expected bool, got ".concat((0,e.j2s)(t)));y=t},e.hideWarnings=function(){return w(g.process.env.REACH_NO_WARN)},e.getDEBUG=function(){return y},e.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];(0,e.getDEBUG)()&&(t.map((function(t){return["object","array"].includes(typeof t)&&p.default&&p.default.inspect instanceof Function?p.default.inspect(t,!1,null,!0):t})),console.log.apply(console,u([new Date,"DEBUG:"],a(t),!1)))},e.stdVerifyContract=function(t,e){return o(void 0,void 0,void 0,(function(){var r,n,i;return s(this,(function(o){switch(o.label){case 0:return r=t.getTrustedVerifyResult,n=t.setTrustedVerifyResult,(i=r())?[2,i]:[4,e()];case 1:return i=o.sent(),n(i),[2,i]}}))}))},e.stdABIFilter=function(t){return!t.name||!t.name.startsWith("_reach")},e.stdGetABI=function(t){return function(r){return r?t:t.filter(e.stdABIFilter)}},e.stdContract=function(t){var r=t.bin,i=t.getABI,o=t.waitUntilTime,s=t.waitUntilSecs,a=t.selfAddress,u=t.iam,c=t.stdlib,f=t.setupView,l=t.setupEvents,h=t._setup,d=t.givenInfoP,p=function(){var t=function(t){throw Error("Cannot set info(".concat((0,e.j2s)(t),") (i.e. deploy) when acc.contract called with contract info: You are trying to attach to a contract as the deployer, which is not possible."))};if(void 0!==d)return{setInfo:t,getInfo:function(){return d}};var r=!1,n=new Promise((function(n){t=function(t){if(r)throw Error("Cannot set info(".concat((0,e.j2s)(t),") (i.e. deploy) twice"));n(t),r=!0}}));return{setInfo:t,getInfo:function(){return n}}}(),m=p.setInfo,g=p.getInfo,b=void 0,y={getInfo:g,setTrustedVerifyResult:function(t){b=t},getTrustedVerifyResult:function(){return b}},v=n(n({},y),{setInfo:m}),w=function(){var t=h(v),e=t.getContractInfo,r=t.getContractAddress,n=t.getContractCompanion,i=t.getBalance,f=t.sendrecv,l=t.recv,d=t.getCurrentStep,p=t.getState,m=t.apiMapRef;return{selfAddress:a,iam:u,stdlib:c,waitUntilTime:o,waitUntilSecs:s,getContractInfo:e,getContractAddress:r,getContractCompanion:n,getBalance:i,sendrecv:f,recv:l,getCurrentStep:d,getState:p,apiMapRef:m}},_={_initialize:w},A=f(y),E=A.viewLib,S=A.getView1,M=r._getViews({reachStdlib:c},E),x=function(t){return(0,e.objectMap)(M.infos,(function(r,n){return"ty"in(i=n)&&"decode"in i?S(M.views,r,void 0,n,t):(0,e.objectMap)(n,(function(e,n){return S(M.views,r,e,n,t)}));var i}))},k=x(!0),T=x(!1),I=(0,e.objectMap)(r._Participants,(function(t,e){return function(t){return e(_,t)}})),C=function(t){return void 0===t&&(t=!1),(0,e.objectMap)(r._APIs,(function(r,n){var i=function(n,i){var o=function(t){return void 0===n?"".concat(r):"".concat(r).concat(t).concat(n)},s=o("_");delete I[s];var a=o(".");return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o,s,u={terminated:a},c=new Promise((function(t,e){o=t,s=e})),f=function(e){t?o(["None",null]):s(e)};return(0,e.debug)("".concat(a,": start"),r),i(_,{in:function(){return(0,e.debug)("".concat(a,": in"),r),r},out:function(r,n){throw(0,e.debug)("".concat(a,": out"),r,n),o(t?["Some",n]:n),u}}).catch((function(t){Object.is(t,u)?(0,e.debug)("".concat(a,": done")):f(new Error("".concat(a," errored with ").concat(t)))})).then((function(t){f(new Error("".concat(a," returned with ").concat((0,e.j2s)(t))))})),c}};return"object"==typeof n?(0,e.objectMap)(n,i):i(void 0,n)}))},R=C(!1),B=C(!0),N=r._getEvents({reachStdlib:c}),O=l(y).createEventStream,P=(0,e.objectMap)(N,(function(t,r){return Array.isArray(r)?O(t,r):(0,e.objectMap)(r,(function(e,r){return O(t+"_"+e,r)}))}));return n(n({},_),{getABI:i,getInfo:g,getContractAddress:function(){return w().getContractAddress()},participants:I,p:I,views:k,v:k,getViews:function(){return console.log("WARNING: ctc.getViews() is deprecated; use ctc.views or ctc.v instead."),k},unsafeViews:T,apis:R,a:R,safeApis:B,events:P,e:P})},e.stdAccount_unsupported=function(t){return{setGasLimit:function(e){console.warn("setGasLimit not supported on ".concat(t))},getGasLimit:function(){return console.warn("getGasLimit not supported on ".concat(t)),(0,d.bigNumberify)(0)},setStorageLimit:function(e){console.warn("setStorageLimit not supported on ".concat(t))},getStorageLimit:function(){return console.warn("getStorageLimit not supported on ".concat(t)),(0,d.bigNumberify)(0)}}},e.stdAccount=function(t){return n(n({},t),{deploy:function(e){return console.log("WARNING: acc.deploy(bin) is deprecated; use acc.contract(bin) instead. Deployment is implied by the first publication."),t.contract(e,void 0)},attach:function(e,r){return console.log("WARNING: acc.attach(bin, info) is deprecated; use acc.contract(bin, info) instead. Attachment is implied by reception of the first publication."),t.contract(e,r)}})},e.replaceableThunk=v,e.memoizeThunk=function(t){return v(t)[0]},e.labelMaps=function(t){var e=Object.keys(t).sort(),r={};for(var n in e)r[e[n]]=parseInt(n);return{ascLabels:e,labelMap:r}},e.truthyEnv=w,e.envDefault=function(t,e){return null==t?e:t},e.envDefaultNoEmpty=function(t,r){var n=(0,e.envDefault)(t,r);return""===n?r:n},e.makeDigest=function(t,r){return function(n,i){m.hexlify;var o=r(n,i),s="keccak256"===t?h.ethers.utils.keccak256:h.ethers.utils.sha256,a=s(o);return(0,e.debug)("digest",{mode:t,prep:r,t:n,v:i,kekCat:o,f:s,r:a}),a}},e.hexToString=h.ethers.utils.toUtf8String;var _=function(t){return(255&t).toString(16).padStart(2,"0")};e.hexToBigNumber=function(t){return(0,d.bigNumberify)(function(t){return"0x"+t.replace(/^0x/,"")}(t))},e.makeRandom=function(t){var r=function(){return(0,e.hexToBigNumber)((r=f.default.randomBytes(t),Array.from(r,_).join("")));var r};return{randomUInt:r,hasRandom:{random:r}}},e.UInt256_max=h.ethers.BigNumber.from(2).pow(256).sub(1),e.makeArith=function(t){var r=function(t){return(0,m.checkedBigNumberify)("internal",e.UInt256_max,t)},n=function(e){return(0,m.checkedBigNumberify)("internal",t,e)},i=function(t){return t?r:n},o=function(t){return function(e){return function(r,n){return t(function(t,e,r){return e[t](r)}(e,(0,d.bigNumberify)(r),(0,d.bigNumberify)(n)))}}},s=o(r),u=o(n),c=function(t){return function(e){return function(r){return t(function(t,e){if("sqrt"===t)return function(t){for(var e=[t,t.div(2).add(1)],r=void 0;void 0===r;){var n=a(e,2),i=n[0],o=n[1];o.lt(2)?r=o:o.lt(i)?e=[o,t.div(o).add(o).div(2)]:r=o}return r}(e);throw Error("impossible BNOp1")}(e,(0,d.bigNumberify)(r)))}}},f=c(r),l=c(n);return{add:u("add"),sub:u("sub"),mod:u("mod"),mul:u("mul"),div:u("div"),band:u("and"),bior:u("or"),bxor:u("xor"),sqrt:l("sqrt"),add256:s("add"),sub256:s("sub"),mod256:s("mod"),mul256:s("mul"),div256:s("div"),band256:s("and"),bior256:s("or"),bxor256:s("xor"),sqrt256:f("sqrt"),cast:function(e,r,n,o){var s=i(e),a=i(r),u=(0,d.bigNumberify)(n);return a(s(o?u.and(t):u))},muldiv:function(t,e,r){var i=(0,d.bigNumberify)(t).mul((0,d.bigNumberify)(e));return n(i.div((0,d.bigNumberify)(r)))}}},e.argsSlice=function(t,e){return 0==e?[]:t.slice(-1*e)},e.argsSplit=function(t,e){return 0==e?[t,[]]:[t.slice(0,t.length-e),t.slice(-1*e)]},e.objectMap=function(t,e){return Object.keys(t).reduce((function(r,n){return r[n]=e(n,t[n]),r}),{})},e.mkAddressEq=function(t){return function(e,r){return(0,m.bytesEq)(t.canonicalize(e),t.canonicalize(r))}},e.ensureConnectorAvailable=function(t,r,n,i){(0,e.checkVersion)(t._backendVersion,n,"JavaScript backend");var o=t._Connectors,s=o[r];if(!s)throw new Error("The application was not compiled for the ".concat(r," connector, only: ").concat(Object.keys(o)));(0,e.checkVersion)(s.version,i,"".concat(r," backend"))},e.checkVersion=function(t,e,r){if(t!==e){var n=void 0===t||t<e?"update your compiler and recompile!":"update your standard library and rerun!";throw Error("This Reach compiled ".concat(r," does not match the expectations of this Reach standard library: expected ").concat(e,", but got ").concat(t,"; ").concat(n))}};var A=function(t,e,r){if(0!=t.length)return t.reduce((function(t,n){return r(e(n),e(t))?n:t}),t[0])};e.argMax=function(t,e){return A(t,e,(function(t,e){return t>e}))},e.argMin=function(t,e){return A(t,e,(function(t,e){return t<e}))},e.make_newTestAccounts=function(t){return{parallel:function(e,r){return Promise.all(function(t){return new Array(t).fill(1)}(e).map((function(e){return t(r)})))},serial:function(e,r){return o(void 0,void 0,void 0,(function(){var n,i,o,a;return s(this,(function(s){switch(s.label){case 0:n=[],i=0,s.label=1;case 1:return i<e?(a=(o=n).push,[4,t(r)]):[3,4];case 2:a.apply(o,[s.sent()]),s.label=3;case 3:return i++,[3,1];case 4:return[2,n]}}))}))}}},e.make_waitUntilX=function(t,r,n){return function(i,a){return o(void 0,void 0,void 0,(function(){var o,u,c;return s(this,(function(s){switch(s.label){case 0:return o=a||function(){},[4,r()];case 1:u=s.sent(),c=function(){var r={current:u,target:i};(0,e.debug)("waitUntilX:",t,r),o(r)},s.label=2;case 2:return u.lt(i)?((0,e.debug)("waitUntilX",{label:t,current:u,target:i}),[4,n(u.add(1))]):[3,4];case 3:return u=s.sent(),c(),[3,2];case 4:return c(),[2,u]}}))}))}},e.checkTimeout=function(t,r,n,i){return o(void 0,void 0,void 0,(function(){var o,u,c,f,l;return s(this,(function(s){switch(s.label){case 0:return(0,e.debug)("checkTimeout",{timeoutAt:n,nowTime:i}),n?(o=a(n,2),u=o[0],c=o[1],"time"!==u?[3,1]:[2,c.lte(i)]):[2,!1];case 1:if("secs"!==u)return[3,6];s.label=2;case 2:return s.trys.push([2,4,,5]),[4,r(i)];case 3:return l=s.sent(),[2,c.lte(l)];case 4:return f=s.sent(),(0,e.debug)("checkTimeout","err","".concat(f)),t()?(l=Math.floor(Date.now()/1e3),(0,e.debug)("checkTimeout","isolated",c.toString(),l),[2,c.lt(l-1)]):[2,!1];case 5:return[3,7];case 6:throw new Error("invalid TimeArg mode");case 7:return[2]}}))}))};var E=function(t){return o(void 0,void 0,void 0,(function(){return s(this,(function(t){return[2,!1]}))}))};e.makeEventQueue=function(t){var r=t.raw2proc,n=t.alwaysIgnored,i=t.getTxns,a=t.getTxnTime,u=void 0,c=[],f=(0,d.bigNumberify)(0),l=[],h=function(t){return!n(t)},p=function(t,n){return o(void 0,void 0,void 0,(function(){var o,d,p,m,g;return s(this,(function(b){switch(b.label){case 0:if(o="".concat(t," peq"),d=function(t){return f.lt(t)&&((0,e.debug)(o,"updating ctime",{ctime:f,ntime:t}),f=t),t},void 0===u)throw Error("".concat(o,": not initialized"));p=0,m=function(){var t,m,g,b,y,v,w,_,A;return s(this,(function(s){switch(s.label){case 0:return[4,i(o,u,f,p++)];case 1:for(t=s.sent(),m=t.txns,g=t.gtime,0===m.length&&g?d(g):(b=function(t){return d(a(t))},y=function(t,e){return b(t).sub(b(e)).toNumber()},m.sort(y),1===m.length&&b(m[0]),m=m.filter(h)),v=l;m.length>0&&v.length>0;){if(w=v[0],v.shift(),_=m[0],m.shift(),!w(_))throw Error("".concat(o," customIgnore present, ").concat(w,", but top txn did not match ").concat((0,e.j2s)(_)));(0,e.debug)(o,"ignored",w,_)}return(A=0===m.length)?[4,n(f)]:[3,3];case 2:A=s.sent(),s.label=3;case 3:return A?[2,{value:{timeout:!0,time:f}}]:(c=m.map(r),[2])}}))},b.label=1;case 1:return 0!==c.length?[3,3]:[5,m()];case 2:return"object"==typeof(g=b.sent())?[2,g.value]:[3,1];case 3:return[2,{timeout:!1,txn:c[0]}]}}))}))};return{isInited:function(){return void 0!==u},init:function(t){(0,m.assert)(void 0===u,"init: must be uninitialized"),u=t},peq:p,deq:function(t){return o(void 0,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,p(t,E)];case 1:if((e=r.sent()).timeout)throw Error("impossible");return c.shift(),[2,e.txn]}}))}))},pushIgnore:function(t){(0,m.assert)(void 0!==u,"pushIgnore: must be initialized"),l.push(t)}}},e.makeEventStream=function(t){var r=t.eq,n=t.getTxnTime,i=t.sync,a=t.getNetworkTime,u=t.getLogs,c=t.parseLog,f=(0,d.bigNumberify)(0),l=[],h=function(t){(0,m.assert)(f.lt(t),"seek must seek future"),(0,e.debug)("EventStream::seek",t),f=t,l=[]},p=function(){return o(void 0,void 0,void 0,(function(){var t,o,a,h,d;return s(this,(function(s){switch(s.label){case 0:return[4,i()];case 1:s.sent(),t="EventStream::next",o=void 0,s.label=2;case 2:if(void 0!==o)return[3,6];s.label=3;case 3:return 0!==l.length?[3,5]:[4,r.deq(t)];case 4:return a=s.sent(),(0,e.debug)(t,{txn:a}),(h=n(a)).gte(f)&&(f=h,l=u(a),(0,e.debug)(t,{time:f,logs:l})),[3,3];case 5:return d=l[0],l.shift(),o=c(d),(0,e.debug)(t,{parsedLog:o,l:d}),[3,2];case 6:return(0,e.debug)(t,"ret"),[2,{when:f,what:o}]}}))}))};return{lastTime:function(){return o(void 0,void 0,void 0,(function(){return s(this,(function(t){return[2,f]}))}))},seek:h,seekNow:function(){return o(void 0,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:return t=h,[4,a()];case 1:return[2,t.apply(void 0,[e.sent()])]}}))}))},monitor:function(t){return o(void 0,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return e=t,[4,p()];case 1:return e.apply(void 0,[r.sent()]),[3,0];case 2:return[2]}}))}))},next:p}},e.getQueryLowerBound=function(){return console.log("WARNING: getQueryLowerBound() is deprecated and does nothing."),(0,d.bigNumberify)(0)},e.setQueryLowerBound=function(t){console.log("WARNING: setQueryLowerBound() is deprecated and does nothing.")};var S=function(){var t=function(t){throw new Error("promise never initialized")};return[new Promise((function(e){t=e})),t]},M=function(){function t(){var t;t=a(S(),2),this.p=t[0],this.r=t[1]}return t.prototype.wait=function(){return this.p},t.prototype.notify=function(){this.r(!0)},t}();e.Signal=M;var x=function(){function t(){this.locked=!1}return t.prototype.acquire=function(){return o(this,void 0,void 0,(function(){var t;return s(this,(function(e){switch(e.label){case 0:t=1,e.label=1;case 1:return this.locked?[4,l.default.set(Math.min(512,t))]:[3,3];case 2:return e.sent(),t*=2,[3,1];case 3:return this.locked=!0,[2]}}))}))},t.prototype.release=function(){this.locked=!1},t.prototype.runWith=function(t){return o(this,void 0,void 0,(function(){var e,r;return s(this,(function(n){switch(n.label){case 0:return[4,this.acquire()];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),[4,t()];case 3:return e=n.sent(),this.release(),[2,e];case 4:throw r=n.sent(),this.release(),r;case 5:return[2]}}))}))},t}();function k(t){return 0===t.length}e.Lock=x,e.isNone=k,e.isSome=function(t){return!k(t)},e.Some=function(t){return[t]},e.None=[],e.retryLoop=function(t,e){return o(void 0,void 0,void 0,(function(){var r,n;return s(this,(function(i){switch(i.label){case 0:r=0,i.label=1;case 1:i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e()];case 3:return[2,i.sent()];case 4:return n=i.sent(),console.log("retryLoop",{lab:t,retries:r,e:n}),r++,[3,5];case 5:return[3,1];case 6:return[2]}}))}))},e.makeSigningMonitor=function(){var t=void 0;return[function(e){t=e},function(e,r){return o(void 0,void 0,void 0,(function(){var n,i,u,c;return s(this,(function(f){switch(f.label){case 0:return t?(n=a(S(),2),i=n[0],u=n[1],t(e,r,i),c=function(t){return o(void 0,void 0,void 0,(function(){var e;return s(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return e=r.sent(),u(e),[2,e]}}))}))},[4,r]):[3,2];case 1:return[2,[f.sent(),c]];case 2:return[4,r];case 3:return[2,[f.sent(),function(t){return t}]]}}))}))}]},e.handleFormat=function(t,e,r){if(void 0===r&&(r=6),!(Number.isInteger(e)&&0<=e))throw Error("Expected decimals to be a nonnegative integer, but got ".concat(e,"."));if(!(Number.isInteger(r)&&0<=r))throw Error("Expected split value to be a nonnegative integer, but got ".concat(e,"."));var n=(0,d.bigNumberify)(t).toString(),i=Math.max(n.length-r,0),o=function(t,e){for(;"0"===t[0];)t=t.slice(1);return t}(n.slice(0,i))||"0";if(0===e)return o;var s,a,u=function(t,e){for(;"0"===t[t.length-1];)t=t.slice(0,t.length-1);return t}((s=n.slice(i),a=r,"0".repeat(Math.max(a-s.length,0))+s).slice(0,e));return u?"".concat(o,".").concat(u):o},e.formatWithDecimals=function(t,r){return(0,e.handleFormat)(t,r,r)},e.apiStateMismatchError=function(t,e,r){var n=function(e){return(0,m.formatAssertInfo)(t._stateSourceMap[e.toNumber()])},i=n(e),o=n(r);return Error("Expected the DApp to be in state ".concat(e,", but it was actually in state ").concat(r,".\n")+"\nState ".concat(e," corresponds to the commit() at ").concat(i)+"\nState ".concat(r," corresponds to the commit() at ").concat(o)+(i==o?"\n(This means that the commit() is in the continuation of impure control-flow.)":""))}},135:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},i=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};e.__esModule=!0,e.disconnect=e.withDisconnect=e.numberToInt=e.numberToFixedPoint=e.hasConsoleLogger=e.parseInt=e.parseFixedPoint=e.bigNumberToHex=e.uintToBytes=e.bigNumberToBigInt=e.isBigNumber=e.hexToBigNumber=e.bigNumberToNumber=e.bigNumberify=e.stringToHex=e.isHex=void 0;var o=r(3825),s=r(1923);e.bigNumberify=s.bigNumberify,e.bigNumberToNumber=s.bigNumberToNumber;var a=r(3653);e.hexToBigNumber=a.hexToBigNumber;var u=r(6549);e.isHex=u.isHex,e.stringToHex=u.stringToHex;var c=o.ethers.BigNumber;e.isBigNumber=c.isBigNumber,e.bigNumberToBigInt=function(t){return BigInt((0,s.bigNumberify)(t).toHexString())},e.uintToBytes=function(t){return(0,e.bigNumberToHex)(t)},e.bigNumberToHex=function(t,e){void 0===e&&(e=32);var r=8*e,n="ufixed".concat(r,"x0"),i=(0,s.bigNumberify)(t).toTwos(r),u=o.ethers.FixedNumber.from(i.toString(),n);return(0,a.hexlify)(u).slice(2)},e.parseFixedPoint=function(t){return(0,e.parseInt)({sign:t.sign,i:t.i.i})/(0,s.bigNumberify)(t.i.scale).toNumber()},e.parseInt=function(t){return(0,s.bigNumberify)(t.i).toNumber()*(t.sign?1:-1)},e.hasConsoleLogger={log:console.log},e.numberToFixedPoint=function(t){var e=t.toString(),r=e.includes(".")?e.split(".")[1].length:0,n=Math.pow(10,r);return{sign:t>=0,i:{scale:(0,s.bigNumberify)(n),i:(0,s.bigNumberify)(t*n)}}},e.numberToInt=function(t){var e=t>=0;return{sign:e,i:(0,s.bigNumberify)(e?t:-t)}};var f=Symbol("Reach disconnect");e.withDisconnect=function(t){return n(void 0,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t()];case 1:return[2,r.sent()];case 2:if(e=r.sent(),Array.isArray(e)&&e[0]===f)return[2,e[1]];throw e;case 3:return[2]}}))}))},e.disconnect=function(t){throw[f,t]}},2130:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.window=e.process=e.updateProcessEnv=void 0;var i=r(3653),o=n(r(1898)),s=function(){try{if(0===Object.keys(process.env).length)throw Error("nothing in process.env");return process}catch(t){return{_reachShim:!0,env:{REACH_CONNECTOR_MODE:"ETH-browser"},stdout:{write:function(){}},argv:[],exit:function(t){console.warn("Ignoring attempt to exit with code",t)}}}}();e.process=s,e.updateProcessEnv=function(t){var e=s.env;for(var r in t)e[r.replace(/^REACT_APP_/,"")]=t[r];(0,i.setDEBUG)((0,i.truthyEnv)(e.REACH_DEBUG))};var a=function(){try{return window}catch(t){return{_reachShim:!0,fetch:o.default}}}();e.window=a},8922:(t,e)=>{"use strict";e.__esModule=!0,e.default={contracts:{"sol/stdlib.sol:Context":{abi:[],bin:""},"sol/stdlib.sol:ERC20":{abi:[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],bin:"60806040523480156200001157600080fd5b5060405162000b6038038062000b608339810160408190526200003491620001db565b81516200004990600390602085019062000068565b5080516200005f90600490602084019062000068565b50505062000282565b828054620000769062000245565b90600052602060002090601f0160209004810192826200009a5760008555620000e5565b82601f10620000b557805160ff1916838001178555620000e5565b82800160010185558215620000e5579182015b82811115620000e5578251825591602001919060010190620000c8565b50620000f3929150620000f7565b5090565b5b80821115620000f35760008155600101620000f8565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200013657600080fd5b81516001600160401b03808211156200015357620001536200010e565b604051601f8301601f19908116603f011681019082821181831017156200017e576200017e6200010e565b816040528381526020925086838588010111156200019b57600080fd5b600091505b83821015620001bf5785820183015181830184015290820190620001a0565b83821115620001d15760008385830101525b9695505050505050565b60008060408385031215620001ef57600080fd5b82516001600160401b03808211156200020757600080fd5b620002158683870162000124565b935060208501519150808211156200022c57600080fd5b506200023b8582860162000124565b9150509250929050565b600181811c908216806200025a57607f821691505b602082108114156200027c57634e487b7160e01b600052602260045260246000fd5b50919050565b6108ce80620002926000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101c6565b6040516100c3919061070b565b60405180910390f35b6100df6100da36600461077c565b610258565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f3660046107a6565b610270565b604051601281526020016100c3565b6100df61013136600461077c565b610294565b6100f36101443660046107e2565b6001600160a01b031660009081526020819052604090205490565b6100b66102d3565b6100df61017536600461077c565b6102e2565b6100df61018836600461077c565b610379565b6100f361019b366004610804565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101d590610837565b80601f016020809104026020016040519081016040528092919081815260200182805461020190610837565b801561024e5780601f106102235761010080835404028352916020019161024e565b820191906000526020600020905b81548152906001019060200180831161023157829003601f168201915b5050505050905090565b600033610266818585610387565b5060019392505050565b60003361027e8582856104ab565b61028985858561053d565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061026690829086906102ce908790610872565b610387565b6060600480546101d590610837565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091908381101561036c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6102898286868403610387565b60003361026681858561053d565b6001600160a01b0383166103e95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610363565b6001600160a01b03821661044a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610363565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610537578181101561052a5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610363565b6105378484848403610387565b50505050565b6001600160a01b0383166105a15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610363565b6001600160a01b0382166106035760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610363565b6001600160a01b0383166000908152602081905260409020548181101561067b5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610363565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906106b2908490610872565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106fe91815260200190565b60405180910390a3610537565b600060208083528351808285015260005b818110156107385785810183015185820160400152820161071c565b8181111561074a576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461077757600080fd5b919050565b6000806040838503121561078f57600080fd5b61079883610760565b946020939093013593505050565b6000806000606084860312156107bb57600080fd5b6107c484610760565b92506107d260208501610760565b9150604084013590509250925092565b6000602082840312156107f457600080fd5b6107fd82610760565b9392505050565b6000806040838503121561081757600080fd5b61082083610760565b915061082e60208401610760565b90509250929050565b600181811c9082168061084b57607f821691505b6020821081141561086c57634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561089357634e487b7160e01b600052601160045260246000fd5b50019056fea264697066735822122096c8cb7f4d8490e7ee56793e8a977c7b6a7ad97530b834d1069963909a60d5a064736f6c634300080c0033"},"sol/stdlib.sol:IERC20":{abi:[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],bin:""},"sol/stdlib.sol:IERC20Metadata":{abi:[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],bin:""},"sol/stdlib.sol:ReachToken":{abi:[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"url_",type:"string"},{internalType:"string",name:"metadata_",type:"string"},{internalType:"uint256",name:"supply_",type:"uint256"},{internalType:"uint256",name:"decimals_",type:"uint256"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"destroy",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"metadata",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"url",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],bin:"60806040523480156200001157600080fd5b506040516200108738038062001087833981016040819052620000349162000341565b8551869086906200004d906003906020850190620001ce565b50805162000063906004906020840190620001ce565b506200006f9150503390565b600580546001600160a01b0319166001600160a01b039290921691821790556200009a9083620000e6565b8351620000af906006906020870190620001ce565b508251620000c5906007906020860190620001ce565b506008805460ff191660ff9290921691909117905550620004709350505050565b6001600160a01b038216620001415760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b80600260008282546200015591906200040c565b90915550506001600160a01b03821660009081526020819052604081208054839290620001849084906200040c565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620001dc9062000433565b90600052602060002090601f0160209004810192826200020057600085556200024b565b82601f106200021b57805160ff19168380011785556200024b565b828001600101855582156200024b579182015b828111156200024b5782518255916020019190600101906200022e565b50620002599291506200025d565b5090565b5b808211156200025957600081556001016200025e565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200029c57600080fd5b81516001600160401b0380821115620002b957620002b962000274565b604051601f8301601f19908116603f01168101908282118183101715620002e457620002e462000274565b816040528381526020925086838588010111156200030157600080fd5b600091505b8382101562000325578582018301518183018401529082019062000306565b83821115620003375760008385830101525b9695505050505050565b60008060008060008060c087890312156200035b57600080fd5b86516001600160401b03808211156200037357600080fd5b620003818a838b016200028a565b975060208901519150808211156200039857600080fd5b620003a68a838b016200028a565b96506040890151915080821115620003bd57600080fd5b620003cb8a838b016200028a565b95506060890151915080821115620003e257600080fd5b50620003f189828a016200028a565b9350506080870151915060a087015190509295509295509295565b600082198211156200042e57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c908216806200044857607f821691505b602082108114156200046a57634e487b7160e01b600052602260045260246000fd5b50919050565b610c0780620004806000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c806342966c681161009757806395d89b411161006657806395d89b41146101de578063a457c2d7146101e6578063a9059cbb146101f9578063dd62ed3e1461020c57600080fd5b806342966c68146101905780635600f04f146101a357806370a08231146101ab57806383197ef0146101d457600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063392f37e914610175578063395093511461017d57600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b610102610245565b60405161010f9190610a0c565b60405180910390f35b61012b610126366004610a7d565b6102d7565b604051901515815260200161010f565b6002545b60405190815260200161010f565b61012b61015b366004610aa7565b6102ef565b60085460405160ff909116815260200161010f565b610102610313565b61012b61018b366004610a7d565b610322565b61012b61019e366004610ae3565b610361565b6101026103dc565b61013f6101b9366004610afc565b6001600160a01b031660009081526020819052604090205490565b6101dc6103eb565b005b610102610492565b61012b6101f4366004610a7d565b6104a1565b61012b610207366004610a7d565b610533565b61013f61021a366004610b1e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461025490610b51565b80601f016020809104026020016040519081016040528092919081815260200182805461028090610b51565b80156102cd5780601f106102a2576101008083540402835291602001916102cd565b820191906000526020600020905b8154815290600101906020018083116102b057829003601f168201915b5050505050905090565b6000336102e5818585610541565b5060019392505050565b6000336102fd858285610666565b6103088585856106f8565b506001949350505050565b60606007805461025490610b51565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906102e5908290869061035c908790610ba2565b610541565b6005546000906001600160a01b0316336001600160a01b0316146103be5760405162461bcd60e51b815260206004820152600f60248201526e36bab9ba1031329031b932b0ba37b960891b60448201526064015b60405180910390fd5b6005546103d4906001600160a01b0316836108c6565b506001919050565b60606006805461025490610b51565b6005546001600160a01b0316336001600160a01b0316146104405760405162461bcd60e51b815260206004820152600f60248201526e36bab9ba1031329031b932b0ba37b960891b60448201526064016103b5565b600254156104845760405162461bcd60e51b81526020600482015260116024820152706d757374206265206e6f20737570706c7960781b60448201526064016103b5565b6005546001600160a01b0316ff5b60606004805461025490610b51565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156105265760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b5565b6103088286868403610541565b6000336102e58185856106f8565b6001600160a01b0383166105a35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b5565b6001600160a01b0382166106045760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b5565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146106f257818110156106e55760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103b5565b6106f28484848403610541565b50505050565b6001600160a01b03831661075c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b5565b6001600160a01b0382166107be5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b5565b6001600160a01b038316600090815260208190526040902054818110156108365760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b5565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061086d908490610ba2565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108b991815260200190565b60405180910390a36106f2565b6001600160a01b0382166109265760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b5565b6001600160a01b0382166000908152602081905260409020548181101561099a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b5565b6001600160a01b03831660009081526020819052604081208383039055600280548492906109c9908490610bba565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610659565b600060208083528351808285015260005b81811015610a3957858101830151858201604001528201610a1d565b81811115610a4b576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610a7857600080fd5b919050565b60008060408385031215610a9057600080fd5b610a9983610a61565b946020939093013593505050565b600080600060608486031215610abc57600080fd5b610ac584610a61565b9250610ad360208501610a61565b9150604084013590509250925092565b600060208284031215610af557600080fd5b5035919050565b600060208284031215610b0e57600080fd5b610b1782610a61565b9392505050565b60008060408385031215610b3157600080fd5b610b3a83610a61565b9150610b4860208401610a61565b90509250929050565b600181811c90821680610b6557607f821691505b60208210811415610b8657634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610bb557610bb5610b8c565b500190565b600082821015610bcc57610bcc610b8c565b50039056fea26469706673582212201d374555cf587805c0a6bb5a36d9fd9009be0cae2cb47908b5535e6f42f7c39764736f6c634300080c0033"},"sol/stdlib.sol:Stdlib":{abi:[],bin:"6080604052348015600f57600080fd5b50603f80601d6000396000f3fe6080604052600080fdfea26469706673582212206854c68553499a446c3a21c0831ef27f15769a3db730aa18c4d9326cc7251e7364736f6c634300080c0033"}},version:"0.8.12+commit.f00d7308.Linux.g++"}},1316:function(t,e,r){"use strict";var n=r(2486).Buffer,i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},i.apply(this,arguments)},o=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),s=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(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)&&o(e,t,r);return s(e,t),e},u=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},c=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},f=this&&this.__read||function(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(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},l=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))};e.__esModule=!0,e.makeChkExport=e.run=e.one=e.chkErr=e.chk=e.shouldRunExac=e.shouldRun=void 0;for(var h=r(2130),d=a(r(4258)),p=l([],f(h.process.argv),!1);p.length>0&&"---"!==p[0];)p.shift();p.shift();var m=function(t){return p.some((function(e){return t.includes(e)}))};e.shouldRun=function(t){return 0===p.length||m(t)},e.shouldRunExac=function(t){return 0!==p.length&&m(t)};var g=[],b=0,y=0;e.chk=function(t,e,r,n){void 0===n&&(n={}),b++;var o,s,a=JSON.stringify(n,null,2),u=JSON.stringify(r,null,2),c=JSON.stringify(e,null,2);"{}"===c&&(c=e.toString()),u!==c?(y++,s="".concat(a,"\nexpected ").concat(u,", got ").concat(c),o="FAIL"):o="SUCC",g.push({id:t,time:null==n?void 0:n.time,err:s}),o&&((null==r?void 0:r._isBigNumber)&&(r=r.toString()),(null==e?void 0:e._isBigNumber)&&(e=e.toString()),console.log(o,d.inspect(i(i({},n),{id:t,expected:r,actual:e}),{depth:null,sorted:!0,colors:!0})))},e.chkErr=function(t,r,n,o){return void 0===o&&(o={}),u(void 0,void 0,void 0,(function(){var s,a,u,f,l;return c(this,(function(c){switch(c.label){case 0:a=(s=function(t){return t.replace(/\0/g,"").replace(/\\u0000/g,"")})(r),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,n()];case 2:throw u=c.sent(),Error("Expected error, but got ".concat(JSON.stringify(u)));case 3:if(f=c.sent(),"[object Object]"===(l="object"==typeof f&&null!==f?f.toString():"".concat(f)))try{l=JSON.stringify(f)}catch(t){}return l=s(l),(0,e.chk)(t,l.includes(a),!0,i(i({},o),{e:f,es:l,exps:a})),[3,4];case 4:return[2]}}))}))};var v=function(t,r,n){return void 0===n&&(n={}),u(void 0,void 0,void 0,(function(){var o,s,a,u,f;return c(this,(function(c){switch(c.label){case 0:o=Date.now(),s=void 0,a=void 0,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,r()];case 2:return s=c.sent(),[3,4];case 3:return u=c.sent(),a=u,[3,4];case 4:return f=Date.now(),(0,e.chk)(t,a,void 0,i(i({},n),{time:(f-o)/1e3})),[2,s]}}))}))},w=[];e.one=function(t,r){(0,e.shouldRun)(t)&&w.push((function(){return u(void 0,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,v(t,r)];case 1:return e.sent(),[2]}}))}))}))},e.run=function(t){return u(void 0,void 0,void 0,(function(){var e,r,i,o,s,a,u,f,l;return c(this,(function(c){switch(c.label){case 0:e=void 0===(null==t?void 0:t.exitOnFail)||t.exitOnFail,r=function(){return e&&y>0},i=(null==t?void 0:t.howManyAtOnce)||1,console.log("".concat(w.length," jobs scheduled, running...")),c.label=1;case 1:if(r()||!(w.length>0))return[3,3];for(console.log("Spawning ".concat(i," of ").concat(w.length," jobs")),o=[];w.length>0&&o.length<i;)(s=w.shift())&&o.push(s());return console.log("Waiting for ".concat(o.length," jobs")),[4,Promise.all(o)];case 2:return c.sent(),[3,1];case 3:return console.log("Done running"),(a=[]).push('<?xml version="1.0" encoding="UTF-8"?>'),a.push("<testsuite>"),g.forEach((function(t){var e=t.id,r=t.time,n=t.err,i=r?' time="'.concat(r,'"'):"",o=n?"<failure>".concat(n,"</failure>"):"",s=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;");a.push('<testcase name="'.concat(s,'"').concat(i,">").concat(o,"</testcase>"))})),a.push("</testsuite>"),u=n.from(a.join("")),(f=function(t,e){return console.log("var ".concat(t,"='").concat(e,"'"))})("RESULTS_B64",u.toString("base64")),f("SUMMARY",(l=0!==y)?"".concat(y," of ").concat(b," tests failed!"):"".concat(b," tests passed!")),f("STATUS",l?":warning: FAIL":":pizza: OKAY"),h.process.exit(l?1:0),[2]}}))}))},e.makeChkExport=function(t,r){var n=r.getExports(t);return[n,function(t,r){(0,e.one)(t,(function(){return u(void 0,void 0,void 0,(function(){var i,o,s;return c(this,(function(a){if(!(i=n[t]))throw Error("".concat(t," is not exported from backend: [").concat(Object.keys(e).sort().join(", "),"]"));return o=function(e){return"".concat(t,"(").concat(JSON.stringify(e),")")},s=function(t,r){return u(void 0,void 0,void 0,(function(){var n,s,a;return c(this,(function(u){switch(u.label){case 0:return n=o(t),s=e.chk,a=[n],[4,v(n,(function(){return i.apply(void 0,l([],f(t),!1))}),{dom:t})];case 1:return s.apply(void 0,a.concat([u.sent(),r,{dom:t}])),[2]}}))}))},r(s,(function(t,r){return(0,e.chkErr)(o(r),t,(function(){return i.apply(void 0,l([],f(r),!1))}),{dom:r})})),[2]}))}))}))}]}},1218:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},i=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0,e.Lock=e.Signal=e.Timeout=e.thread=void 0;var s=o(r(138));e.Timeout=s.default;var a=r(3653);e.Signal=a.Signal,e.Lock=a.Lock,e.thread=function(t){return n(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,t()];case 1:return[2,e.sent()]}}))}))}},2196:(t,e)=>{"use strict";e.__esModule=!0,e.VERSION=void 0,e.VERSION="0.1.10"},799:function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}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())}))},i=this&&this.__generator||function(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=(i=s.trys).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]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};e.__esModule=!0;var s=o(r(9)),a=o(r(5359)),u=r(3653),c={"https:":443,"http:":80};e.default=function(t,e){return void 0===e&&(e=void 0),n(this,void 0,void 0,(function(){var r,n,o,f,l,h,d;return i(this,(function(i){switch(i.label){case 0:if(!(s.default instanceof Function))return[2];if(!(a.default&&a.default.parse instanceof Function))return[2];if(r=a.default.parse(t),n=r.hostname,o=r.port,"http:"!==(f=r.protocol)&&"https:"!==f)throw Error("Unsupported protocol ".concat(f));return h="string"==typeof(l=o||e)&&parseInt(l,10)||"number"==typeof l&&l||c[f],d={host:n||void 0,port:h,output:"silent",timeout:6e4},(0,u.debug)("waitPort",{uri:t,givenPort:e,thePort:l,testPort:h},d),[4,(0,s.default)(d)];case 1:return i.sent(),(0,u.debug)("waitPort complete"),[2]}}))}))}},8677:()=>{},2808:()=>{},6601:()=>{},9214:()=>{},1922:()=>{},2363:()=>{},5568:()=>{},2361:()=>{},4616:()=>{},9098:()=>{},800:()=>{},1787:()=>{},5359:()=>{},4258:()=>{},9:()=>{},4946:t=>{"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:t=>{"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:t=>{"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},9799:t=>{"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:t=>{"use strict";t.exports={i8:"6.5.4"}},2562:t=>{"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};return __webpack_modules__[t].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return __webpack_require__.d(e,{a:e}),e},__webpack_require__.d=(t,e)=>{for(var r in e)__webpack_require__.o(e,r)&&!__webpack_require__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var __webpack_exports__=__webpack_require__(3254);return __webpack_exports__})()));
//# sourceMappingURL=reachsdk.min.js.map