UNPKG

jcc-bizain-utils

Version:

Toolkit of crossing chain from Bizain chain to SWTC chain

19 lines 382 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.jcc_bizain_utils=e():t.jcc_bizain_utils=e()}(window,function(){return r={},t.m=e=[function(t,e,r){"use strict";var n=e;n.version=r(93).version,n.utils=r(94),n.rand=r(34),n.curve=r(17),n.curves=r(99),n.ec=r(101),n.eddsa=r(105)},function(t,e,r){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(null!==t&&"object"==typeof t&&Array.isArray(t.words))return t;this.sign=!1,this.words=null,this.length=0,"le"!==e&&"be"!==e||(r=e,e=10),(this.red=null)!==t&&this._init(t||0,e||10,r||"be")}function o(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|=49<=s&&s<=54?s-49+10:17<=s&&s<=22?s-17+10:15&s}return n}function s(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+=49<=a?a-49+10:17<=a?a-17+10:a}return i}"object"==typeof t?t.exports=i:e.BN=i,(i.BN=i).wordSize=26,i.max=function(t,e){return 0<t.cmp(e)?t:e},i.min=function(t,e){return t.cmp(e)<0?t:e},i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&2<=e&&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.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.sign=!0,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("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=0;if("be"===n){i=t.length-1;for(var s=0;0<=i;i-=3){var a=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[s]|=a<<o&67108863,this.words[s+1]=a>>>26-o&67108863,26<=(o+=24)&&(o-=26,s++)}}else if("le"===n)for(i=0,s=0;i<t.length;i+=3)a=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[s]|=a<<o&67108863,this.words[s+1]=a>>>26-o&67108863,26<=(o+=24)&&(o-=26,s++);return this.strip()},i.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;for(var n=0,i=(r=t.length-6,0);e<=r;r-=6){var s=o(t,r,r+6);this.words[i]|=s<<n&67108863,this.words[i+1]|=s>>>26-n&4194303,26<=(n+=24)&&(n-=26,i++)}r+6!==e&&(s=o(t,e,r+6),this.words[i]|=s<<n&67108863,this.words[i+1]|=s>>>26-n&4194303),this.strip()},i.prototype._parseBase=function(t,e,r){this.words=[0];for(var n=0,i=this.length=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,f=Math.min(o,o-a)+r,u=0,c=r;c<f;c+=n)u=s(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!=a){var h=1;for(u=s(t,c,t.length,e),c=0;c<a;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},i.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.sign=this.sign,t.red=this.red},i.prototype.clone=function(){var t=new i(null);return this.copy(t),t},i.prototype.strip=function(){for(;1<this.length&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var a=["","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],u=[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 c(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}i.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){for(var n="",i=0,o=0,s=0;s<this.length;s++){var c=this.words[s],h=(16777215&(c<<i|o)).toString(16);n=0!=(o=c>>>24-i&16777215)||s!==this.length-1?a[6-h.length]+h+n:h+n,26<=(i+=2)&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&2<=t&&t<=36){var d=f[t],l=u[t],p=(n="",this.clone());for(p.sign=!1;0!==p.cmpn(0);){var b=p.modn(l).toString(t);n=0!==(p=p.idivn(l)).cmpn(0)?a[d-b.length]+b+n:b+n}for(0===this.cmpn(0)&&(n="0"+n);n.length%e!=0;)n="0"+n;return this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t,e){this.strip();var n="le"===t,i=new Array(this.byteLength());i[0]=0;var o=this.clone();if(n)for(s=0;0!==o.cmpn(0);s++)a=o.andln(255),o.iushrn(8),i[s]=a;else for(var s=0;0!==o.cmpn(0);s++){var a=o.andln(255);o.iushrn(8),i[i.length-s-1]=a}if(e)for(r(i.length<=e,"byte array longer than desired length");i.length<e;)n?i.push(0):i.unshift(0);return i},i.prototype._countBits=Math.clz32?function(t){return 32-Math.clz32(t)}:function(t){var e=t,r=0;return 4096<=e&&(r+=13,e>>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(r+=2,e>>>=2),r+e},i.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},i.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},i.prototype.zeroBits=function(){if(0===this.cmpn(0))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},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.neg=function(){if(0===this.cmpn(0))return this.clone();var t=this.clone();return t.sign=!this.sign,t},i.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()},i.prototype.ior=function(t){return r(!this.sign&&!t.sign),this.iuor(t)},i.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},i.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()},i.prototype.iand=function(t){return r(!this.sign&&!t.sign),this.iuand(t)},i.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},i.prototype.iuxor=function(t){var e,r;r=this.length>t.length?(e=this,t):(e=t,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()},i.prototype.ixor=function(t){return r(!this.sign&&!t.sign),this.iuxor(t)},i.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},i.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},i.prototype.setn=function(t,e){r("number"==typeof t&&0<=t);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return this.words[n]=e?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(t){if(this.sign&&!t.sign){this.sign=!1;var e=this.isub(t);return this.sign=!this.sign,this._normSign()}if(!this.sign&&t.sign)return t.sign=!1,e=this.isub(t),t.sign=!0,e._normSign();var r,n;n=this.length>t.length?(r=this,t):(r=t,this);for(var i=0,o=0;o<n.length;o++)e=r.words[o]+n.words[o]+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=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},i.prototype.add=function(t){if(t.sign&&!this.sign){t.sign=!1;var e=this.sub(t);return t.sign=!0,e}return t.sign||!this.sign?this.length>t.length?this.clone().iadd(t):t.clone().iadd(this):(this.sign=!1,e=t.sub(this),this.sign=!0,e)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.sign=!1,this.length=1,this.words[0]=0,this;n=0<i?(r=this,t):(r=t,this);for(var o=0,s=0;s<n.length;s++)o=(e=r.words[s]-n.words[s]+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=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.sign=!0),this.strip()},i.prototype.sub=function(t){return this.clone().isub(t)},i.prototype._smallMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0;n<e.length-1;n++){for(var i=r>>>26,o=67108863&r,s=Math.min(n,t.length-1),a=Math.max(0,n-this.length+1);a<=s;a++){var f=n-a,u=(0|this.words[f])*(0|t.words[a]),c=67108863&u;o=67108863&(c=c+o|0),i=(i=i+(u/67108864|0)|0)+(c>>>26)|0}e.words[n]=o,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i<e.length-1;i++){var o=n;n=0;for(var s=67108863&r,a=Math.min(i,t.length-1),f=Math.max(0,i-this.length+1);f<=a;f++){var u=i-f,c=(0|this.words[u])*(0|t.words[f]),h=67108863&c;s=67108863&(h=h+s|0),n+=(o=(o=o+(c/67108864|0)|0)+(h>>>26)|0)>>>26,o&=67108863}e.words[i]=s,r=o,o=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){return this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;0<=n;n--){for(var i=0,o=0,s=Math.min(n,r-1),a=Math.max(0,n-e+1);a<=s;a++){var f=n-a,u=this.words[f]*t.words[a],c=67108863&u;i+=u/67108864|0,o=67108863&(c+=o),i+=c>>>26}this.words[n]=o,this.words[n+1]+=i,i=0}for(i=0,f=1;f<this.length;f++){var h=this.words[f]+i;this.words[f]=67108863&h,i=h>>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n<this.length;n++){var i=this.words[n]*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.pow=function(t){var e=c(t);if(0===e.length)return new i(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var o=r.sqr();n<e.length;n++,o=o.sqr())0!==e[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(t){r("number"==typeof t&&0<=t);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!=e){for(var o=0,s=0;s<this.length;s++){var a=this.words[s]&i,f=this.words[s]-a<<e;this.words[s]=f|o,o=a>>>26-e}o&&(this.words[s]=o,this.length++)}if(0!=n){for(s=this.length-1;0<=s;s--)this.words[s+n]=this.words[s];for(s=0;s<n;s++)this.words[s]=0;this.length+=n}return this.strip()},i.prototype.ishln=function(t){return r(!this.sign),this.iushln(t)},i.prototype.iushrn=function(t,e,n){var i;r("number"==typeof t&&0<=t),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,f=n;if(i-=s,i=Math.max(0,i),f){for(var u=0;u<s;u++)f.words[u]=this.words[u];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;0<=u&&(0!==c||i<=u);u--){var h=this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&a}return f&&0!==c&&(f.words[f.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.ishrn=function(t,e,n){return r(!this.sign),this.iushrn(t,e,n)},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.ushln=function(t){return this.clone().iushln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.ushrn=function(t){return this.clone().iushrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&0<=t);var e=t%26,n=(t-e)/26,i=1<<e;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(t){r("number"==typeof t&&0<=t);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!=e&&n++,this.length=Math.min(n,this.length),0!=e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(t){return this.clone().imaskn(t)},i.prototype.iaddn=function(t){return r("number"==typeof t),t<0?this.isubn(-t):this.sign?(1===this.length&&this.words[0]<t?(this.words[0]=t-this.words[0],this.sign=!1):(this.sign=!1,this.isubn(t),this.sign=!0),this):this._iaddn(t)},i.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&67108864<=this.words[e];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},i.prototype.isubn=function(t){if(r("number"==typeof t),t<0)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},i.prototype.addn=function(t){return this.clone().iaddn(t)},i.prototype.subn=function(t){return this.clone().isubn(t)},i.prototype.iabs=function(){return this.sign=!1,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(t,e,n){var i=t.length+n;if(this.words.length<i){for(var o=new Array(i),s=0;s<this.length;s++)o[s]=this.words[s];this.words=o}else s=this.length;for(this.length=Math.max(this.length,i);s<this.length;s++)this.words[s]=0;var a=0;for(s=0;s<t.length;s++){var f=this.words[s+n]+a,u=t.words[s]*e;a=((f-=67108863&u)>>26)-(u/67108864|0),this.words[s+n]=67108863&f}for(;s<this.length-n;s++)a=(f=this.words[s+n]+a)>>26,this.words[s+n]=67108863&f;if(0===a)return this.strip();for(r(-1===a),s=a=0;s<this.length;s++)a=(f=-this.words[s]+a)>>26,this.words[s]=67108863&f;return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),o=t,s=o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=o.words[o.length-1]);var a,f=n.length-o.length;if("mod"!==e){(a=new i(null)).length=1+f,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var c=n.clone()._ishlnsubmul(o,1,f);c.sign||(n=c,a&&(a.words[f]=1));for(var h=f-1;0<=h;h--){var d=67108864*n.words[o.length+h]+n.words[o.length+h-1];for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(o,d,h);n.sign;)d--,n.sign=!1,n._ishlnsubmul(o,1,h),0!==n.cmpn(0)&&(n.sign=!n.sign);a&&(a.words[h]=d)}return a&&a.strip(),n.strip(),"div"!==e&&0!=r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(t,e,n){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var o=this.neg().divmod(t,e);return"mod"!==e&&(s=o.div.neg()),"div"!==e&&(a=o.mod.neg(),n&&a.neg&&(a=a.add(t))),{div:s,mod:a}}var s,a;return!this.sign&&t.sign?(o=this.divmod(t.neg(),e),"mod"!==e&&(s=o.div.neg()),{div:s,mod:o.mod}):this.sign&&t.sign?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(a=o.mod.neg(),n&&a.neg&&(a=a.isub(t))),{div:o.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div",!1).div},i.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},i.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?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:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;0<=i;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;0<=n;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.umod(t):e.clone();for(var o=new i(1),s=new i(0),a=new i(0),f=new i(1),u=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++u;for(var c=n.clone(),h=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.iushrn(1),o.isEven()&&s.isEven()?(o.iushrn(1),s.iushrn(1)):(o.iadd(c).iushrn(1),s.isub(h).iushrn(1));for(;n.isEven();)n.iushrn(1),a.isEven()&&f.isEven()?(a.iushrn(1),f.iushrn(1)):(a.iadd(c).iushrn(1),f.isub(h).iushrn(1));0<=e.cmp(n)?(e.isub(n),o.isub(a),s.isub(f)):(n.isub(e),a.isub(o),f.isub(s))}return{a:a,b:f,gcd:n.iushln(u)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.umod(t):e.clone();for(var o,s=new i(1),a=new i(0),f=n.clone();0<e.cmpn(1)&&0<n.cmpn(1);){for(;e.isEven();)e.iushrn(1),s.isEven()?s.iushrn(1):s.iadd(f).iushrn(1);for(;n.isEven();)n.iushrn(1),a.isEven()?a.iushrn(1):a.iadd(f).iushrn(1);0<=e.cmp(n)?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(o=0===e.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(t),o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;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)},i.prototype.invm=function(t){return this.egcd(t).a.umod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n){for(var o=this.length;o<1+n;o++)this.words[o]=0;return this.words[n]|=i,this.length=1+n,this}var s=i;for(o=n;0!==s&&o<this.length;o++){var a=this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},i.prototype.cmpn=function(t){var e,r=t<0;if(r&&(t=-t),this.sign&&!r)return-1;if(!this.sign&&r)return 1;if(t&=67108863,this.strip(),1<this.length)e=1;else{var n=this.words[0];e=n===t?0:n<t?-1:1}return this.sign&&(e=-e),e},i.prototype.cmp=function(t){if(this.sign&&!t.sign)return-1;if(!this.sign&&t.sign)return 1;var e=this.ucmp(t);return this.sign?-e:e},i.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;0<=r;r--){var n=this.words[r],i=t.words[r];if(n!==i){n<i?e=-1:i<n&&(e=1);break}}return e},i.red=function(t){return new y(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.ushl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var h={k256:null,p224:null,p192:null,p25519:null};function d(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){d.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){d.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){d.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function m(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}d.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},d.prototype.ireduce=function(t){for(var e,r=t;this.split(r,this.tmp),(e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):0<n?r.isub(this.p):r.strip(),r},d.prototype.split=function(t,e){t.iushrn(this.n,0,e)},d.prototype.imulK=function(t){return t.imul(this.k)},n(l,d),l.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=t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}t.words[n-10]=i>>>22,t.length-=9},l.prototype.imulK=function(t){var e;t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var r=0,n=0;n<t.length;n++){var i=t.words[n];e=64*i,e+=(r+=977*i)/67108864|0,r&=67108863,t.words[n]=r,r=e}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(p,d),n(b,d),n(v,d),v.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*t.words[r]+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function(t){if(h[t])return h[t];var e;if("k256"===t)e=new l;else if("p224"===t)e=new p;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return h[t]=e},y.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&r.isub(this.m),r},y.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)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t)},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).iushrn(2);return this.pow(t,n)}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.iushrn(1);r(0!==o.cmpn(0));var a=new i(1).toRed(this),f=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,o),d=this.pow(t,o.addn(1).iushrn(1)),l=this.pow(t,o),p=s;0!==l.cmp(a);){for(var b=l,v=0;0!==b.cmp(a);v++)b=b.redSqr();r(v<p);var y=this.pow(h,new i(1).iushln(p-v-1));d=d.redMul(y),h=y.redSqr(),l=l.redMul(h),p=v}return d},y.prototype.invm=function(t){var e=t._invmp(this.m);return e.sign?(e.sign=!1,this.imod(e).redNeg()):this.imod(e)},y.prototype.pow=function(t,e){var r=c(e);if(0===r.length)return new i(1);for(var n=t,o=0;o<r.length&&0===r[o];o++,n=this.sqr(n));if(++o<r.length)for(var s=this.sqr(n);o<r.length;o++,s=this.sqr(s))0!==r[o]&&(n=this.mul(n,s));return n},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},i.mont=function(t){return new m(t)},n(m,y),m.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},m.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},m.prototype.imul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))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 0<=i.cmp(this.m)?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},m.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return 0<=o.cmp(this.m)?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},m.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(11)(t))},function(t,e,r){"use strict";var n=r(8),i=r(13);function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function a(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,n,i=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),s=0;s<t.length;s+=2)i.push(parseInt(t[s]+t[s+1],16))}else for(var o=0,s=0;s<t.length;s++){var a=t.charCodeAt(s);a<128?i[o++]=a:a<2048?(i[o++]=a>>6|192,i[o++]=63&a|128):(n=s,55296!=(64512&(r=t).charCodeAt(n))||n<0||n+1>=r.length||56320!=(64512&r.charCodeAt(n+1))?i[o++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++s)),i[o++]=a>>18|240,i[o++]=a>>12&63|128),i[o++]=a>>6&63|128,i[o++]=63&a|128)}else for(s=0;s<t.length;s++)i[s]=0|t[s];return i},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=a(i.toString(16))}return r},e.zero2=s,e.zero8=a,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,f=e;a<s.length;a++,f+=4){var u;u="big"===i?t[f]<<24|t[f+1]<<16|t[f+2]<<8|t[f+3]:t[f+3]<<24|t[f+2]<<16|t[f+1]<<8|t[f],s[a]=u>>>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 f=0,u=e;return f+=(u=u+n>>>0)<e?1:0,f+=(u=u+o>>>0)<o?1:0,t+r+i+s+(f+=(u=u+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,f,u){var c=0,h=e;return c+=(h=h+n>>>0)<e?1:0,c+=(h=h+o>>>0)<o?1:0,c+=(h=h+a>>>0)<a?1:0,t+r+i+s+f+(c+=(h=h+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,f,u){return e+n+o+a+u>>>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}},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!y(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(a(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,function(t){if("%%"===t)return"%";if(o<=r)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),f=n[r];r<o;f=n[++r])b(f)||!w(f)?s+=" "+f:s+=" "+a(f);return s},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation,i=!0}return r.apply(this,arguments)}};var o,s={};function a(t,r){var n={seen:[],stylize:u};return 3<=arguments.length&&(n.depth=arguments[2]),4<=arguments.length&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),c(n,t,n.depth)}function f(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function u(t,e){return t}function c(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=c(t,i,n)),i}var o=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return v(e)?t.stylize(""+e,"number"):p(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return s.forEach(function(t,r){e[t]=!0}),e}();if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(0<=s.indexOf("message")||0<=s.indexOf("description")))return h(r);if(0===s.length){if(x(r)){var f=r.name?": "+r.name:"";return t.stylize("[Function"+f+"]","special")}if(g(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return h(r)}var u,w="",S=!1,T=["{","}"];return l(r)&&(S=!0,T=["[","]"]),x(r)&&(w=" [Function"+(r.name?": "+r.name:"")+"]"),g(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),A(r)&&(w=" "+h(r)),0!==s.length||S&&0!=r.length?n<0?g(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=S?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)M(e,String(s))?o.push(d(t,e,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(d(t,e,r,n,i,!0))}),o}(t,r,n,a,s):s.map(function(e){return d(t,r,n,a,e,S)}),t.seen.pop(),function(t,e,r){return 60<t.reduce(function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,w,T)):T[0]+w+T[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,f;if((f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=f.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):f.set&&(a=t.stylize("[Setter]","special")),M(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(f.value)<0?-1<(a=b(r)?c(t,f.value,null):c(t,f.value,r-1)).indexOf("\n")&&(a=o?a.split("\n").map(function(t){return"  "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return"   "+t}).join("\n")):a=t.stylize("[Circular]","special")),m(s)){if(o&&i.match(/^\d+$/))return a;s=(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),t.stylize(s,"string"))}return s+": "+a}function l(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function b(t){return null===t}function v(t){return"number"==typeof t}function y(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return w(t)&&"[object RegExp]"===S(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===S(t)}function A(t){return w(t)&&("[object Error]"===S(t)||t instanceof Error)}function x(t){return"function"==typeof t}function S(t){return Object.prototype.toString.call(t)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.debuglog=function(r){return m(o)&&(o=t.env.NODE_DEBUG||""),r=r.toUpperCase(),s[r]||(new RegExp("\\b"+r+"\\b","i").test(o)?(t.pid,s[r]=function(){e.format.apply(e,arguments)}):s[r]=function(){}),s[r]},(e.inspect=a).colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=l,e.isBoolean=p,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=m,e.isRegExp=g,e.isObject=w,e.isDate=_,e.isError=A,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(65),e.log=function(){},e.inherits=r(13),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(T&&t[T]){var e;if("function"!=typeof(e=t[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise(function(t,n){e=t,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(t,n){t?r(t):e(n)});try{t.apply(this,i)}catch(n){r(n)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),T&&Object.defineProperty(e,T,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=T,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");function o(){return i.apply(s,arguments)}var s=this;e.apply(this,r).then(function(e){t.nextTick(o,null,e)},function(e){t.nextTick(E,e,o)})}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(21))},function(t,e,r){var n=r(44),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},function(t,e,r){var n=r(14),i=r(6).Wallet,o=r(124),s=r(153),a=r(54),f=r(163),u=r(27),c=131072,h=524288;function d(t){var e=[],r=0;for(t.length%2&&(e.push(String.fromCharCode(parseInt(t.substring(0,1),16))),r=1);r<t.length;r+=2)e.push(String.fromCharCode(parseInt(t.substring(r,r+2),16)));return e.join("")}var l=function(t){var e=f.find(function(e){return e.currency.toLowerCase()===t.toLowerCase()});return e?e.currency:"SWT"};function p(t,e){if(null===t||"object"!=typeof t)return!1;if(!t.value&&0!==t.value||Number.isNaN(Number(t.value)))return!1;if(!t.currency||!v(t.currency))return!1;var r=l(e);return!(t.currency===r&&""!==t.issuer||t.currency!==r&&!i.isValidAddress(t.issuer,r))}function b(t,e){if("string"!=typeof t||Number.isNaN(Number(t)))return"object"==typeof t&&p(t,e)?t:null;var r=l(e);return{value:String(new u(t).dividedBy(1e6)),currency:r,issuer:""}}function v(t){return!(!t||"string"!=typeof t)&&/^([a-zA-Z0-9]{3,6}|[A-F0-9]{40})$/.test(t)}function y(t){var e=["CreatedNode","ModifiedNode","DeletedNode"];for(var r in e){var n=e[r];if(t.hasOwnProperty(n))return t[n]}return null}function m(t){var e={};return["CreatedNode","ModifiedNode","DeletedNode"].forEach(function(r){t[r]&&(e.diffType=r)}),e.diffType?(t=t[e.diffType],e.entryType=t.LedgerEntryType,e.ledgerIndex=t.LedgerIndex,e.fields=o({},t.PreviousFields,t.NewFields,t.FinalFields),e.fieldsPrev=t.PreviousFields||{},e.fieldsNew=t.NewFields||{},e.fieldsFinal=t.FinalFields||{},e.PreviousTxnID=t.PreviousTxnID,e):{}}function g(t){return!!t&&Number(t.value)<1e-12}function w(t,e){return function(t,e){return t&&e?{value:String(new u(t.value).plus(e.value)),currency:t.currency,issuer:t.issuer}:t||e?t||e:null}(t,function(t){return t?{value:String(-new u(t.value)),currency:t.currency,issuer:t.issuer}:t}(e))}function _(t,e){return String(new u(t.value).dividedBy(e.value))}t.exports={hexToString:d,stringToHex:function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r);e+=n<16?"0"+n.toString(16):n.toString(16)}return e},isValidAmount:p,isValidAmount0:function(t,e){if(null===t||"object"!=typeof t)return!1;if(!t.currency||!v(t.currency))return!1;var r=l(e);return!(t.currency===r&&""!==t.issuer||t.currency!==r&&!i.isValidAddress(t.issuer,r))},parseAmount:b,isValidCurrency:v,isValidHash:function(t){return!(!t||"string"!=typeof t)&&/^[A-F0-9]{64}$/.test(t)},isValidAddress:i.isValidAddress,isValidSecret:i.isValidSecret,affectedAccounts:function(t){var e={};e[t.transaction.Account]=1,t.transaction.Destination&&(e[t.transaction.Destination]=1),t.transaction.LimitAmount&&(e[t.transaction.LimitAmount.issuer]=1);var r=t.meta;return r&&"tesSUCCESS"===r.TransactionResult&&r.AffectedNodes.forEach(function(t){var r=m(t);"AccountRoot"===r.entryType&&r.fields.Account&&(e[r.fields.Account]=1),"SkywellState"===r.entryType&&(r.fields.HighLimit.issuer&&(e[r.fields.HighLimit.issuer]=1),r.fields.LowLimit.issuer&&(e[r.fields.LowLimit.issuer]=1)),"Offer"===r.entryType&&r.fields.Account&&(e[r.fields.Account]=1)}),Object.keys(e)},affectedBooks:function(t,e){var r=t.meta;if("object"!=typeof r)return[];if(!Array.isArray(r.AffectedNodes))return[];for(var i=l(e),o={},s=0;s<r.AffectedNodes.length;++s){var a=y(r.AffectedNodes[s]);if(a&&"Offer"===a.LedgerEntryType){var f=n({},a.PreviousFields,a.NewFields,a.FinalFields),u=b(f.TakerGets,e),h=b(f.TakerPays,e),d=u.currency===i?u.currency:u.currency+"/"+u.issuer,p=h.currency===i?h.currency:h.currency+"/"+h.issuer;o[t.transaction.Flags&c?p+":"+d:d+":"+p]=1}}return Object.keys(o)},processTx:function(t,e,r){var n=t.tx||t.transaction||t,i=t.meta,o={};switch(o.date=(n.date||n.Timestamp)+946684800,o.hash=n.hash,o.type=function(t,e){if(!(t.Account===e||t.Target===e||t.Destination&&t.Destination===e||t.LimitAmount&&t.LimitAmount.issuer===e))return"offereffect";switch(t.TransactionType){case"Payment":return t.Account===e?t.Destination===e?"convert":"sent":"received";case"OfferCreate":return"offernew";case"OfferCancel":return"offercancel";case"TrustSet":return t.Account===e?"trusting":"trusted";case"RelationDel":case"AccountSet":case"SetRegularKey":case"RelationSet":case"SignSet":case"Operation":case"ConfigContract":return t.TransactionType.toLowerCase();default:return"unknown"}}(n,e),o.fee=String(Number(n.Fee)/1e6),o.result=i?i.TransactionResult:"failed",o.memos=[],o.type){case"sent":o.counterparty=n.Destination,o.amount=b(n.Amount,r);break;case"received":o.counterparty=n.Account,o.amount=b(n.Amount,r);break;case"trusted":o.counterparty=n.Account,o.amount=function(t,e){return{value:String(-Number(t.value)),currency:t.currency,issuer:e}}(n.LimitAmount,n.Account);break;case"trusting":o.counterparty=n.LimitAmount.issuer,o.amount=n.LimitAmount;break;case"convert":o.spent=b(n.SendMax,r),o.amount=b(n.Amount,r);break;case"offernew":o.offertype=n.Flags&h?"sell":"buy",o.gets=b(n.TakerGets,r),o.pays=b(n.TakerPays,r),o.seq=n.Sequence;break;case"offercancel":o.offerseq=n.Sequence;break;case"relationset":o.counterparty=e===n.Target?n.Account:n.Target,o.relationtype=3===n.RelationType?"freeze":"authorize",o.isactive=e!==n.Target,o.amount=b(n.LimitAmount,r);break;case"relationdel":o.counterparty=e===n.Target?n.Account:n.Target,o.relationtype=3===n.RelationType?"unfreeze":"unknown",o.isactive=e!==n.Target,o.amount=b(n.LimitAmount,r);break;case"configcontract":o.params=function(t){var e=[];if(t)for(var r=0;r<t.length;r++)e.push(d(t[r].Arg.Parameter));return e}(n.Args),0===n.Method?(o.method="deploy",o.payload=n.Payload):1===n.Method&&(o.method="call",o.destination=n.Destination)}if(Array.isArray(n.Memos)&&0<n.Memos.length)for(var f=0;f<n.Memos.length;++f){var l=n.Memos[f].Memo;for(var p in l)try{l[p]=a.decode(d(l[p]))}catch(y){}o.memos.push(l)}if(o.effects=[],!i||"tesSUCCESS"!==i.TransactionResult)return o;i.AffectedNodes.forEach(function(t){var i=m(t),a={};if("Offer"===i.entryType){var f=i.fields,h=i.fields.Flags&c;if(i.fields.Account===e?("ModifiedNode"===i.diffType||"DeletedNode"===i.diffType&&i.fieldsPrev.TakerGets&&!g(b(i.fieldsFinal.TakerGets,r))?(a.effect="offer_partially_funded",a.counterparty={account:n.Account,seq:n.Sequence,hash:n.hash},"DeletedNode"!==i.diffType?a.remaining=!g(b(i.fields.TakerGets,r)):a.cancelled=!0,a.gets=b(f.TakerGets,r),a.pays=b(f.TakerPays,r),a.got=w(b(i.fieldsPrev.TakerPays,r),b(i.fields.TakerPays,r)),a.paid=w(b(i.fieldsPrev.TakerGets,r),b(i.fields.TakerGets,r)),a.type=h?"sold":"bought",i.fields.OfferFeeRateNum&&(a.rate=new u(parseInt(i.fields.OfferFeeRateNum,16)).div(parseInt(i.fields.OfferFeeRateDen,16)).toNumber())):(a.effect="CreatedNode"===i.diffType?"offer_created":i.fieldsPrev.TakerPays?"offer_funded":"offer_cancelled","offer_funded"===a.effect&&(f=i.fieldsPrev,a.counterparty={account:n.Account,seq:n.Sequence,hash:n.hash},a.got=w(b(i.fieldsPrev.TakerPays,r),b(i.fields.TakerPays,r)),a.paid=w(b(i.fieldsPrev.TakerGets,r),b(i.fields.TakerGets,r)),a.type=h?"sold":"bought",i.fields.OfferFeeRateNum&&(a.rate=new u(parseInt(i.fields.OfferFeeRateNum,16)).div(parseInt(i.fields.OfferFeeRateDen,16)).toNumber())),"offer_created"===a.effect&&(a.gets=b(f.TakerGets,r),a.pays=b(f.TakerPays,r),a.type=h?"sell":"buy"),"offer_cancelled"===a.effect&&(a.hash=i.fields.PreviousTxnID,"offercancel"===o.type&&(o.gets=b(f.TakerGets,r),o.pays=b(f.TakerPays,r)),a.gets=b(f.TakerGets,r),a.pays=b(f.TakerPays,r),a.type=h?"sell":"buy")),a.seq=i.fields.Sequence):n.Account!==e||s(i.fieldsPrev)||(a.effect="offer_bought",a.counterparty={account:i.fields.Account,seq:i.fields.Sequence,hash:i.PreviousTxnID||i.fields.PreviousTxnID},a.paid=w(b(i.fieldsPrev.TakerPays,r),b(i.fields.TakerPays,r)),a.got=w(b(i.fieldsPrev.TakerGets,r),b(i.fields.TakerGets,r)),a.type=h?"bought":"sold"),a.gets&&a.pays||a.got&&a.paid){var d="offer_created"===a.effect&&"buy"===a.type,l="offer_funded"===a.effect&&"bought"===a.type,p="offer_cancelled"===a.effect&&"buy"===a.type,v="offer_bought"===a.effect&&"bought"===a.type,y="offer_partially_funded"===a.effect&&"bought"===a.type;a.price=function(t,e){var r=t.got?t.got:t.pays,n=t.paid?t.paid:t.gets;return e?_(n,r):_(r,n)}(a,d||l||p||v||y)}}"offereffect"===o.type&&"AccountRoot"===i.entryType&&i.fields.RegularKey===e&&(a.effect="set_regular_key",a.type="null",a.account=i.fields.Account,a.regularkey=e),"Brokerage"===i.entryType&&(o.rate=new u(parseInt(i.fields.OfferFeeRateNum,16)).div(parseInt(i.fields.OfferFeeRateDen,16)).toNumber()),s(a)||("DeletedNode"===i.diffType&&"offer_bought"!==a.effect&&(a.deleted=!0),o.effects.push(a))});for(var v=0;v<o.effects.length;v++){var y=o.effects[v];o.rate&&"offer_bought"===y.effect&&(y.rate=o.rate,y.got.value=y.got.value*(1-y.rate)),!y.rate||"offer_funded"!==y.effect&&"offer_partially_funded"!==y.effect||(y.got.value=y.got.value*(1-y.rate))}return delete o.rate,o},LEDGER_STATES:["current","closed","validated"],arraySet:function(t,e){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},getCurrency:l,getFee:function(t){var e=f.find(function(e){return e.currency.toLowerCase()===t.toLowerCase()});return e?e.fee:1e4},getAccountZero:function(t){var e=f.find(function(e){return e.currency.toLowerCase()===t.toLowerCase()});return e?e.ACCOUNT_ZERO:"jjjjjjjjjjjjjjjjjjjjjhoLvTp"},getAccountOne:function(t){var e=f.find(function(e){return e.currency.toLowerCase()===t.toLowerCase()});return e?e.ACCOUNT_ONE:"jjjjjjjjjjjjjjjjjjjjBZbvri"},parseKey:function(t,e){var r=t.split(":");if(2!==r.length)return null;var n=l(e);function o(t){if(t===n)return{currency:n,issuer:""};var e=t.split("/");return 2!==e.length?null:v(e[0])&&i.isValidAddress(e[1],n)?{currency:e[0],issuer:e[1]}:null}var s=o(r[0]),a=o(r[1]);return s&&a?{gets:s,pays:a}:null}}},function(t,e,r){"use strict";var n=r(82),i=r(33);t.exports={Wallet:n,KeyPair:i}},function(t,e,r){var n=e;n.utils=r(2),n.common=r(15),n.sha=r(87),n.ripemd=r(91),n.hmac=r(92),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},function(t,e){(t.exports=function(t,e){if(!t)throw new Error(e||"Assertion failed")}).equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}((t.exports=a).EventEmitter=a).prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var f=10;function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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),0<(i=u(t))&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,console&&console.warn}return t}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,t))}.bind(n);return i.listener=r,n.wrapFn=i}function d(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 l(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}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");f=t}}),a.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},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(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},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(0<e.length&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var f=i[t];if(void 0===f)return!1;if("function"==typeof f)o(f,this,e);else{var u=f.length,c=p(f,u);for(r=0;r<u;++r)o(c[r],this,e)}return!0},a.prototype.on=a.prototype.addListener=function(t,e){return c(this,t,e,!1)},a.prototype.prependListener=function(t,e){return c(this,t,e,!0)},a.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,h(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,h(this,t,e)),this},a.prototype.off=a.prototype.removeListener=function(t,e){var r,n,i,o,s;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(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;0<=o;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},a.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;0<=n;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):l.call(t,e)},a.prototype.listenerCount=l,a.prototype.eventNames=function(){return 0<this._eventsCount?n(this._events):[]}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){var n=r(128),i=r(133);t.exports=function(t,e){var r=i(t,e);return n(r)?r:void 0}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){function r(){}t.super_=e,r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){"use strict";function n(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===f.call(t)}function i(t){if(!t||"[object Object]"!==f.call(t))return!1;var e,r=a.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&a.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||a.call(t,e)}function o(t,e){u&&"__proto__"===e.name?u(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue}function s(t,e){if("__proto__"===e){if(!a.call(t,e))return;if(c)return c(t,e).value}return t[e]}var a=Object.prototype.hasOwnProperty,f=Object.prototype.toString,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function t(e,r){var a,f,u,c,h,d=e,l=1,p=arguments.length,b=!1;for("boolean"==typeof d&&(b=d,d=r||{},l=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});l<p;++l)if(null!=(a=arguments[l]))for(f in a)u=s(d,f),d!==(c=s(a,f))&&(b&&c&&(i(c)||(h=n(c)))?o(d,{name:f,newValue:t(b,h?(h=!1,u&&n(u)?u:[]):u&&i(u)?u:{},c)}):void 0!==c&&o(d,{name:f,newValue:c}));return d}},function(t,e,r){"use strict";var n=r(2),i=r(8);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).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}},function(t,e,r){var n=r(43),i=r(129),o=r(130),s=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?i(t):o(t)}},function(t,e,r){"use strict";var n=e;n.base=r(95),n.short=r(96),n.mont=r(97),n.edwards=r(98)},function(t,e,r){"use strict";var n=r(1),i=r(24);e.bytesToHex=function(t){return t.map(function(t){var e=t.toString(16).toUpperCase();return 1<e.length?e:"0"+e}).join("")},e.hexToBytes=function(t){return i(t.length%2==0),new n(t,16).toArray(null,t.length/2)}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var f,u=[],c=!1,h=-1;function d(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&l())}function l(){if(!c){var t=a(d);c=!0;for(var e=u.length;e;){for(f=u,u=[];++h<e;)f&&f[h].run();h=-1,e=u.length}f=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function b(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||a(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,r){"use strict";(function(t){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
var n=r(23),i=r(71),o=r(72);function s(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=f.prototype:(null===t&&(t=new f(e)),t.length=e),t}function f(t,e,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,e,r);if("number"!=typeof t)return u(this,t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}function u(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(e.byteLength,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");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),f.TYPED_ARRAY_SUPPORT?(t=e).__proto__=f.prototype:t=d(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=a(t,n)).write(e,r);return i!==n&&(t=t.slice(0,i)),t}(t,e,r):function(t,e){if(f.isBuffer(e)){var r=0|l(e.length);return 0===(t=a(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?a(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(c(e),t=a(t,e<0?0:0|l(e)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|l(e.length);t=a(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function l(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return B(t).length;default:if(n)return L(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(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=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:y(t,e,r,n,i);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,n,i){var o,s=1,a=t.length,f=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;a/=s=2,f/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var c=-1;for(o=r;o<a;o++)if(u(t,o)===u(e,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===f)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(a<r+f&&(r=a-f),o=r;0<=o;o--){for(var h=!0,d=0;d<f;d++)if(u(t,o+d)!==u(e,d)){h=!1;break}if(h)return o}return-1}function m(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?i<(n=Number(n))&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");o/2<n&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function g(t,e,r,n){return D(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,f,u=t[i],c=null,h=239<u?4:223<u?3:191<u?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&127<(f=(31&u)<<6|63&o)&&(c=f);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(f=(15&u)<<12|(63&o)<<6|63&s)&&(f<55296||57343<f)&&(c=f);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(f=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)&&f<1114112&&(c=f)}null===c?(c=65533,h=1):65535<c&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(t){var e=t.length;if(e<=A)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=A));return r}(n)}e.Buffer=f,e.SlowBuffer=function(t){return+t!=t&&(t=0),f.alloc(+t)},e.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,e,r){return u(null,t,e,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,e,r){return function(t,e,r,n){return c(e),e<=0?a(t,e):void 0!==r?"string"==typeof n?a(t,e).fill(r,n):a(t,e).fill(r):a(t,e)}(null,t,e,r)},f.allocUnsafe=function(t){return h(null,t)},f.allocUnsafeSlow=function(t){return h(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,e){if(!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError("Arguments must be Buffers");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},f.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}},f.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(r=e=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!f.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},f.byteLength=p,f.prototype._isBuffer=!0,f.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},f.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},f.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},f.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?_(this,0,t):function(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 M(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return x(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,e,r,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");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(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=t.slice(e,r),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},f.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||i<r)&&(r=i),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,f,u,c,h=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return u=e,c=r,D(L(t,this.length-u),this,u,c);case"ascii":return g(this,t,e,r);case"latin1":case"binary":return g(this,t,e,r);case"base64":return this,a=e,f=r,D(B(t),this,a,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=e,s=r,D(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}(t,this.length-o),this,o,s);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function x(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 S(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 M(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||n<r)&&(r=n);for(var i="",o=e;o<r;++o)i+=C(t[o]);return i}function T(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 E(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function k(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function O(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function I(t,e,r,n){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,n,o){return o||I(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,o){return o||I(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=f.prototype;else{var i=e-t;r=new f(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},f.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;0<e&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return e||E(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||E(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||E(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||E(t,e,this.length);for(var n=e,i=1,o=this[t+--n];0<n&&(i*=256);)o+=this[t+--n]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||E(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||E(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||E(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||E(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||j(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},f.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);j(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},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);j(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;0<=--o&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):k(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):k(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},f.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,0<n&&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,o=n-r;if(this===t&&r<e&&e<n)for(i=o-1;0<=i;--i)t[i+e]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},f.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),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+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 o;if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(o=e;o<r;++o)this[o]=t;else{var s=f.isBuffer(t)?t:L(new f(t,n).toString()),a=s.length;for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function C(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!i){if(56319<r){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&o.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(e-=3)&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(e-=3)&&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 B(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(P,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function D(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}}).call(this,r(10))},function(t,e,r){!function(t){"use strict";var e="undefined"!=typeof Uint8Array?Uint8Array:Array,r="+".charCodeAt(0),n="/".charCodeAt(0),i="0".charCodeAt(0),o="a".charCodeAt(0),s="A".charCodeAt(0),a="-".charCodeAt(0),f="_".charCodeAt(0);function u(t){var e=t.charCodeAt(0);return e===r||e===a?62:e===n||e===f?63:e<i?-1:e<i+10?e-i+26+26:e<s+26?e-s:e<o+26?e-o+26:void 0}t.toByteArray=function(t){var r,n,i,o,s;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.length;o="="===t.charAt(a-2)?2:"="===t.charAt(a-1)?1:0,s=new e(3*t.length/4-o),n=0<o?t.length-4:t.length;var f=0;function c(t){s[f++]=t}for(r=0;r<n;r+=4,3)c((16711680&(i=u(t.charAt(r))<<18|u(t.charAt(r+1))<<12|u(t.charAt(r+2))<<6|u(t.charAt(r+3))))>>16),c((65280&i)>>8),c(255&i);return 2==o?c(255&(i=u(t.charAt(r))<<2|u(t.charAt(r+1))>>4)):1==o&&(c((i=u(t.charAt(r))<<10|u(t.charAt(r+1))<<4|u(t.charAt(r+2))>>2)>>8&255),c(255&i)),s},t.fromByteArray=function(t){var e,r,n,i,o=t.length%3,s="";function a(t){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)}for(e=0,n=t.length-o;e<n;e+=3)s+=a((i=r=(t[e]<<16)+(t[e+1]<<8)+t[e+2])>>18&63)+a(i>>12&63)+a(i>>6&63)+a(63&i);switch(o){case 1:s+=a((r=t[t.length-1])>>2),s+=a(r<<4&63),s+="==";break;case 2:s+=a((r=(t[t.length-2]<<8)+t[t.length-1])>>10),s+=a(r>>4&63),s+=a(r<<2&63),s+="="}return s}}(e)},function(t,e,r){"use strict";(function(e){var n=r(110);
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */function i(t,e){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}function o(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var s=r(3),a=Object.prototype.hasOwnProperty,f=Array.prototype.slice,u="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function h(t){return!o(t)&&"function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer)))}var d=t.exports=m,l=/\s*function\s+([^\(\s]*)\s*/;function p(t){if(s.isFunction(t)){if(u)return t.name;var e=t.toString().match(l);return e&&e[1]}}function b(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function v(t){if(u||!s.isFunction(t))return s.inspect(t);var e=p(t);return"[Function"+(e?": "+e:"")+"]"}function y(t,e,r,n,i){throw new d.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function m(t,e){t||y(t,!0,e,"==",d.ok)}function g(t,e,r,n){if(t===e)return!0;if(o(t)&&o(e))return 0===i(t,e);if(s.isDate(t)&&s.isDate(e))return t.getTime()===e.getTime();if(s.isRegExp(t)&&s.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(h(t)&&h(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(o(t)!==o(e))return!1;var a=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==a&&a===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(s.isPrimitive(t)||s.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=w(t),o=w(e);if(i&&!o||!i&&o)return!1;if(i)return g(t=f.call(t),e=f.call(e),r);var a,u,c=x(t),h=x(e);if(c.length!==h.length)return!1;for(c.sort(),h.sort(),u=c.length-1;0<=u;u--)if(c[u]!==h[u])return!1;for(u=c.length-1;0<=u;u--)if(!g(t[a=c[u]],e[a],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function w(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function _(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function A(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&y(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!t&&i&&!r;if((!t&&s.isError(i)&&o&&_(i,r)||a)&&y(i,r,"Got unwanted exception"+n),t&&i&&r&&!_(i,r)||!t&&i)throw i}d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return b(v(t.actual),128)+" "+t.operator+" "+b(v(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=p(e),o=n.indexOf("\n"+i);if(0<=o){var s=n.indexOf("\n",o+1);n=n.substring(s+1)}this.stack=n}}},s.inherits(d.AssertionError,Error),d.fail=y,d.ok=m,d.equal=function(t,e,r){t!=e&&y(t,e,r,"==",d.equal)},d.notEqual=function(t,e,r){t==e&&y(t,e,r,"!=",d.notEqual)},d.deepEqual=function(t,e,r){g(t,e,!1)||y(t,e,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(t,e,r){g(t,e,!0)||y(t,e,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(t,e,r){g(t,e,!1)&&y(t,e,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function t(e,r,n){g(e,r,!0)&&y(e,r,n,"notDeepStrictEqual",t)},d.strictEqual=function(t,e,r){t!==e&&y(t,e,r,"===",d.strictEqual)},d.notStrictEqual=function(t,e,r){t===e&&y(t,e,r,"!==",d.notStrictEqual)},d.throws=function(t,e,r){A(!0,t,e,r)},d.doesNotThrow=function(t,e,r){A(!1,t,e,r)},d.ifError=function(t){if(t)throw t},d.strict=n(function t(e,r){e||y(e,!0,r,"==",t)},d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var x=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,r(10))},function(t,e,r){var n=r(42),i=r(48);t.exports=function(t){return null!=t&&i(t.length)&&!n(t)}},function(t,e){var r=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||r)}},function(t,e,r){var n;/*! bignumber.js v5.0.0 https://github.com/MikeMcl/bignumber.js/LICENCE */!function(){"use strict";var i,o=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,s=Math.ceil,a=Math.floor,f=" not a boolean or binary digit",u="rounding mode",c="number type has more than 15 significant digits",h="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",d=1e14,l=14,p=9007199254740991,b=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],v=1e7,y=1e9;function m(t){var e=0|t;return 0<t||t===e?e:e-1}function g(t){for(var e,r,n=1,i=t.length,o=t[0]+"";n<i;){for(e=t[n++]+"",r=l-e.length;r--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function w(t,e){var r,n,i=t.c,o=e.c,s=t.s,a=e.s,f=t.e,u=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=f==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return u<f^r?1:-1;for(a=(f=i.length)<(u=o.length)?f:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return f==u?0:u<f^r?1:-1}function _(t,e,r){return(t=T(t))>=e&&t<=r}function A(t){return"[object Array]"==Object.prototype.toString.call(t)}function x(t,e,r){for(var n,i,o=[0],s=0,a=t.length;s<a;){for(i=o.length;i--;o[i]*=e);for(o[n=0]+=h.indexOf(t.charAt(s++));n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function S(t,e){return(1<t.length?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function M(t,e){var r,n;if(e<0){for(n="0.";++e;n+="0");t=n+t}else if(++e>(r=t.length)){for(n="0",e-=r;--e;n+="0");t+=n}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}function T(t){return(t=parseFloat(t))<0?s(t):a(t)}(i=function t(e){var r,n,i,E,j,k,O,I,R,N=0,P=Z.prototype,C=new Z(1),L=20,B=4,D=-7,q=21,z=-1e7,F=1e7,U=!0,V=et,H=!1,G=1,K=0,W={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0};function Z(t,e){var r,i,s,f,u,d,b=this;if(!(b instanceof Z))return new Z(t,e);if(null!=e&&V(e,2,64,N,"base")){if(d=t+"",10==(e|=0))return it(b=new Z(t instanceof Z?t:d),L+b.e+1,B);if((f="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(r="["+h.slice(0,e)+"]+")+"(?:\\."+r+")?$",e<37?"i":"").test(d))return n(b,d,f,e);f?(b.s=1/t<0?(d=d.slice(1),-1):1,U&&15<d.replace(/^0\.0*|\./,"").length&&nt(N,c,t),f=!1):b.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1,d=Y(d,10,e,b.s)}else{if(t instanceof Z)return b.s=t.s,b.e=t.e,b.c=(t=t.c)?t.slice():t,void(N=0);if((f="number"==typeof t)&&0*t==0){if(b.s=1/t<0?(t=-t,-1):1,t===~~t){for(i=0,s=t;10<=s;s/=10,i++);return b.e=i,b.c=[t],void(N=0)}d=t+""}else{if(!o.test(d=t+""))return n(b,d,f);b.s=45===d.charCodeAt(0)?(d=d.slice(1),-1):1}}for(-1<(i=d.indexOf("."))&&(d=d.replace(".","")),0<(s=d.search(/e/i))?(i<0&&(i=s),i+=+d.slice(s+1),d=d.substring(0,s)):i<0&&(i=d.length),s=0;48===d.charCodeAt(s);s++);for(u=d.length;48===d.charCodeAt(--u););if(d=d.slice(s,u+1))if(u=d.length,f&&U&&15<u&&(p<t||t!==a(t))&&nt(N,c,b.s*t),F<(i=i-s-1))b.c=b.e=null;else if(i<z)b.c=[b.e=0];else{if(b.e=i,b.c=[],s=(i+1)%l,i<0&&(s+=l),s<u){for(s&&b.c.push(+d.slice(0,s)),u-=l;s<u;)b.c.push(+d.slice(s,s+=l));d=d.slice(s),s=l-d.length}else s-=u;for(;s--;d+="0");b.c.push(+d)}else b.c=[b.e=0];N=0}function Y(t,e,n,i){var o,s,a,f,u,c,d,l=t.indexOf("."),p=L,b=B;for(n<37&&(t=t.toLowerCase()),0<=l&&(a=K,K=0,t=t.replace(".",""),u=(d=new Z(n)).pow(t.length-l),K=a,d.c=x(M(g(u.c),u.e),10,e),d.e=d.c.length),s=a=(c=x(t,n,e)).length;0==c[--a];c.pop());if(!c[0])return"0";if(l<0?--s:(u.c=c,u.e=s,u.s=i,c=(u=r(u,d,p,b,e)).c,f=u.r,s=u.e),l=c[o=s+p+1],a=e/2,f=f||o<0||null!=c[o+1],f=b<4?(null!=l||f)&&(0==b||b==(u.s<0?3:2)):a<l||l==a&&(4==b||f||6==b&&1&c[o-1]||b==(u.s<0?8:7)),o<1||!c[0])t=f?M("1",-p):"0";else{if(c.length=o,f)for(--e;++c[--o]>e;)c[o]=0,o||(++s,c=[1].concat(c));for(a=c.length;!c[--a];);for(l=0,t="";l<=a;t+=h.charAt(c[l++]));t=M(t,s)}return t}function J(t,e,r){var n,i,o,s,a=0,f=t.length,u=e%v,c=e/v|0;for(t=t.slice();f--;)a=((i=u*(o=t[f]%v)+(n=c*o+(s=t[f]/v|0)*u)%v*v+a)/r|0)+(n/v|0)+c*s,t[f]=i%r;return a&&(t=[a].concat(t)),t}function $(t,e,r,n){var i,o;if(r!=n)o=n<r?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 X(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]&&1<t.length;t.splice(0,1));}function Q(t,e,r,n){var i,o,s,a,f;if(r=null!=r&&V(r,0,8,n,u)?0|r:B,!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)f=g(t.c),f=19==n||24==n&&s<=D?S(f,s):M(f,s);else if(o=(t=it(new Z(t),e,r)).e,a=(f=g(t.c)).length,19==n||24==n&&(e<=o||o<=D)){for(;a<e;f+="0",a++);f=S(f,o)}else if(e-=s,f=M(f,o),a<o+1){if(0<--e)for(f+=".";e--;f+="0");}else if(0<(e+=o-a))for(o+1==a&&(f+=".");e--;f+="0");return t.s<0&&i?"-"+f:f}function tt(t,e){var r,n,i=0;for(A(t[0])&&(t=t[0]),r=new Z(t[0]);++i<t.length;){if(!(n=new Z(t[i])).s){r=n;break}e.call(r,n)&&(r=n)}return r}function et(t,e,r,n,i){return(t<e||r<t||t!=T(t))&&nt(n,(i||"decimal places")+(t<e||r<t?" out of range":" not an integer"),t),!0}function rt(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];10<=i;i/=10,n++);return(r=n+r*l-1)>F?t.c=t.e=null:r<z?t.c=[t.e=0]:(t.e=r,t.c=e),t}function nt(t,e,r){var n=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+r);throw n.name="BigNumber Error",N=0,n}function it(t,e,r,n){var i,o,f,u,c,h,p,v=t.c,y=b;if(v){t:{for(i=1,u=v[0];10<=u;u/=10,i++);if((o=e-i)<0)o+=l,f=e,p=(c=v[h=0])/y[i-f-1]%10|0;else if((h=s((o+1)/l))>=v.length){if(!n)break t;for(;v.length<=h;v.push(0));c=p=0,f=(o%=l)-l+(i=1)}else{for(c=u=v[h],i=1;10<=u;u/=10,i++);p=(f=(o%=l)-l+i)<0?0:c/y[i-f-1]%10|0}if(n=n||e<0||null!=v[h+1]||(f<0?c:c%y[i-f-1]),n=r<4?(p||n)&&(0==r||r==(t.s<0?3:2)):5<p||5==p&&(4==r||n||6==r&&(0<o?0<f?c/y[i-f]:0:v[h-1])%10&1||r==(t.s<0?8:7)),e<1||!v[0])return v.length=0,n?(e-=t.e+1,v[0]=y[(l-e%l)%l],t.e=-e||0):v[0]=t.e=0,t;if(0==o?(v.length=h,u=1,h--):(v.length=h+1,u=y[l-o],v[h]=0<f?a(c/y[i-f]%y[f])*u:0),n)for(;;){if(0==h){for(o=1,f=v[0];10<=f;f/=10,o++);for(f=v[0]+=u,u=1;10<=f;f/=10,u++);o!=u&&(t.e++,v[0]==d&&(v[0]=1));break}if(v[h]+=u,v[h]!=d)break;v[h--]=0,u=1}for(o=v.length;0===v[--o];v.pop());}t.e>F?t.c=t.e=null:t.e<z&&(t.c=[t.e=0])}return t}return Z.another=t,Z.ROUND_UP=0,Z.ROUND_DOWN=1,Z.ROUND_CEIL=2,Z.ROUND_FLOOR=3,Z.ROUND_HALF_UP=4,Z.ROUND_HALF_DOWN=5,Z.ROUND_HALF_EVEN=6,Z.ROUND_HALF_CEIL=7,Z.ROUND_HALF_FLOOR=8,Z.EUCLID=9,Z.config=Z.set=function(){var t,e,r=0,n={},i=arguments,o=i[0],s=o&&"object"==typeof o?function(){if(o.hasOwnProperty(e))return null!=(t=o[e])}:function(){if(r<i.length)return null!=(t=i[r++])};return s(e="DECIMAL_PLACES")&&V(t,0,y,2,e)&&(L=0|t),n[e]=L,s(e="ROUNDING_MODE")&&V(t,0,8,2,e)&&(B=0|t),n[e]=B,s(e="EXPONENTIAL_AT")&&(A(t)?V(t[0],-y,0,2,e)&&V(t[1],0,y,2,e)&&(D=0|t[0],q=0|t[1]):V(t,-y,y,2,e)&&(D=-(q=0|(t<0?-t:t)))),n[e]=[D,q],s(e="RANGE")&&(A(t)?V(t[0],-y,-1,2,e)&&V(t[1],1,y,2,e)&&(z=0|t[0],F=0|t[1]):V(t,-y,y,2,e)&&(0|t?z=-(F=0|(t<0?-t:t)):U&&nt(2,e+" cannot be zero",t))),n[e]=[z,F],s(e="ERRORS")&&(t===!!t||1===t||0===t?(N=0,V=(U=!!t)?et:_):U&&nt(2,e+f,t)),n[e]=U,s(e="CRYPTO")&&(!0===t||!1===t||1===t||0===t?t?!(t="undefined"==typeof crypto)&&crypto&&(crypto.getRandomValues||crypto.randomBytes)?H=!0:U?nt(2,"crypto unavailable",t?void 0:crypto):H=!1:H=!1:U&&nt(2,e+f,t)),n[e]=H,s(e="MODULO_MODE")&&V(t,0,9,2,e)&&(G=0|t),n[e]=G,s(e="POW_PRECISION")&&V(t,0,y,2,e)&&(K=0|t),n[e]=K,s(e="FORMAT")&&("object"==typeof t?W=t:U&&nt(2,e+" not an object",t)),n[e]=W,n},Z.max=function(){return tt(arguments,P.lt)},Z.min=function(){return tt(arguments,P.gt)},Z.random=(i=9007199254740992,E=Math.random()*i&2097151?function(){return a(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,o,f=0,u=[],c=new Z(C);if(t=null!=t&&V(t,0,y,14)?0|t:L,i=s(t/l),H)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));f<i;)9e15<=(o=131072*e[f]+(e[f+1]>>>11))?(r=crypto.getRandomValues(new Uint32Array(2)),e[f]=r[0],e[f+1]=r[1]):(u.push(o%1e14),f+=2);f=i/2}else if(crypto.randomBytes){for(e=crypto.randomBytes(i*=7);f<i;)9e15<=(o=281474976710656*(31&e[f])+1099511627776*e[f+1]+4294967296*e[f+2]+16777216*e[f+3]+(e[f+4]<<16)+(e[f+5]<<8)+e[f+6])?crypto.randomBytes(7).copy(e,f):(u.push(o%1e14),f+=7);f=i/7}else H=!1,U&&nt(14,"crypto unavailable",crypto);if(!H)for(;f<i;)(o=E())<9e15&&(u[f++]=o%1e14);for(i=u[--f],t%=l,i&&t&&(o=b[l-t],u[f]=a(i/o)*o);0===u[f];u.pop(),f--);if(f<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=l);for(f=1,o=u[0];10<=o;o/=10,f++);f<l&&(n-=l-f)}return c.e=n,c.c=u,c}),r=function(t,e,r,n,i){var o,s,f,u,c,h,p,b,v,y,g,w,_,A,x,S,M,T=t.s==e.s?1:-1,E=t.c,j=e.c;if(!(E&&E[0]&&j&&j[0]))return new Z(t.s&&e.s&&(E?!j||E[0]!=j[0]:j)?E&&0==E[0]||!j?0*T:T/0:NaN);for(v=(b=new Z(T)).c=[],T=r+(s=t.e-e.e)+1,i||(i=d,s=m(t.e/l)-m(e.e/l),T=T/l|0),f=0;j[f]==(E[f]||0);f++);if(j[f]>(E[f]||0)&&s--,T<0)v.push(1),u=!0;else{for(A=E.length,S=j.length,T+=2,1<(c=a(i/(j[f=0]+1)))&&(j=J(j,c,i),E=J(E,c,i),S=j.length,A=E.length),_=S,g=(y=E.slice(0,S)).length;g<S;y[g++]=0);M=j.slice(),M=[0].concat(M),x=j[0],j[1]>=i/2&&x++;do{if(c=0,(o=$(j,y,S,g))<0){if(w=y[0],S!=g&&(w=w*i+(y[1]||0)),1<(c=a(w/x)))for(i<=c&&(c=i-1),p=(h=J(j,c,i)).length,g=y.length;1==$(h,y,p,g);)c--,X(h,S<p?M:j,p,i),p=h.length,o=1;else 0==c&&(o=c=1),p=(h=j.slice()).length;if(p<g&&(h=[0].concat(h)),X(y,h,g,i),g=y.length,-1==o)for(;$(j,y,S,g)<1;)c++,X(y,S<g?M:j,g,i),g=y.length}else 0===o&&(c++,y=[0]);v[f++]=c,y[0]?y[g++]=E[_]||0:(y=[E[_]],g=1)}while((_++<A||null!=y[0])&&T--);u=null!=y[0],v[0]||v.splice(0,1)}if(i==d){for(f=1,T=v[0];10<=T;T/=10,f++);it(b,r+(b.e=f+s*l-1)+1,n,u)}else b.e=s,b.r=+u;return b},j=/^(-?)0([xbo])(?=\w[\w.]*$)/i,k=/^([^.]+)\.$/,O=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(t,e,r,n){var i,o=r?e:e.replace(R,"");if(I.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(j,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(k,"$1").replace(O,"0.$1")),e!=o))return new Z(o,i);U&&nt(N,"not a"+(n?" base "+n:"")+" number",e),t.s=null}t.c=t.e=null,N=0},P.absoluteValue=P.abs=function(){var t=new Z(this);return t.s<0&&(t.s=1),t},P.ceil=function(){return it(new Z(this),this.e+1,2)},P.comparedTo=P.cmp=function(t,e){return N=1,w(this,new Z(t,e))},P.decimalPlaces=P.dp=function(){var t,e,r=this.c;if(!r)return null;if(t=((e=r.length-1)-m(this.e/l))*l,e=r[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},P.dividedBy=P.div=function(t,e){return N=3,r(this,new Z(t,e),L,B)},P.dividedToIntegerBy=P.divToInt=function(t,e){return N=4,r(this,new Z(t,e),0,1)},P.equals=P.eq=function(t,e){return N=5,0===w(this,new Z(t,e))},P.floor=function(){return it(new Z(this),this.e+1,3)},P.greaterThan=P.gt=function(t,e){return N=6,0<w(this,new Z(t,e))},P.greaterThanOrEqualTo=P.gte=function(t,e){return N=7,1===(e=w(this,new Z(t,e)))||0===e},P.isFinite=function(){return!!this.c},P.isInteger=P.isInt=function(){return!!this.c&&m(this.e/l)>this.c.length-2},P.isNaN=function(){return!this.s},P.isNegative=P.isNeg=function(){return this.s<0},P.isZero=function(){return!!this.c&&0==this.c[0]},P.lessThan=P.lt=function(t,e){return N=8,w(this,new Z(t,e))<0},P.lessThanOrEqualTo=P.lte=function(t,e){return N=9,-1===(e=w(this,new Z(t,e)))||0===e},P.minus=P.sub=function(t,e){var r,n,i,o,s=this,a=s.s;if(N=10,e=(t=new Z(t,e)).s,!a||!e)return new Z(NaN);if(a!=e)return t.s=-e,s.plus(t);var f=s.e/l,u=t.e/l,c=s.c,h=t.c;if(!f||!u){if(!c||!h)return c?(t.s=-e,t):new Z(h?s:NaN);if(!c[0]||!h[0])return h[0]?(t.s=-e,t):new Z(c[0]?s:3==B?-0:0)}if(f=m(f),u=m(u),c=c.slice(),a=f-u){for((i=(o=a<0)?(a=-a,c):(u=f,h)).reverse(),e=a;e--;i.push(0));i.reverse()}else for(n=(o=(a=c.length)<(e=h.length))?a:e,a=e=0;e<n;e++)if(c[e]!=h[e]){o=c[e]<h[e];break}if(o&&(i=c,c=h,h=i,t.s=-t.s),0<(e=(n=h.length)-(r=c.length)))for(;e--;c[r++]=0);for(e=d-1;a<n;){if(c[--n]<h[n]){for(r=n;r&&!c[--r];c[r]=e);--c[r],c[n]+=d}c[n]-=h[n]}for(;0==c[0];c.splice(0,1),--u);return c[0]?rt(t,c,u):(t.s=3==B?-1:1,t.c=[t.e=0],t)},P.modulo=P.mod=function(t,e){var n,i,o=this;return N=11,t=new Z(t,e),!o.c||!t.s||t.c&&!t.c[0]?new Z(NaN):!t.c||o.c&&!o.c[0]?new Z(o):(9==G?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,G),o.minus(n.times(t)))},P.negated=P.neg=function(){var t=new Z(this);return t.s=-t.s||null,t},P.plus=P.add=function(t,e){var r,n=this,i=n.s;if(N=12,e=(t=new Z(t,e)).s,!i||!e)return new Z(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/l,s=t.e/l,a=n.c,f=t.c;if(!o||!s){if(!a||!f)return new Z(i/0);if(!a[0]||!f[0])return f[0]?t:new Z(a[0]?n:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for((r=0<i?(s=o,f):(i=-i,a)).reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(e=f.length)<0&&(r=f,f=a,a=r,e=i),i=0;e;)i=(a[--e]=a[e]+f[e]+i)/d|0,a[e]=d===a[e]?0:a[e]%d;return i&&(a=[i].concat(a),++s),rt(t,a,s)},P.precision=P.sd=function(t){var e,r,n=this.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(U&&nt(13,"argument"+f,t),t!=!!t&&(t=null)),!n)return null;if(e=(r=n.length-1)*l+1,r=n[r]){for(;r%10==0;r/=10,e--);for(r=n[0];10<=r;r/=10,e++);}return t&&this.e+1>e&&(e=this.e+1),e},P.round=function(t,e){var r=new Z(this);return null!=t&&!V(t,0,y,15)||it(r,~~t+this.e+1,null!=e&&V(e,0,8,15,u)?0|e:B),r},P.shift=function(t){var e=this;return V(t,-p,p,16,"argument")?e.times("1e"+T(t)):new Z(e.c&&e.c[0]&&(t<-p||p<t)?e.s*(t<0?0:1/0):e)},P.squareRoot=P.sqrt=function(){var t,e,n,i,o,s=this,a=s.c,f=s.s,u=s.e,c=L+4,h=new Z("0.5");if(1!==f||!a||!a[0])return new Z(!f||f<0&&(!a||a[0])?NaN:a?s:1/0);if((n=0==(f=Math.sqrt(+s))||f==1/0?(((e=g(a)).length+u)%2==0&&(e+="0"),f=Math.sqrt(e),u=m((u+1)/2)-(u<0||u%2),new Z(e=f==1/0?"1e"+u:(e=f.toExponential()).slice(0,e.indexOf("e")+1)+u)):new Z(f+"")).c[0])for((f=(u=n.e)+c)<3&&(f=0);;)if(o=n,n=h.times(o.plus(r(s,o,c,1))),g(o.c).slice(0,f)===(e=g(n.c)).slice(0,f)){if(n.e<u&&--f,"9999"!=(e=e.slice(f-3,f+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(it(n,n.e+L+2,1),t=!n.times(n).eq(s));break}if(!i&&(it(o,o.e+L+2,0),o.times(o).eq(s))){n=o;break}c+=4,f+=4,i=1}return it(n,n.e+L+1,B,t)},P.times=P.mul=function(t,e){var r,n,i,o,s,a,f,u,c,h,p,b,y,g,w,_=this,A=_.c,x=(N=17,t=new Z(t,e)).c;if(!(A&&x&&A[0]&&x[0]))return!_.s||!t.s||A&&!A[0]&&!x||x&&!x[0]&&!A?t.c=t.e=t.s=null:(t.s*=_.s,A&&x?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=m(_.e/l)+m(t.e/l),t.s*=_.s,(f=A.length)<(h=x.length)&&(y=A,A=x,x=y,i=f,f=h,h=i),i=f+h,y=[];i--;y.push(0));for(g=d,w=v,i=h;0<=--i;){for(r=0,p=x[i]%w,b=x[i]/w|0,o=i+(s=f);i<o;)r=((u=p*(u=A[--s]%w)+(a=b*u+(c=A[s]/w|0)*p)%w*w+y[o]+r)/g|0)+(a/w|0)+b*c,y[o--]=u%g;y[o]=r}return r?++n:y.splice(0,1),rt(t,y,n)},P.toDigits=function(t,e){var r=new Z(this);return t=null!=t&&V(t,1,y,18,"precision")?0|t:null,e=null!=e&&V(e,0,8,18,u)?0|e:B,t?it(r,t,e):r},P.toExponential=function(t,e){return Q(this,null!=t&&V(t,0,y,19)?1+~~t:null,e,19)},P.toFixed=function(t,e){return Q(this,null!=t&&V(t,0,y,20)?~~t+this.e+1:null,e,20)},P.toFormat=function(t,e){var r=Q(this,null!=t&&V(t,0,y,21)?~~t+this.e+1:null,e,21);if(this.c){var n,i=r.split("."),o=+W.groupSize,s=+W.secondaryGroupSize,a=W.groupSeparator,f=i[0],u=i[1],c=this.s<0,h=c?f.slice(1):f,d=h.length;if(s&&(n=o,o=s,d-=s=n),0<o&&0<d){for(n=d%o||o,f=h.substr(0,n);n<d;n+=o)f+=a+h.substr(n,o);0<s&&(f+=a+h.slice(n)),c&&(f="-"+f)}r=u?f+W.decimalSeparator+((s=+W.fractionGroupSize)?u.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+W.fractionGroupSeparator):u):f}return r},P.toFraction=function(t){var e,n,i,o,s,a,f,u,c,h=U,d=this,p=d.c,v=new Z(C),y=n=new Z(C),m=f=new Z(C);if(null!=t&&(U=!1,a=new Z(t),U=h,(h=a.isInt())&&!a.lt(C)||(U&&nt(22,"max denominator "+(h?"out of range":"not an integer"),t),t=!h&&a.c&&it(a,a.e+1,1).gte(C)?a:null)),!p)return d.toString();for(c=g(p),o=v.e=c.length-d.e-1,v.c[0]=b[(s=o%l)<0?l+s:s],t=!t||0<a.cmp(v)?0<o?v:y:a,s=F,F=1/0,a=new Z(c),f.c[0]=0;u=r(a,v,0,1),1!=(i=n.plus(u.times(m))).cmp(t);)n=m,m=i,y=f.plus(u.times(i=y)),f=i,v=a.minus(u.times(i=v)),a=i;return i=r(t.minus(n),m,0,1),f=f.plus(i.times(y)),n=n.plus(i.times(m)),f.s=y.s=d.s,e=r(y,m,o*=2,B).minus(d).abs().cmp(r(f,n,o,B).minus(d).abs())<1?[y.toString(),m.toString()]:[f.toString(),n.toString()],F=s,e},P.toNumber=function(){return+this},P.toPower=P.pow=function(t,e){var r,n,i,o=a(t<0?-t:+t),f=this;if(null!=e&&(N=23,e=new Z(e)),!V(t,-p,p,23,"exponent")&&(!isFinite(t)||p<o&&(t/=0)||parseFloat(t)!=t&&!(t=NaN))||0==t)return r=Math.pow(+f,t),new Z(e?r%e:r);for(e?1<t&&f.gt(C)&&f.isInt()&&e.gt(C)&&e.isInt()?f=f.mod(e):(i=e,e=null):K&&(r=s(K/l+2)),n=new Z(C);;){if(o%2){if(!(n=n.times(f)).c)break;r?n.c.length>r&&(n.c.length=r):e&&(n=n.mod(e))}if(!(o=a(o/2)))break;f=f.times(f),r?f.c&&f.c.length>r&&(f.c.length=r):e&&(f=f.mod(e))}return e?n:(t<0&&(n=C.div(n)),i?n.mod(i):r?it(n,K,B):n)},P.toPrecision=function(t,e){return Q(this,null!=t&&V(t,1,y,24,"precision")?0|t:null,e,24)},P.toString=function(t){var e,r=this.s,n=this.e;return null===n?r?(e="Infinity",r<0&&(e="-"+e)):e="NaN":(e=g(this.c),e=null!=t&&V(t,2,64,25,"base")?Y(M(e,n),0|t,10,r):n<=D||q<=n?S(e,n):M(e,n),r<0&&this.c[0]&&(e="-"+e)),e},P.truncated=P.trunc=function(){return it(new Z(this),this.e+1,1)},P.valueOf=P.toJSON=function(){var t,e=this.e;return null===e?this.toString():(t=g(this.c),t=e<=D||q<=e?S(t,e):M(t,e),this.s<0?"-"+t:t)},P.isBigNumber=!0,null!=e&&Z.config(e),Z}()).default=i.BigNumber=i,void 0===(n=function(){return i}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){var n;!function(){"use strict";var i,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,a=Math.floor,f="[BigNumber Error] ",u=f+"Number primitive has more than 15 significant digits: ",c=1e14,h=14,d=9007199254740991,l=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,b=1e9;function v(t){var e=0|t;return 0<t||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 m(t,e){var r,n,i=t.c,o=e.c,s=t.s,a=e.s,f=t.e,u=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=f==u,!i||!o)return n?0:!i^r?1:-1;if(!n)return u<f^r?1:-1;for(a=(f=i.length)<(u=o.length)?f:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^r?1:-1;return f==u?0:u<f^r?1:-1}function g(t,e,r,n){if(t<e||r<t||t!==a(t))throw Error(f+(n||"Argument")+("number"==typeof t?t<e||r<t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function w(t){var e=t.c.length-1;return v(t.e/h)==e&&t.c[e]%2!=0}function _(t,e){return(1<t.length?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function A(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}(i=function t(e){var r,n,i,x,S,M,T,E,j,k,O,I=H.prototype={constructor:H,toString:null,valueOf:null},R=new H(1),N=20,P=4,C=-7,L=21,B=-1e7,D=1e7,q=!1,z=1,F=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},V="0123456789abcdefghijklmnopqrstuvwxyz";function H(t,e){var r,s,f,c,l,p,b,v,y=this;if(!(y instanceof H))return new H(t,e);if(null==e){if(t&&!0===t._isBigNumber)return y.s=t.s,void(!t.c||t.e>D?y.c=y.e=null:t.e<B?y.c=[y.e=0]:(y.e=t.e,y.c=t.c.slice()));if((p="number"==typeof t)&&0*t==0){if(y.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,l=t;10<=l;l/=10,c++);return void(D<c?y.c=y.e=null:(y.e=c,y.c=[t]))}v=String(t)}else{if(!o.test(v=String(t)))return i(y,v,p);y.s=45==v.charCodeAt(0)?(v=v.slice(1),-1):1}-1<(c=v.indexOf("."))&&(v=v.replace(".","")),0<(l=v.search(/e/i))?(c<0&&(c=l),c+=+v.slice(l+1),v=v.substring(0,l)):c<0&&(c=v.length)}else{if(g(e,2,V.length,"Base"),10==e)return X(y=new H(t),N+y.e+1,P);if(v=String(t),p="number"==typeof t){if(0*t!=0)return i(y,v,p,e);if(y.s=1/t<0?(v=v.slice(1),-1):1,H.DEBUG&&15<v.replace(/^0\.0*|\./,"").length)throw Error(u+t)}else y.s=45===v.charCodeAt(0)?(v=v.slice(1),-1):1;for(r=V.slice(0,e),c=l=0,b=v.length;l<b;l++)if(r.indexOf(s=v.charAt(l))<0){if("."==s){if(c<l){c=b;continue}}else if(!f&&(v==v.toUpperCase()&&(v=v.toLowerCase())||v==v.toLowerCase()&&(v=v.toUpperCase()))){f=!0,l=-1,c=0;continue}return i(y,String(t),p,e)}p=!1,-1<(c=(v=n(v,e,10,y.s)).indexOf("."))?v=v.replace(".",""):c=v.length}for(l=0;48===v.charCodeAt(l);l++);for(b=v.length;48===v.charCodeAt(--b););if(v=v.slice(l,++b)){if(b-=l,p&&H.DEBUG&&15<b&&(d<t||t!==a(t)))throw Error(u+y.s*t);if((c=c-l-1)>D)y.c=y.e=null;else if(c<B)y.c=[y.e=0];else{if(y.e=c,y.c=[],l=(c+1)%h,c<0&&(l+=h),l<b){for(l&&y.c.push(+v.slice(0,l)),b-=h;l<b;)y.c.push(+v.slice(l,l+=h));l=h-(v=v.slice(l)).length}else l-=b;for(;l--;v+="0");y.c.push(+v)}}else y.c=[y.e=0]}function G(t,e,r,n){for(var i,o,s=[0],a=0,f=t.length;a<f;){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()}function K(t,e,r){var n,i,o,s,a=0,f=t.length,u=e%p,c=e/p|0;for(t=t.slice();f--;)a=((i=u*(o=t[f]%p)+(n=c*o+(s=t[f]/p|0)*u)%p*p+a)/r|0)+(n/p|0)+c*s,t[f]=i%r;return a&&(t=[a].concat(t)),t}function W(t,e,r,n){var i,o;if(r!=n)o=n<r?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 Z(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]&&1<t.length;t.splice(0,1));}function Y(t,e,r,n){var i,o,s,a,f;if(null==r?r=P:g(r,0,8),!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)f=y(t.c),f=1==n||2==n&&(s<=C||L<=s)?_(f,s):A(f,s,"0");else if(o=(t=X(new H(t),e,r)).e,a=(f=y(t.c)).length,1==n||2==n&&(e<=o||o<=C)){for(;a<e;f+="0",a++);f=_(f,o)}else if(e-=s,f=A(f,o,"0"),a<o+1){if(0<--e)for(f+=".";e--;f+="0");}else if(0<(e+=o-a))for(o+1==a&&(f+=".");e--;f+="0");return t.s<0&&i?"-"+f:f}function J(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 $(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];10<=i;i/=10,n++);return(r=n+r*h-1)>D?t.c=t.e=null:r<B?t.c=[t.e=0]:(t.e=r,t.c=e),t}function X(t,e,r,n){var i,o,f,u,d,p,b,v=t.c,y=l;if(v){t:{for(i=1,u=v[0];10<=u;u/=10,i++);if((o=e-i)<0)o+=h,f=e,b=(d=v[p=0])/y[i-f-1]%10|0;else if((p=s((o+1)/h))>=v.length){if(!n)break t;for(;v.length<=p;v.push(0));d=b=0,f=(o%=h)-h+(i=1)}else{for(d=u=v[p],i=1;10<=u;u/=10,i++);b=(f=(o%=h)-h+i)<0?0:d/y[i-f-1]%10|0}if(n=n||e<0||null!=v[p+1]||(f<0?d:d%y[i-f-1]),n=r<4?(b||n)&&(0==r||r==(t.s<0?3:2)):5<b||5==b&&(4==r||n||6==r&&(0<o?0<f?d/y[i-f]:0:v[p-1])%10&1||r==(t.s<0?8:7)),e<1||!v[0])return v.length=0,n?(e-=t.e+1,v[0]=y[(h-e%h)%h],t.e=-e||0):v[0]=t.e=0,t;if(0==o?(v.length=p,u=1,p--):(v.length=p+1,u=y[h-o],v[p]=0<f?a(d/y[i-f]%y[f])*u:0),n)for(;;){if(0==p){for(o=1,f=v[0];10<=f;f/=10,o++);for(f=v[0]+=u,u=1;10<=f;f/=10,u++);o!=u&&(t.e++,v[0]==c&&(v[0]=1));break}if(v[p]+=u,v[p]!=c)break;v[p--]=0,u=1}for(o=v.length;0===v[--o];v.pop());}t.e>D?t.c=t.e=null:t.e<B&&(t.c=[t.e=0])}return t}function Q(t){var e,r=t.e;return null===r?t.toString():(e=y(t.c),e=r<=C||L<=r?_(e,r):A(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(f+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(g(r=t[e],0,b,e),N=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(g(r=t[e],0,8,e),P=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(g(r[0],-b,0,e),g(r[1],0,b,e),C=r[0],L=r[1]):(g(r,-b,b,e),C=-(L=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)g(r[0],-b,-1,e),g(r[1],1,b,e),B=r[0],D=r[1];else{if(g(r,-b,b,e),!r)throw Error(f+e+" cannot be zero: "+r);B=-(D=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(f+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw q=!r,Error(f+"crypto unavailable");q=r}else q=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(g(r=t[e],0,9,e),z=r),t.hasOwnProperty(e="POW_PRECISION")&&(g(r=t[e],0,b,e),F=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(f+e+" not an object: "+r);U=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+e+" invalid: "+r);V=r}}return{DECIMAL_PLACES:N,ROUNDING_MODE:P,EXPONENTIAL_AT:[C,L],RANGE:[B,D],CRYPTO:q,MODULO_MODE:z,POW_PRECISION:F,FORMAT:U,ALPHABET:V}},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)&&-b<=i&&i<=b&&i===a(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||c<=r||r!==a(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(f+"Invalid BigNumber: "+t)},H.maximum=H.max=function(){return J(arguments,I.lt)},H.minimum=H.min=function(){return J(arguments,I.gt)},H.random=(x=9007199254740992,S=Math.random()*x&2097151?function(){return a(Math.random()*x)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,o,u=0,c=[],d=new H(R);if(null==t?t=N:g(t,0,b),i=s(t/h),q)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));u<i;)9e15<=(o=131072*e[u]+(e[u+1]>>>11))?(r=crypto.getRandomValues(new Uint32Array(2)),e[u]=r[0],e[u+1]=r[1]):(c.push(o%1e14),u+=2);u=i/2}else{if(!crypto.randomBytes)throw q=!1,Error(f+"crypto unavailable");for(e=crypto.randomBytes(i*=7);u<i;)9e15<=(o=281474976710656*(31&e[u])+1099511627776*e[u+1]+4294967296*e[u+2]+16777216*e[u+3]+(e[u+4]<<16)+(e[u+5]<<8)+e[u+6])?crypto.randomBytes(7).copy(e,u):(c.push(o%1e14),u+=7);u=i/7}if(!q)for(;u<i;)(o=S())<9e15&&(c[u++]=o%1e14);for(i=c[--u],t%=h,i&&t&&(o=l[h-t],c[u]=a(i/o)*o);0===c[u];c.pop(),u--);if(u<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=h);for(u=1,o=c[0];10<=o;o/=10,u++);u<h&&(n-=h-u)}return d.e=n,d.c=c,d}),H.sum=function(){for(var t=1,e=arguments,r=new H(e[0]);t<e.length;)r=r.plus(e[t++]);return r},M="0123456789",n=function(t,e,n,i,o){var s,a,f,u,c,h,d,l,p=t.indexOf("."),b=N,v=P;for(0<=p&&(u=F,F=0,t=t.replace(".",""),h=(l=new H(e)).pow(t.length-p),F=u,l.c=G(A(y(h.c),h.e,"0"),10,n,M),l.e=l.c.length),f=u=(d=G(t,e,n,o?(s=V,M):(s=M,V))).length;0==d[--u];d.pop());if(!d[0])return s.charAt(0);if(p<0?--f:(h.c=d,h.e=f,h.s=i,d=(h=r(h,l,b,v,n)).c,c=h.r,f=h.e),p=d[a=f+b+1],u=n/2,c=c||a<0||null!=d[a+1],c=v<4?(null!=p||c)&&(0==v||v==(h.s<0?3:2)):u<p||p==u&&(4==v||c||6==v&&1&d[a-1]||v==(h.s<0?8:7)),a<1||!d[0])t=c?A(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(d.length=a,c)for(--n;++d[--a]>n;)d[a]=0,a||(++f,d=[1].concat(d));for(u=d.length;!d[--u];);for(p=0,t="";p<=u;t+=s.charAt(d[p++]));t=A(t,f,s.charAt(0))}return t},r=function(t,e,r,n,i){var o,s,f,u,d,l,p,b,y,m,g,w,_,A,x,S,M,T=t.s==e.s?1:-1,E=t.c,j=e.c;if(!(E&&E[0]&&j&&j[0]))return new H(t.s&&e.s&&(E?!j||E[0]!=j[0]:j)?E&&0==E[0]||!j?0*T:T/0:NaN);for(y=(b=new H(T)).c=[],T=r+(s=t.e-e.e)+1,i||(i=c,s=v(t.e/h)-v(e.e/h),T=T/h|0),f=0;j[f]==(E[f]||0);f++);if(j[f]>(E[f]||0)&&s--,T<0)y.push(1),u=!0;else{for(A=E.length,S=j.length,T+=2,1<(d=a(i/(j[f=0]+1)))&&(j=K(j,d,i),E=K(E,d,i),S=j.length,A=E.length),_=S,g=(m=E.slice(0,S)).length;g<S;m[g++]=0);M=j.slice(),M=[0].concat(M),x=j[0],j[1]>=i/2&&x++;do{if(d=0,(o=W(j,m,S,g))<0){if(w=m[0],S!=g&&(w=w*i+(m[1]||0)),1<(d=a(w/x)))for(i<=d&&(d=i-1),p=(l=K(j,d,i)).length,g=m.length;1==W(l,m,p,g);)d--,Z(l,S<p?M:j,p,i),p=l.length,o=1;else 0==d&&(o=d=1),p=(l=j.slice()).length;if(p<g&&(l=[0].concat(l)),Z(m,l,g,i),g=m.length,-1==o)for(;W(j,m,S,g)<1;)d++,Z(m,S<g?M:j,g,i),g=m.length}else 0===o&&(d++,m=[0]);y[f++]=d,m[0]?m[g++]=E[_]||0:(m=[E[_]],g=1)}while((_++<A||null!=m[0])&&T--);u=null!=m[0],y[0]||y.splice(0,1)}if(i==c){for(f=1,T=y[0];10<=T;T/=10,f++);X(b,r+(b.e=f+s*h-1)+1,n,u)}else b.e=s,b.r=+u;return b},T=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,j=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var i,o=r?e:e.replace(O,"");if(k.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(T,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(E,"$1").replace(j,"0.$1")),e!=o))return new H(o,i);if(H.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},I.absoluteValue=I.abs=function(){var t=new H(this);return t.s<0&&(t.s=1),t},I.comparedTo=function(t,e){return m(this,new H(t,e))},I.decimalPlaces=I.dp=function(t,e){var r,n,i;if(null!=t)return g(t,0,b),null==e?e=P:g(e,0,8),X(new H(this),t+this.e+1,e);if(!(r=this.c))return null;if(n=((i=r.length-1)-v(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},I.dividedBy=I.div=function(t,e){return r(this,new H(t,e),N,P)},I.dividedToIntegerBy=I.idiv=function(t,e){return r(this,new H(t,e),0,1)},I.exponentiatedBy=I.pow=function(t,e){var r,n,i,o,u,c,d,l,p=this;if((t=new H(t)).c&&!t.isInteger())throw Error(f+"Exponent not an integer: "+Q(t));if(null!=e&&(e=new H(e)),u=14<t.e,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return l=new H(Math.pow(+Q(p),u?2-w(t):+Q(t))),e?l.mod(e):l;if(c=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new H(NaN);(n=!c&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(9<t.e&&(0<p.e||p.e<-1||(0==p.e?1<p.c[0]||u&&24e7<=p.c[1]:p.c[0]<8e13||u&&p.c[0]<=9999975e7)))return o=p.s<0&&w(t)?-0:0,-1<p.e&&(o=1/o),new H(c?1/o:o);F&&(o=s(F/h+2))}for(d=u?(r=new H(.5),c&&(t.s=1),w(t)):(i=Math.abs(+Q(t)))%2,l=new H(R);;){if(d){if(!(l=l.times(p)).c)break;o?l.c.length>o&&(l.c.length=o):n&&(l=l.mod(e))}if(i){if(0===(i=a(i/2)))break;d=i%2}else if(X(t=t.times(r),t.e+1,1),14<t.e)d=w(t);else{if(0==(i=+Q(t)))break;d=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(e))}return n?l:(c&&(l=R.div(l)),e?l.mod(e):o?X(l,F,P,void 0):l)},I.integerValue=function(t){var e=new H(this);return null==t?t=P:g(t,0,8),X(e,e.e+1,t)},I.isEqualTo=I.eq=function(t,e){return 0===m(this,new H(t,e))},I.isFinite=function(){return!!this.c},I.isGreaterThan=I.gt=function(t,e){return 0<m(this,new H(t,e))},I.isGreaterThanOrEqualTo=I.gte=function(t,e){return 1===(e=m(this,new H(t,e)))||0===e},I.isInteger=function(){return!!this.c&&v(this.e/h)>this.c.length-2},I.isLessThan=I.lt=function(t,e){return m(this,new H(t,e))<0},I.isLessThanOrEqualTo=I.lte=function(t,e){return-1===(e=m(this,new H(t,e)))||0===e},I.isNaN=function(){return!this.s},I.isNegative=function(){return this.s<0},I.isPositive=function(){return 0<this.s},I.isZero=function(){return!!this.c&&0==this.c[0]},I.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 f=s.e/h,u=t.e/h,d=s.c,l=t.c;if(!f||!u){if(!d||!l)return d?(t.s=-e,t):new H(l?s:NaN);if(!d[0]||!l[0])return l[0]?(t.s=-e,t):new H(d[0]?s:3==P?-0:0)}if(f=v(f),u=v(u),d=d.slice(),a=f-u){for((i=(o=a<0)?(a=-a,d):(u=f,l)).reverse(),e=a;e--;i.push(0));i.reverse()}else for(n=(o=(a=d.length)<(e=l.length))?a:e,a=e=0;e<n;e++)if(d[e]!=l[e]){o=d[e]<l[e];break}if(o&&(i=d,d=l,l=i,t.s=-t.s),0<(e=(n=l.length)-(r=d.length)))for(;e--;d[r++]=0);for(e=c-1;a<n;){if(d[--n]<l[n]){for(r=n;r&&!d[--r];d[r]=e);--d[r],d[n]+=c}d[n]-=l[n]}for(;0==d[0];d.splice(0,1),--u);return d[0]?$(t,d,u):(t.s=3==P?-1:1,t.c=[t.e=0],t)},I.modulo=I.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==z?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,z),(t=o.minus(n.times(t))).c[0]||1!=z||(t.s=o.s),t)},I.multipliedBy=I.times=function(t,e){var r,n,i,o,s,a,f,u,d,l,b,y,m,g,w,_=this,A=_.c,x=(t=new H(t,e)).c;if(!(A&&x&&A[0]&&x[0]))return!_.s||!t.s||A&&!A[0]&&!x||x&&!x[0]&&!A?t.c=t.e=t.s=null:(t.s*=_.s,A&&x?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=v(_.e/h)+v(t.e/h),t.s*=_.s,(f=A.length)<(l=x.length)&&(m=A,A=x,x=m,i=f,f=l,l=i),i=f+l,m=[];i--;m.push(0));for(g=c,w=p,i=l;0<=--i;){for(r=0,b=x[i]%w,y=x[i]/w|0,o=i+(s=f);i<o;)r=((u=b*(u=A[--s]%w)+(a=y*u+(d=A[s]/w|0)*b)%w*w+m[o]+r)/g|0)+(a/w|0)+y*d,m[o--]=u%g;m[o]=r}return r?++n:m.splice(0,1),$(t,m,n)},I.negated=function(){var t=new H(this);return t.s=-t.s||null,t},I.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,f=t.c;if(!o||!s){if(!a||!f)return new H(i/0);if(!a[0]||!f[0])return f[0]?t:new H(a[0]?n:0*i)}if(o=v(o),s=v(s),a=a.slice(),i=o-s){for((r=0<i?(s=o,f):(i=-i,a)).reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(e=f.length)<0&&(r=f,f=a,a=r,e=i),i=0;e;)i=(a[--e]=a[e]+f[e]+i)/c|0,a[e]=c===a[e]?0:a[e]%c;return i&&(a=[i].concat(a),++s),$(t,a,s)},I.precision=I.sd=function(t,e){var r,n,i;if(null!=t&&t!==!!t)return g(t,1,b),null==e?e=P:g(e,0,8),X(new H(this),t,e);if(!(r=this.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];10<=i;i/=10,n++);}return t&&this.e+1>n&&(n=this.e+1),n},I.shiftedBy=function(t){return g(t,-d,d),this.times("1e"+t)},I.squareRoot=I.sqrt=function(){var t,e,n,i,o,s=this,a=s.c,f=s.s,u=s.e,c=N+4,h=new H("0.5");if(1!==f||!a||!a[0])return new H(!f||f<0&&(!a||a[0])?NaN:a?s:1/0);if((n=0==(f=Math.sqrt(+Q(s)))||f==1/0?(((e=y(a)).length+u)%2==0&&(e+="0"),f=Math.sqrt(+e),u=v((u+1)/2)-(u<0||u%2),new H(e=f==1/0?"1e"+u:(e=f.toExponential()).slice(0,e.indexOf("e")+1)+u)):new H(f+"")).c[0])for((f=(u=n.e)+c)<3&&(f=0);;)if(o=n,n=h.times(o.plus(r(s,o,c,1))),y(o.c).slice(0,f)===(e=y(n.c)).slice(0,f)){if(n.e<u&&--f,"9999"!=(e=e.slice(f-3,f+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(X(n,n.e+N+2,1),t=!n.times(n).eq(s));break}if(!i&&(X(o,o.e+N+2,0),o.times(o).eq(s))){n=o;break}c+=4,f+=4,i=1}return X(n,n.e+N+1,P,t)},I.toExponential=function(t,e){return null!=t&&(g(t,0,b),t++),Y(this,t,e,1)},I.toFixed=function(t,e){return null!=t&&(g(t,0,b),t=t+this.e+1),Y(this,t,e)},I.toFormat=function(t,e,r){var n;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=U;else if("object"!=typeof r)throw Error(f+"Argument not an object: "+r);if(n=this.toFixed(t,e),this.c){var i,o=n.split("."),s=+r.groupSize,a=+r.secondaryGroupSize,u=r.groupSeparator||"",c=o[0],h=o[1],d=this.s<0,l=d?c.slice(1):c,p=l.length;if(a&&(i=s,s=a,p-=a=i),0<s&&0<p){for(i=p%s||s,c=l.substr(0,i);i<p;i+=s)c+=u+l.substr(i,s);0<a&&(c+=u+l.slice(i)),d&&(c="-"+c)}n=h?c+(r.decimalSeparator||"")+((a=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):c}return(r.prefix||"")+n+(r.suffix||"")},I.toFraction=function(t){var e,n,i,o,s,a,u,c,d,p,b,v,m=this,g=m.c;if(null!=t&&(!(u=new H(t)).isInteger()&&(u.c||1!==u.s)||u.lt(R)))throw Error(f+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Q(u));if(!g)return new H(m);for(e=new H(R),d=n=new H(R),i=c=new H(R),v=y(g),s=e.e=v.length-m.e-1,e.c[0]=l[(a=s%h)<0?h+a:a],t=!t||0<u.comparedTo(e)?0<s?e:d:u,a=D,D=1/0,u=new H(v),c.c[0]=0;p=r(u,e,0,1),1!=(o=n.plus(p.times(i))).comparedTo(t);)n=i,i=o,d=c.plus(p.times(o=d)),c=o,e=u.minus(p.times(o=e)),u=o;return o=r(t.minus(n),i,0,1),c=c.plus(o.times(d)),n=n.plus(o.times(i)),c.s=d.s=m.s,b=r(d,i,s*=2,P).minus(m).abs().comparedTo(r(c,n,s,P).minus(m).abs())<1?[d,i]:[c,n],D=a,b},I.toNumber=function(){return+Q(this)},I.toPrecision=function(t,e){return null!=t&&g(t,1,b),Y(this,t,e,2)},I.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":(e=null==t?o<=C||L<=o?_(y(r.c),o):A(y(r.c),o,"0"):10===t?A(y((r=X(new H(r),N+o+1,P)).c),r.e,"0"):(g(t,2,V.length,"Base"),n(A(y(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},I.valueOf=I.toJSON=function(){return Q(this)},I._isBigNumber=!0,null!=e&&H.set(e),H}()).default=i.BigNumber=i,void 0===(n=function(){return i}.call(e,r,e,t))||(t.exports=n)}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){"use strict";var n=r(9).EventEmitter,i=r(3),o=r(5);function s(t,e,r){n.call(this),this._remote=t,this._command=e,this._filter=r||function(t){return t},this.message={}}i.inherits(s,n),s.prototype.submit=function(t){var e=this;for(var r in e.message)if(e.message[r]instanceof Error)return t(e.message[r].message);e._remote._submit(e._command,e.message,e._filter,t)},s.prototype.selectLedger=function(t){return"string"==typeof t&&~o.LEDGER_STATES.indexOf(t)?this.message.ledger_index=t:Number(t)?this.message.ledger_index=Number(t):/^[A-F0-9]+$/.test(t)?this.message.ledger_hash=t:this.message.ledger_index="validated",this},t.exports=s},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){"use strict";e.__esModule=!0;var n,i=(n=r(83))&&n.__esModule?n:{default:n};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),(0,i.default)(t,n.key,n)}}e.default=function(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),t}},function(t,e,r){"use strict";(function(e){var n=o(r(31)),i=o(r(32));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return f.sha256().update(t).digest()}var a=r(34),f=r(7),u=new(r(0).ec)("secp256k1"),c=r(108),h=r(18).hexToBytes,d=r(18).bytesToHex,l=r(111),p=r(122),b=r(123),v=((0,i.default)(y,[{key:"_encode",value:function(t,r){var n=function(t,e){var r=l.create(1+e.length);return r[0]=t,l.copy(e,r,1,0,e.length),r}(t,r),i=function(t,e){var r=l.create(t.length+e.length);return l.copy(t,r),l.copy(e,r,t.length,0,e.length),r}(n,e.from(s(s(n)).slice(0,4)));return this._base58.encode(i)}},{key:"_decode",value:function(t,e){var r=this._base58.decode(e);if(!r||r[0]!==t||r.length<5)throw new Error("invalid input size");for(var n=s(s(r.slice(0,-4))).slice(0,4),i=r.slice(-4),o=0;4!==o;o+=1)if(n[o]!==i[o])throw new Error("invalid checksum");return r.slice(1,-4)}},{key:"generateSeed",value:function(){var t=a(16);return this._encode(this._SEED_PREFIX,t)}},{key:"deriveKeyPair",value:function(t){var e="00"+function(t){var e=u.curve.n,r=c.ScalarMultiple(t),n=u.g.mul(r);return c.ScalarMultiple(n.encodeCompressed(),0).add(r).mod(e)}(this._decode(this._SEED_PREFIX,t)).toString(16,64).toUpperCase(),r=d(u.keyFromPrivate(e.slice(2)).getPublic().encodeCompressed());return{privateKey:e,publicKey:r}}},{key:"deriveAddress",value:function(t){var r=s(h(t)),n=e.from(f.ripemd160().update(r).digest());return this._encode(this._ACCOUNT_PREFIX,n)}},{key:"checkAddress",value:function(t){try{return this._decode(this._ACCOUNT_PREFIX,t),!0}catch(t){return!1}}},{key:"convertAddressToBytes",value:function(t){try{return this._decode(this._ACCOUNT_PREFIX,t)}catch(t){throw new Error("convert address to bytes in error")}}},{key:"convertBytesToAddress",value:function(t){try{return this._encode(this._ACCOUNT_PREFIX,t)}catch(t){throw new Error("convert bytes to address in error")}}}]),y);function y(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"swt";(0,n.default)(this,y);var e=p.find(function(e){return e.currency.toLowerCase()===t.toLowerCase()});if(!e)throw new Error("config of "+t+" is empty");this._SEED_PREFIX=e.SEED_PREFIX,this._ACCOUNT_PREFIX=e.ACCOUNT_PREFIX,this._base58=b(e.ACCOUNT_ALPHABET)}t.exports=v}).call(this,r(22).Buffer)},function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return(n=n||new i(null)).generate(t)},(t.exports.Rand=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(86);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},function(t,e,r){"use strict";var n=r(2).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}},function(t,e,r){"use strict";var n=r(2),i=r(15),o=r(35),s=r(8),a=n.sum32,f=n.sum32_4,u=n.sum32_5,c=o.ch32,h=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,v=i.BlockHash,y=[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 m(){if(!(this instanceof m))return new m;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(m,v),(t.exports=m).blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.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]=f(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],v=this.h[2],y=this.h[3],m=this.h[4],g=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=u(_,l(m),c(m,g,w),this.k[n],r[n]),x=a(d(i),h(i,o,v));_=w,w=g,g=m,m=a(y,A),y=v,v=o,o=i,i=a(A,x)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],v),this.h[3]=a(this.h[3],y),this.h[4]=a(this.h[4],m),this.h[5]=a(this.h[5],g),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},m.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(2),i=r(15),o=r(8),s=n.rotr64_hi,a=n.rotr64_lo,f=n.shr64_hi,u=n.shr64_lo,c=n.sum64,h=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,v=n.sum64_5_lo,y=i.BlockHash,m=[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 g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,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 x(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 T(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function E(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function j(t,e){var r=s(t,e,1)^s(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,1)^a(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=s(t,e,19)^s(e,t,29)^f(t,e,6);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,19)^a(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(g,y),(t.exports=g).blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.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=O(r[n-4],r[n-3]),o=I(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],f=j(r[n-30],r[n-29]),u=k(r[n-30],r[n-29]),c=r[n-32],h=r[n-31];r[n]=l(i,o,s,a,f,u,c,h),r[n+1]=p(i,o,s,a,f,u,c,h)}},g.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],f=this.h[4],u=this.h[5],l=this.h[6],p=this.h[7],y=this.h[8],m=this.h[9],g=this.h[10],j=this.h[11],k=this.h[12],O=this.h[13],I=this.h[14],R=this.h[15];o(this.k.length===r.length);for(var N=0;N<r.length;N+=2){var P=I,C=R,L=T(y,m),B=E(y,m),D=w(y,0,g,0,k),q=_(0,m,0,j,0,O),z=this.k[N],F=this.k[N+1],U=r[N],V=r[N+1],H=b(P,C,L,B,D,q,z,F,U,V),G=v(P,C,L,B,D,q,z,F,U,V);P=S(n,i),C=M(n,i),L=A(n,0,s,0,f),B=x(0,i,0,a,0,u);var K=h(P,C,L,B),W=d(P,C,L,B);I=k,R=O,k=g,O=j,g=y,j=m,y=h(l,p,H,G),m=d(p,p,H,G),l=f,p=u,f=s,u=a,s=n,a=i,n=h(H,G,K,W),i=d(H,G,K,W)}c(this.h,0,n,i),c(this.h,2,s,a),c(this.h,4,f,u),c(this.h,6,l,p),c(this.h,8,y,m),c(this.h,10,g,j),c(this.h,12,k,O),c(this.h,14,I,R)},g.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=e;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}},function(t,e){var r,n;t.exports=r={},n="undefined"==typeof WeakMap?null:new WeakMap,r.get=n?function(t){var e=n.get(t.buffer);return e||n.set(t.buffer,e=new DataView(t.buffer,0)),e}:function(t){return new DataView(t.buffer,0)}},function(t,e,r){var n=r(41);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},function(t,e,r){var n=r(12),i=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e,r){var n=r(16),i=r(19);t.exports=function(t){if(!i(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,r){var n=r(4).Symbol;t.exports=n},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(10))},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return"number"==typeof t&&-1<t&&t%1==0&&t<=9007199254740991}},function(t,e){var r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&r.test(t))&&-1<t&&t%1==0&&t<e}},function(t,e,r){var n=r(146),i=r(20),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,f=n(function(){return arguments}())?n:function(t){return i(t)&&s.call(t,"callee")&&!a.call(t,"callee")};t.exports=f},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){(function(t){var n=r(4),i=r(147),o=e&&!e.nodeType&&e,s=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=s&&s.exports===o?n.Buffer:void 0,f=(a?a.isBuffer:void 0)||i;t.exports=f}).call(this,r(11)(t))},function(t,e,r){var n=r(148),i=r(149),o=r(150),s=o&&o.isTypedArray,a=s?i(s):n;t.exports=a},function(t,e,r){(function(t,n){var i;/*! https://mths.be/utf8js v2.1.2 by @mathias */!function(){var o=(t&&t.exports,"object"==typeof n&&n);o.global!==o&&o.window;var s,a,f,u=String.fromCharCode;function c(t){for(var e,r,n=[],i=0,o=t.length;i<o;)55296<=(e=t.charCodeAt(i++))&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function h(t){if(55296<=t&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function d(t,e){return u(t>>e&63|128)}function l(t){if(0==(4294967168&t))return u(t);var e="";return 0==(4294965248&t)?e=u(t>>6&31|192):0==(4294901760&t)?(h(t),e=u(t>>12&15|224),e+=d(t,6)):0==(4292870144&t)&&(e=u(t>>18&7|240),e+=d(t,12),e+=d(t,6)),e+u(63&t|128)}function p(){if(a<=f)throw Error("Invalid byte index");var t=255&s[f];if(f++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function b(){var t,e;if(a<f)throw Error("Invalid byte index");if(f==a)return!1;if(t=255&s[f],f++,0==(128&t))return t;if(192==(224&t)){if(128<=(e=(31&t)<<6|p()))return e;throw Error("Invalid continuation byte")}if(224==(240&t)){if(2048<=(e=(15&t)<<12|p()<<6|p()))return h(e),e;throw Error("Invalid continuation byte")}if(240==(248&t)&&65536<=(e=(7&t)<<18|p()<<12|p()<<6|p())&&e<=1114111)return e;throw Error("Invalid UTF-8 detected")}var v={version:"2.1.2",encode:function(t){for(var e=c(t),r=e.length,n=-1,i="";++n<r;)i+=l(e[n]);return i},decode:function(t){s=c(t),a=s.length,f=0;for(var e,r=[];!1!==(e=b());)r.push(e);return function(t){for(var e,r=t.length,n=-1,i="";++n<r;)65535<(e=t[n])&&(i+=u((e-=65536)>>>10&1023|55296),e=56320|1023&e),i+=u(e);return i}(r)}};void 0===(i=function(){return v}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(11)(t),r(10))},function(t,e,r){var n=r(3),i=r(9).EventEmitter,o=r(5);function s(t){i.call(this);var e=this;e.setMaxListeners(0),e._remote=t,e._accounts={},e._token=t._token||"swt",e.on("newListener",function(t,r){if("removeListener"!==t)return o.isValidAddress(t,e._token)?void(e._accounts[t]=r):(e.account=new Error("invalid account"),e)}),e.on("removeListener",function(t){if(!o.isValidAddress(t,e._token))return e.account=new Error("invalid account"),e;delete e._accounts[t]}),e._remote.on("transactions",e.__infoAffectedAccounts.bind(e))}n.inherits(s,i),s.prototype.__infoAffectedAccounts=function(t){var e=o.affectedAccounts(t);for(var r in e){var n=this._accounts[e[r]],i=o.processTx(t,e[r],this._token);n&&n(i)}},t.exports=s},function(t,e,r){"use strict";var n=r(3),i=r(9).EventEmitter,o=r(54),s=r(5),a=r(6).Wallet,f=r(57);function u(t,e){i.call(this);var r=this;r._token=t._token||"swt";var n=s.getFee(r._token);r._remote=t,r.tx_json={Flags:0,Fee:n},r._filter=e||function(t){return t},r._secret=void 0}function c(t,e){if(t.tx_json.Fee=t.tx_json.Fee/1e6,t.tx_json.Amount&&JSON.stringify(t.tx_json.Amount).indexOf("{")<0&&(t.tx_json.Amount=Number(t.tx_json.Amount)/1e6),t.tx_json.Memos)for(var r=t.tx_json.Memos,n=0;n<r.length;n++)r[n].Memo.MemoData=o.decode(s.hexToString(r[n].Memo.MemoData));t.tx_json.SendMax&&"string"==typeof t.tx_json.SendMax&&(t.tx_json.SendMax=Number(t.tx_json.SendMax)/1e6),t.tx_json.TakerPays&&JSON.stringify(t.tx_json.TakerPays).indexOf("{")<0&&(t.tx_json.TakerPays=Number(t.tx_json.TakerPays)/1e6),t.tx_json.TakerGets&&JSON.stringify(t.tx_json.TakerGets).indexOf("{")<0&&(t.tx_json.TakerGets=Number(t.tx_json.TakerGets)/1e6);try{var i={seed:t._secret};t.tx_json.blob=f(t.tx_json,i,t._token),t._local_sign=!0,e(null,t.tx_json.blob)}catch(t){e(t)}}n.inherits(u,i),u.set_clear_flags={AccountSet:{asfRequireDest:1,asfRequireAuth:2,asfDisallowSWT:3,asfDisableMaster:4,asfNoFreeze:6,asfGlobalFreeze:7}},u.flags={Universal:{FullyCanonicalSig:2147483648},AccountSet:{RequireDestTag:65536,OptionalDestTag:131072,RequireAuth:262144,OptionalAuth:524288,DisallowSWT:1048576,AllowSWT:2097152},TrustSet:{SetAuth:65536,NoSkywell:131072,SetNoSkywell:131072,ClearNoSkywell:262144,SetFreeze:1048576,ClearFreeze:2097152},OfferCreate:{Passive:65536,ImmediateOrCancel:131072,FillOrKill:262144,Sell:524288},Payment:{NoSkywellDirect:65536,PartialPayment:131072,LimitQuality:262144},RelationSet:{Authorize:1,Freeze:17}},u.OfferTypes=["Sell","Buy"],u.RelationTypes=["trust","authorize","freeze","unfreeze"],u.AccountSetTypes=["property","delegate","signer"],u.prototype.parseJson=function(t){return this.tx_json=t,this},u.prototype.getAccount=function(){return this.tx_json.Account},u.prototype.getTransactionType=function(){return this.tx_json.TransactionType},u.prototype.setSecret=function(t){a.isValidSecret(t,this._token)?this._secret=t:this.tx_json._secret=new Error("invalid secret")},u.prototype.addMemo=function(t){if("string"!=typeof t)return this.tx_json.memo_type=new TypeError("invalid memo type"),this;if(2048<t.length)return this.tx_json.memo_len=new TypeError("memo is too long"),this;var e={};e.MemoData=s.stringToHex(o.encode(t)),this.tx_json.Memos=(this.tx_json.Memos||[]).concat({Memo:e})},u.prototype.setFee=function(t){var e=parseInt(t);return isNaN(e)?(this.tx_json.Fee=new TypeError("invalid fee"),this):t<10?(this.tx_json.Fee=new TypeError("fee is too low"),this):void(this.tx_json.Fee=e)},u.prototype.setPath=function(t){if("string"!=typeof t||40!==t.length)return new Error("invalid path key");var e=this._remote._paths.get(t);if(!e)return new Error("non exists path key");if("[]"!==e.path){var r=JSON.parse(e.path);this.tx_json.Paths=r;var n=function(t,e){if("string"==typeof t&&Number(t)){var r=parseInt(1.0001*Number(t));return String(r)}if("object"==typeof t&&s.isValidAmount(t,e)){var n=1.0001*Number(t.value);return t.value=String(n),t}return new Error("invalid amount to max")}(e.choice,this._token);this.tx_json.SendMax=n}},u.prototype.setSendMax=function(t){if(!s.isValidAmount(t,this._token))return new Error("invalid send max amount");this.tx_json.SendMax=t},u.prototype.setTransferRate=function(t){if("number"!=typeof t||t<0||1<t)return new Error("invalid transfer rate");this.tx_json.TransferRate=1e9*(t+1)},u.prototype.setFlags=function(t){if(void 0!==t)if("number"!=typeof t)for(var e=u.flags[this.getTransactionType()]||{},r=Array.isArray(t)?t:[].concat(t),n=0;n<r.length;++n){var i=r[n];e.hasOwnProperty(i)&&(this.tx_json.Flags+=e[i])}else this.tx_json.Flags=t},u.prototype.setSequence=function(t){if(!/^\+?[1-9][0-9]*$/.test(t))return this.tx_json.Sequence=new TypeError("invalid sequence"),this;this.tx_json.Sequence=Number(t)},u.prototype.sign=function(t){var e=this;e.tx_json.Sequence?c(e,t):this._remote.requestAccountInfo({account:e.tx_json.Account,type:"trust"}).submit(function(r,n){if(r)return t(r);e.tx_json.Sequence=n.account_data.Sequence,c(e,t)})},u.prototype.submit=function(t){var e=this;for(var r in e.tx_json)if(e.tx_json[r]instanceof Error)return t(e.tx_json[r].message);var n={};"Signer"===e.tx_json.TransactionType?(n={tx_blob:e.tx_json.blob},e._remote._submit("submit",n,e._filter,t)):e._remote._local_sign?e.sign(function(r){if(r)return t("sign error: "+r);var n={tx_blob:e.tx_json.blob};e._remote._submit("submit",n,e._filter,t)}):(n={secret:e._secret,tx_json:e.tx_json},e._remote._submit("submit",n,e._filter,t))},t.exports=u},function(t,e,r){var n=r(6).Wallet,i=r(164).Serializer;t.exports=function(t,e,r){r=r||"swt";var o=new n(e.seed,r);t.SigningPubKey=o.getPublicKey();var s=i.from_json(t,r).hash(1398036480,r);return t.TxnSignature=o.signTx(s),i.from_json(t,r).to_hex()}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){function r(){}t.super_=e,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)!==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).wordSize=26;try{s=r(166).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|=49<=s&&s<=54?s-49+10:17<=s&&s<=22?s-17+10:15&s}return n}function f(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+=49<=a?a-49+10:17<=a?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 0<t.cmp(e)?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)&&2<=e&&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):(t<9007199254740992?(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1]):(n(t<=9999999999999900),this.words=[67108863&t,t/67108864&67108863,2]),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;0<=i;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,26<=(a+=24)&&(a-=26,o++);else if("le"===r)for(o=i=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,26<=(a+=24)&&(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;e<=r;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,26<=(o+=24)&&(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];for(var n=0,i=this.length=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,c=r;c<a;c+=n)u=f(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!=s){var h=1;for(u=f(t,c,t.length,e),c=0;c<s;c++)h*=e;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},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(;1<this.length&&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 u=["","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"],c=[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;n=(r.length=n)-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,f=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var c=f>>>26,h=67108863&f,d=Math.min(u,e.length-1),l=Math.max(0,u-t.length+1);l<=d;l++){var p=u-l|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[l])+h)/67108864|0,h=67108863&s}r.words[u]=0|h,f=0|c}return 0!==f?r.words[u]=0|f: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],f=(16777215&(a<<i|o)).toString(16);r=0!=(o=a>>>24-i&16777215)||s!==this.length-1?u[6-f.length]+f+r:f+r,26<=(i+=2)&&(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)&&2<=t&&t<=36){var d=c[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:u[d-b.length]+b+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]&&2!==this.words[2]?2<this.length&&n(!1,"Number can only safely store up to 54 bits"):t+=4503599627370496+67108864*this.words[1],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(0<o,"Requested array length <= 0"),this.strip();var s,a,f="le"===e,u=new t(o),c=this.clone();if(f){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),u[o-a-1]=s}return u},o.prototype._countBits=Math.clz32?function(t){return 32-Math.clz32(t)}:function(t){var e=t,r=0;return 4096<=e&&(r+=13,e>>>=13),64<=e&&(r+=7,e>>>=7),8<=e&&(r+=4,e>>>=4),2<=e&&(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;r=this.length>t.length?(e=this,t):(e=t,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&&0<=t);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),0<r&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return 0<r&&(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&&0<=t);var r=t/26|0,i=t%26;return this._expand(1+r),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();n=this.length>t.length?(r=this,t):(r=t,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;n=0<i?(r=this,t):(r=t,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 l=function(t,e,r){var n,i,o,s=t.words,a=e.words,f=r.words,u=0,c=0|s[0],h=8191&c,d=c>>>13,l=0|s[1],p=8191&l,b=l>>>13,v=0|s[2],y=8191&v,m=v>>>13,g=0|s[3],w=8191&g,_=g>>>13,A=0|s[4],x=8191&A,S=A>>>13,M=0|s[5],T=8191&M,E=M>>>13,j=0|s[6],k=8191&j,O=j>>>13,I=0|s[7],R=8191&I,N=I>>>13,P=0|s[8],C=8191&P,L=P>>>13,B=0|s[9],D=8191&B,q=B>>>13,z=0|a[0],F=8191&z,U=z>>>13,V=0|a[1],H=8191&V,G=V>>>13,K=0|a[2],W=8191&K,Z=K>>>13,Y=0|a[3],J=8191&Y,$=Y>>>13,X=0|a[4],Q=8191&X,tt=X>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ft=8191&at,ut=at>>>13,ct=0|a[8],ht=8191&ct,dt=ct>>>13,lt=0|a[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(h,F))|0)+((8191&(i=(i=Math.imul(h,U))+Math.imul(d,F)|0))<<13)|0;u=((o=Math.imul(d,U))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,U))+Math.imul(b,F)|0,o=Math.imul(b,U);var yt=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,H)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,U))+Math.imul(m,F)|0,o=Math.imul(m,U),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,G)|0;var mt=(u+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(d,W)|0))<<13)|0;u=((o=o+Math.imul(d,Z)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,U))+Math.imul(_,F)|0,o=Math.imul(_,U),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0;var gt=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,$)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,U))+Math.imul(S,F)|0,o=Math.imul(S,U),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,$)|0;var wt=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,Q)|0))<<13)|0;u=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,U))+Math.imul(E,F)|0,o=Math.imul(E,U),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Z)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Z)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;u=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(k,F),i=(i=Math.imul(k,U))+Math.imul(O,F)|0,o=Math.imul(O,U),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,Z)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var At=(u+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,ot)|0))<<13)|0;u=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,U))+Math.imul(N,F)|0,o=Math.imul(N,U),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,$)|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(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var xt=(u+(n=n+Math.imul(h,ft)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(d,ft)|0))<<13)|0;u=((o=o+Math.imul(d,ut)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,U))+Math.imul(L,F)|0,o=Math.imul(L,U),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(k,W)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,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(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(b,ft)|0,o=o+Math.imul(b,ut)|0;var St=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;u=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,U))+Math.imul(q,F)|0,o=Math.imul(q,U),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(R,W)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,Z)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,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(y,ft)|0,i=(i=i+Math.imul(y,ut)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,ut)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,dt)|0;var Mt=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;u=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,G))+Math.imul(q,H)|0,o=Math.imul(q,G),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ut)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,ut)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,dt)|0;var Tt=(u+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Z))+Math.imul(q,W)|0,o=Math.imul(q,Z),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,$)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(x,ft)|0,i=(i=i+Math.imul(x,ut)|0)+Math.imul(S,ft)|0,o=o+Math.imul(S,ut)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,dt)|0;var Et=(u+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,bt)|0)+Math.imul(m,pt)|0))<<13)|0;u=((o=o+Math.imul(m,bt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,$))+Math.imul(q,J)|0,o=Math.imul(q,$),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(E,ft)|0,o=o+Math.imul(E,ut)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(S,ht)|0,o=o+Math.imul(S,dt)|0;var jt=(u+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,tt))+Math.imul(q,Q)|0,o=Math.imul(q,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(O,ft)|0,o=o+Math.imul(O,ut)|0,n=n+Math.imul(T,ht)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(E,ht)|0,o=o+Math.imul(E,dt)|0;var kt=(u+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(S,pt)|0))<<13)|0;u=((o=o+Math.imul(S,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(q,rt)|0,o=Math.imul(q,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,dt)|0;var Ot=(u+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(E,pt)|0))<<13)|0;u=((o=o+Math.imul(E,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,st))+Math.imul(q,ot)|0,o=Math.imul(q,st),n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,ut)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ut)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(N,ht)|0,o=o+Math.imul(N,dt)|0;var It=(u+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ft),i=(i=Math.imul(D,ut))+Math.imul(q,ft)|0,o=Math.imul(q,ut),n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,dt)|0;var Rt=(u+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,ht),i=(i=Math.imul(D,dt))+Math.imul(q,ht)|0,o=Math.imul(q,dt);var Nt=(u+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863;var Pt=(u+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,bt))+Math.imul(q,pt)|0))<<13)|0;return u=((o=Math.imul(q,bt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,f[0]=vt,f[1]=yt,f[2]=mt,f[3]=gt,f[4]=wt,f[5]=_t,f[6]=At,f[7]=xt,f[8]=St,f[9]=Mt,f[10]=Tt,f[11]=Et,f[12]=jt,f[13]=kt,f[14]=Ot,f[15]=It,f[16]=Rt,f[17]=Nt,f[18]=Pt,0!==u&&(f[19]=u,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(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,f=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=f;u++){var c=o-u,h=(0|t.words[c])*(0|e.words[u]),d=67108863&h;a=67108863&(d=d+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>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)},b.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},b.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},b.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]]},b.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,f=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var h=f,d=u,l=0;l<s;l++){var p=r[c+l],b=n[c+l],v=r[c+l+s],y=n[c+l+s],m=h*v-d*y;y=h*y+d*v,v=m,r[c+l]=p+v,n[c+l]=b+y,r[c+l+s]=p-v,n[c+l+s]=b-y,l!==a&&(m=f*h-u*d,d=f*d+u*h,h=m)}},b.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},b.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}},b.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},b.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))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.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),f=new Array(n),u=new Array(n),c=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,u,n),this.transform(s,o,a,f,n,i),this.transform(u,o,c,h,n,i);for(var l=0;l<n;l++){var p=a[l]*c[l]-f[l]*h[l];f[l]=a[l]*h[l]+f[l]*c[l],a[l]=p}return this.conjugate(a,f,n),this.transform(a,f,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,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&&0<=t);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,f=(0|this.words[e])-a<<r;this.words[e]=f|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!=i){for(e=this.length-1;0<=e;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&&0<=t),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,f=r;if(i-=s,i=Math.max(0,i),f){for(var u=0;u<s;u++)f.words[u]=this.words[u];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var c=0;for(u=this.length-1;0<=u&&(0!==c||i<=u);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&a}return f&&0!==c&&(f.words[f.length++]=c),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&&0<=t);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&&0<=t);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.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&&67108864<=this.words[e];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 f=(0|t.words[i])*e;a=((o-=67108863&f)>>26)-(f/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),i=a=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,f=n.length-i.length;if("mod"!==e){(a=new o(null)).length=1+f,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var c=n.clone()._ishlnsubmul(i,1,f);0===c.negative&&(n=c,a&&(a.words[f]=1));for(var h=f-1;0<=h;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}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;0<=i;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;0<=r;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),f=new o(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(0<d)for(e.iushrn(d);0<d--;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(0<p)for(r.iushrn(p);0<p--;)(a.isOdd()||f.isOdd())&&(a.iadd(c),f.isub(h)),a.iushrn(1),f.iushrn(1);0<=e.cmp(r)?(e.isub(r),i.isub(a),s.isub(f)):(r.isub(e),a.isub(i),f.isub(s))}return{a:a,b:f,gcd:r.iushln(u)}},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),f=r.clone();0<e.cmpn(1)&&0<r.cmpn(1);){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(0<u)for(e.iushrn(u);0<u--;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(0<h)for(r.iushrn(h);0<h--;)a.isOdd()&&a.iadd(f),a.iushrn(1);0<=e.cmp(r)?(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;for(var n=r.negative=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(1+r),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(),1<this.length)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;0<=r;r--){var n=0|this.words[r],i=0|t.words[r];if(n!=i){n<i?e=-1:i<n&&(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 0<=this.cmpn(t)},o.prototype.gte=function(t){return 0<=this.cmp(t)},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 v={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 m(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function 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 x(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)}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){for(var e,r=t;this.split(r,this.tmp),(e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength())>this.n;);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):0<n?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(m,y),m.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,0===(t.words[n-10]=i)&&10<t.length?t.length-=10:t.length-=9},m.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<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(g,y),i(w,y),i(_,y),_.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 m;else if("p224"===t)e=new g;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=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 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return 0<=r.cmp(this.m)&&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),f=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,u).cmp(f);)c.redIAdd(f);for(var h=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(a);){for(var b=l,v=0;0!==b.cmp(a);v++)b=b.redSqr();n(v<p);var y=this.pow(h,new o(1).iushln(p-v-1));d=d.redMul(y),h=y.redSqr(),l=l.redMul(h),p=v}return d},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,f=e.bitLength()%26;for(0===f&&(f=26),n=e.length-1;0<=n;n--){for(var u=e.words[n],c=f-1;0<=c;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!=h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),s=a=0)):a=0}f=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 x(t)},i(x,A),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 0<=i.cmp(this.m)?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 0<=i.cmp(this.m)?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)}}(t,this)}).call(this,r(11)(t))},function(t,e,r){var n=r(3),i=r(9).EventEmitter,o=r(5);function s(t){i.call(this);var e=this;e._remote=t,e._books={},e._token=t._token||"swt",e.on("newListener",function(t,r){if("removeListener"!==t){if(!o.parseKey(t,e._token))return e.pair=new Error("invalid key"),e;e._books[t]=r}}),e.on("removeListener",function(t){if(!o.parseKey(t,e._token))return e.pair=new Error("invalid key"),e;delete e._books[t]}),e._remote.on("transactions",e.__updateBooks.bind(e))}s.prototype.__updateBooks=function(t){if(t.meta){var e=o.affectedBooks(t,this._token),r={tx:t.transaction,meta:t.meta,engine_result:t.engine_result,engine_result_code:t.engine_result_code,engine_result_message:t.engine_result_message,ledger_hash:t.ledger_hash,ledger_index:t.ledger_index,validated:t.validated},n=o.processTx(r,t.transaction.Account,this._token);for(var i in e){var s=this._books[e[i]];s&&s(n)}}},n.inherits(s,i),t.exports=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6);e.isValidAddress=function(t,e){return void 0===e&&(e="swt"),n.Wallet.isValidAddress(t,e)},e.isValidSecret=function(t,e){return void 0===e&&(e="swt"),n.Wallet.isValidSecret(t,e)},e.getAddress=function(t,e){void 0===e&&(e="swt");try{return n.Wallet.fromSecret(t,e).address}catch(t){return null}},e.createWallet=function(t){return void 0===t&&(t="swt"),n.Wallet.generate(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(62);e.BizainFingate=n.default,e.default=n.default},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;0<=a;a--)(i=t[a])&&(s=(o<3?i(s):3<o?i(e,r,s):i(e,r))||s);return 3<o&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}},o=this&&this.__awaiter||function(t,e,r,n){return new(r=r||Promise)(function(i,o){function s(t){try{f(n.next(t))}catch(t){o(t)}}function a(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,a)}f((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=0<(i=s.trys).length&&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])}}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(28),f=r(63),u=r(60),c=r(171),h=(Object.defineProperty(d.prototype,"localSign",{set:function(t){this._localSign=t},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"fee",{set:function(t){this._fee=t},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"currency",{set:function(t){this._currency=t},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"remote",{get:function(){return this._remote},enumerable:!0,configurable:!0}),d.isValidAddress=function(t){return u.isValidAddress(t,d._token)},d.isValidSecret=function(t){return u.isValidSecret(t,d._token)},d.getAddress=function(t){return u.getAddress(t,d._token)},d.prototype.init=function(){var t={local_sign:this._localSign,server:this._server,token:d._token};return this._remote=new f.Remote(t),this},d.prototype.connect=function(){return o(this,void 0,void 0,function(){var t=this;return s(this,function(e){return[2,new Promise(function(e,r){t._remote.connect(function(t){return t?r(t):e()})})]})})},d.prototype.disconnect=function(){this._remote.disconnect()},d.prototype.balanceOf=function(t){var e=this;return new Promise(function(r,n){e._remote.requestAccountRelations({account:t,type:"trust"}).submit(function(t,i){if(t)return n(t);try{var o=i.lines.find(function(t){return t.currency.toUpperCase()===e._currency.toUpperCase()});return r(o.balance)}catch(t){return r("0")}})})},d.prototype.transfer=function(t,e,r,n){return o(this,void 0,void 0,function(){var i=this;return s(this,function(o){return[2,new Promise(function(o,s){var f={account:d.getAddress(t),amount:{currency:i._currency.toUpperCase(),issuer:"",value:new a.default(r).toNumber()},to:e};f.amount.currency!==d._token&&(f.amount.issuer=i._issuer);var u=i._remote.buildPaymentTx(f);u.setTransferRate(i._fee),u.setSecret(t),u.addMemo(JSON.stringify(n)),u.submit(function(t,e){return t?s(t):"tesSUCCESS"===e.engine_result?o(e.tx_json.hash):s(new Error(e.engine_result_message))})})]})})},d._token="bwt",n([c.validate,i(0,c.isValidBizainSecret),i(1,c.isValidBizainAddress),i(2,c.isValidAmount),i(3,c.isValidMemo)],d.prototype,"transfer",null),d);function d(t){this._remote=null,this._localSign=!0,this._fee=10,this._currency="BIZ",this._issuer="bf42S78serP2BeSx7HGtwQR2QASYaHVqyb",this._server=t}e.default=h},function(t,e,r){"use strict";var n=r(64),i=r(30),o=r(56),s=r(55),a=r(59),f=r(5),u=r(57);e.Remote=n,e.Request=i,e.Transaction=o,e.Account=s,e.OrderBook=a,e.utils=f,e.LocalSign=u},function(t,e,r){"use strict";var n=r(9).EventEmitter,i=r(3),o=r(66),s=r(70),a=r(74),f=r(30),u=r(55),c=r(56),h=r(59),d=r(5),l=r(170),p=r(27);function b(t){n.call(this);var e=this,r=t||{};if(e._local_sign=!!r.local_sign,"string"!=typeof r.server)return e.type=new TypeError("server config not supplied"),e;e._url=r.server,e._server=new a(e,e._url),e._status={ledger_index:0},e._requests={},e._token=t.token||"swt",e._cache=o({max:100,maxAge:3e5}),e._paths=o({max:100,maxAge:3e5}),e.on("newListener",function(t){e._server.isConnected()&&"removeListener"!==t&&("transactions"===t&&e.subscribe("transactions").submit(),"ledger_closed"===t&&e.subscribe("ledger").submit())}),e.on("removeListener",function(t){e._server.isConnected()&&("transactions"===t&&e.unsubscribe("transactions").submit(),"ledger_closed"===t&&e.unsubscribe("ledger").submit())})}function v(t,e){if(t.value&&1e11<Number(t.value))return new Error("invalid amount: amount's maximum value is 100000000000");var r=d.getCurrency(e);return t.currency===r?String(parseInt(new p(t.value).mul(1e6))):t}i.inherits(b,n),b.prototype.connect=function(t){if(!this._server)return t("server not ready");this._server.connect(t)},b.prototype.disconnect=function(){this._server&&this._server.disconnect()},b.prototype.isConnected=function(){return this._server.isConnected()},b.prototype._handleMessage=function(t){var e;try{e=JSON.parse(t.data)}catch(t){e=""}if("object"==typeof e)switch(e.type){case"ledgerClosed":this._handleLedgerClosed(e);break;case"serverStatus":this._handleServerStatus(e);break;case"response":this._handleResponse(e);break;case"transaction":this._handleTransaction(e);break;case"path_find":this._handlePathFind(e)}},b.prototype._handleLedgerClosed=function(t){t.ledger_index>this._status.ledger_index&&(this._status.ledger_index=t.ledger_index,this._status.ledger_time=t.ledger_time,this._status.reserve_base=t.reserve_base,this._status.reserve_inc=t.reserve_inc,this._status.fee_base=t.fee_base,this._status.fee_ref=t.fee_ref,this.emit("ledger_closed",t))},b.prototype._handleServerStatus=function(t){this._updateServerStatus(t),this.emit("server_status",t)},b.prototype._updateServerStatus=function(t){this._status.load_base=t.load_base,this._status.load_factor=t.load_factor,t.pubkey_node&&(this._status.pubkey_node=t.pubkey_node),this._status.server_status=t.server_status;var e=~a.onlineStates.indexOf(t.server_status);this._server._setState(e?"online":"offline")},b.prototype._handleResponse=function(t){var e=t.id;if(!("number"!=typeof e||e<0||e>this._requests.length)){var r=this._requests[e];if(delete this._requests[e],delete t.id,t.result&&"success"===t.status&&t.result.server_status&&this._updateServerStatus(t.result),"success"===t.status){var n=r.filter(t.result);r&&r.callback(null,n)}else"error"===t.status&&r&&r.callback(t.error_exception||t.error_message)}},b.prototype._handleTransaction=function(t){var e=t.transaction.hash;this._cache.get(e)||(this._cache.set(e,1),this.emit("transactions",t))},b.prototype._handlePathFind=function(t){this.emit("path_find",t)},b.prototype._submit=function(t,e,r,n){n&&"function"==typeof n||(n=function(){});var i=this._server.sendMessage(t,e);this._requests[i]={command:t,data:e,filter:r,callback:n}},b.prototype.requestServerInfo=function(){return new f(this,"server_info",function(t){return{complete_ledgers:t.info.complete_ledgers,ledger:t.info.validated_ledger.hash,public_key:t.info.pubkey_node,state:t.info.server_state,peers:t.info.peers,version:"skywelld-"+t.info.build_version}})},b.prototype.requestPeers=function(){return new f(this,"peers",function(t){return t})},b.prototype.requestLedgerClosed=function(){return new f(this,"ledger_closed",function(t){return{ledger_hash:t.ledger_hash,ledger_index:t.ledger_index}})},b.prototype.requestLedger=function(t){var e=!0,r=new f(this,"ledger",function(t){var r=t.ledger||t.closed.ledger;return e?{accepted:r.accepted,ledger_hash:r.hash,ledger_index:r.ledger_index,parent_hash:r.parent_hash,close_time:r.close_time_human,total_coins:r.total_coins}:r});return null===t||"object"!=typeof t?r.message.type=new Error("invalid options type"):(Number(t.ledger_index)&&(r.message.ledger_index=Number(t.ledger_index)),d.isValidHash(t.ledger_hash)&&(r.message.ledger_hash=t.ledger_hash),"full"in t&&"boolean"==typeof t.full&&(r.message.full=t.full,e=!1),"expand"in t&&"boolean"==typeof t.expand&&(r.message.expand=t.expand,e=!1),"transactions"in t&&"boolean"==typeof t.transactions&&(r.message.transactions=t.transactions,e=!1),"accounts"in t&&"boolean"==typeof t.accounts&&(r.message.accounts=t.accounts,e=!1)),r},b.prototype.requestTx=function(t){var e=new f(this,"tx");if(null===t||"object"!=typeof t)return e.message.type=new Error("invalid options type"),e;var r=t.hash;return d.isValidHash(r)?e.message.transaction=r:e.message.hash=new Error("invalid tx hash"),e},b.prototype.__requestAccount=function(t,e,r){r._command=t;var n=e.account,i=e.ledger,o=e.peer,s=e.limit,a=e.marker;if(r.message.relation_type=function(t){switch(e.type){case"trust":return 0;case"authorize":return 1;case"freeze":return 3}}(),n){if(!d.isValidAddress(n,this._token))return r.message.account=new Error("invalid account"),r;r.message.account=n}return r.selectLedger(i),d.isValidAddress(o,this._token)&&(r.message.peer=o),Number(s)&&((s=Number(s))<0&&(s=0),1e9<s&&(s=1e9),r.message.limit=s),a&&(r.message.marker=a),r},b.prototype.requestAccountInfo=function(t){var e=new f(this);return null===t||"object"!=typeof t?(e.message.type=new Error("invalid options type"),e):this.__requestAccount("account_info",t,e)},b.prototype.requestAccountTums=function(t){var e=new f(this);return null===t||"object"!=typeof t?(e.message.type=new Error("invalid options type"),e):this.__requestAccount("account_currencies",t,e)},b.prototype.requestAccountRelations=function(t){var e=new f(this);if(null===t||"object"!=typeof t)return e.message.type=new Error("invalid options type"),e;if(!~c.RelationTypes.indexOf(t.type))return e.message.relation_type=new Error("invalid realtion type"),e;switch(t.type){case"trust":return this.__requestAccount("account_lines",t,e);case"authorize":case"freeze":return this.__requestAccount("account_relation",t,e)}return e.message.msg=new Error("relation should not go here"),e},b.prototype.requestAccountOffers=function(t){var e=new f(this);return null===t||"object"!=typeof t?(e.message.type=new Error("invalid options type"),e):this.__requestAccount("account_offers",t,e)},b.prototype.requestAccountTx=function(t){var e=this,r=new f(this,"account_tx",function(r){for(var n=[],i=0;i<r.transactions.length;++i){var o=d.processTx(r.transactions[i],t.account,e._token);n.push(o)}return r.transactions=n,r});return null===t||"object"!=typeof t?r.message.type=new Error("invalid options type"):d.isValidAddress(t.account,this._token)?(r.message.account=t.account,t.ledger_min&&Number(t.ledger_min)?r.message.ledger_index_min=Number(t.ledger_min):r.message.ledger_index_min=0,t.ledger_max&&Number(t.ledger_max)?r.message.ledger_index_max=Number(t.ledger_max):r.message.ledger_index_max=-1,t.limit&&Number(t.limit)&&(r.message.limit=Number(t.limit)),t.offset&&Number(t.offset)&&(r.message.offset=Number(t.offset)),"object"!=typeof t.marker||Number.isNaN(Number(t.marker.ledger))||Number.isNaN(Number(t.marker.seq))||(r.message.marker=t.marker),t.forward&&"boolean"==typeof t.forward&&(r.message.forward=t.forward)):r.message.account=new Error("account parameter is invalid"),r},b.prototype.requestOrderBook=function(t){var e=new f(this,"book_offers");if(null===t||"object"!=typeof t)return e.message.type=new Error("invalid options type"),e;var r=t.taker_gets||t.pays;if(!d.isValidAmount0(r,this._token))return e.message.taker_gets=new Error("invalid taker gets amount"),e;var n=t.taker_pays||t.gets;return d.isValidAmount0(n,this._token)?(l(t.limit)&&(t.limit=parseInt(t.limit)),e.message.taker_gets=r,e.message.taker_pays=n,e.message.taker=t.taker?t.taker:d.getAccountOne(this._token),e.message.limit=t.limit):e.message.taker_pays=new Error("invalid taker pays amount"),e},b.prototype.requestBrokerage=function(t){var e=new f(this,"Fee_Info");if(null===t||"object"!=typeof t)return e.message.type=new Error("invalid options type"),e;var r=t.issuer,n=t.app,i=t.currency;return d.isValidAddress(r,this._token)?/^[0-9]*[1-9][0-9]*$/.test(n)?d.isValidCurrency(i)?(e.message.issuer=r,e.message.AppType=n,e.message.currency=i,e.message.ledger_index="validated"):e.message.currency=new Error("invalid currency."):e.message.app=new Error("invalid app, it is a positive integer."):e.message.account=new Error("issuer parameter is invalid"),e},b.prototype.requestPathFind=function(t){var e=this,r=new f(e,"path_find",function(t){var r=new f(e,"path_find");r.message.subcommand="close",r.submit();for(var n=[],i=0;i<t.alternatives.length;++i){var o=t.alternatives[i],a=s(JSON.stringify(o));e._paths.set(a,{path:JSON.stringify(o.paths_computed),choice:o.source_amount}),n.push({choice:d.parseAmount(o.source_amount,e._token),key:a})}return n});if(null===t||"object"!=typeof t)return r.message.type=new Error("invalid options type"),r;var n=t.account,i=t.destination,o=t.amount;return d.isValidAddress(n,e._token)?d.isValidAddress(i,e._token)?d.isValidAmount(o,e._token)?(r.message.subcommand="create",r.message.source_account=n,r.message.destination_account=i,r.message.destination_amount=v(o,this._token)):r.message.destination_amount=new Error("invalid amount"):r.message.destination_account=new Error("invalid destination account"):r.message.source_account=new Error("invalid source account"),r},b.prototype.buildPaymentTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;var r=t.source||t.from||t.account,n=t.destination||t.to,i=t.amount;return d.isValidAddress(r,this._token)?d.isValidAddress(n,this._token)?d.isValidAmount(i,this._token)?(e.tx_json.TransactionType="Payment",e.tx_json.Account=r,e.tx_json.Amount=v(i,this._token),e.tx_json.Destination=n):e.tx_json.amount=new Error("invalid amount"):e.tx_json.dst=new Error("invalid destination address"):e.tx_json.src=new Error("invalid source address"),e},b.prototype.deployContractTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;var r=t.account,n=t.amount,i=t.payload,o=t.params;if(!d.isValidAddress(r,this._token))return e.tx_json.account=new Error("invalid address"),e;if(isNaN(Number(n)))return e.tx_json.amount=new Error("invalid amount"),e;if("string"!=typeof i)return e.tx_json.payload=new Error("invalid payload: type error."),e;if(o&&!Array.isArray(o))return e.tx_json.params=new Error("invalid options type"),e;for(var s in e.tx_json.TransactionType="ConfigContract",e.tx_json.Account=r,e.tx_json.Amount=1e6*Number(n),e.tx_json.Method=0,e.tx_json.Payload=i,e.tx_json.Args=[],o){var a={};a.Arg={Parameter:d.stringToHex(o[s])},e.tx_json.Args.push(a)}return e},b.prototype.callContractTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;var r=t.account,n=t.destination,i=t.params,o=t.foo;if(!d.isValidAddress(r,this._token))return e.tx_json.account=new Error("invalid address"),e;if(!d.isValidAddress(n,this._token))return e.tx_json.des=new Error("invalid destination"),e;if(i&&!Array.isArray(i))return e.tx_json.params=new Error("invalid options type"),e;if("string"!=typeof o)return e.tx_json.foo=new Error("foo must be string"),e;for(var s in e.tx_json.TransactionType="ConfigContract",e.tx_json.Account=r,e.tx_json.Method=1,e.tx_json.ContractMethod=d.stringToHex(o),e.tx_json.Destination=n,e.tx_json.Args=[],i){if("string"!=typeof i[s])return e.tx_json.params=new Error("params must be string"),e;var a={};a.Arg={Parameter:d.stringToHex(i[s])},e.tx_json.Args.push(a)}return e},b.prototype.buildSignTx=function(t){var e=new c(this);return null===t||"object"!=typeof t?e.tx_json.obj=new Error("invalid options type"):(e.tx_json.TransactionType="Signer",e.tx_json.blob=t.blob),e},b.prototype.buildBrokerageTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;var r=t.account,n=t.mol||t.molecule,i=t.den||t.denominator,o=t.app,s=t.amount;return d.isValidAddress(r,this._token)?/^\d+$/.test(n)?/^[0-9]*[1-9][0-9]*$/.test(i)&&/^[0-9]*[1-9][0-9]*$/.test(o)?i<n?e.tx_json.app=new Error("invalid mol/den, molecule can not exceed denominator."):d.isValidAmount(s,this._token)?(e.tx_json.TransactionType="Brokerage",e.tx_json.Account=r,e.tx_json.OfferFeeRateNum=n,e.tx_json.OfferFeeRateDen=i,e.tx_json.AppType=o,e.tx_json.Amount=v(s,this._token)):e.tx_json.amount=new Error("invalid amount"):e.tx_json.den=new Error("invalid den/app, it is a positive integer."):e.tx_json.mol=new Error("invalid mol, it is a positive integer or zero."):e.tx_json.src=new Error("invalid address"),e},b.prototype.__buildTrustSet=function(t,e){var r=t.source||t.from||t.account,n=t.limit,i=t.quality_out,o=t.quality_in;return d.isValidAddress(r,this._token)?d.isValidAmount(n,this._token)?(e.tx_json.TransactionType="TrustSet",e.tx_json.Account=r,e.tx_json.LimitAmount=n,o&&(e.tx_json.QualityIn=o),i&&(e.tx_json.QualityOut=i)):e.tx_json.limit=new Error("invalid amount"):e.tx_json.src=new Error("invalid source address"),e},b.prototype.__buildRelationSet=function(t,e){var r=t.source||t.from||t.account,n=t.target,i=t.limit;return d.isValidAddress(r,this._token)?d.isValidAddress(n,this._token)?d.isValidAmount(i,this._token)?(e.tx_json.TransactionType="unfreeze"===t.type?"RelationDel":"RelationSet",e.tx_json.Account=r,e.tx_json.Target=n,e.tx_json.RelationType="authorize"===t.type?1:3,e.tx_json.LimitAmount=i):e.tx_json.limit=new Error("invalid amount"):e.tx_json.des=new Error("invalid target address"):e.tx_json.src=new Error("invalid source address"),e},b.prototype.buildRelationTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;if(!~c.RelationTypes.indexOf(t.type))return e.tx_json.type=new Error("invalid relation type"),e;switch(t.type){case"trust":return this.__buildTrustSet(t,e);case"authorize":case"freeze":case"unfreeze":return this.__buildRelationSet(t,e)}},b.prototype.__buildAccountSet=function(t,e){var r=t.source||t.from||t.account,n=t.set_flag||t.set,i=t.clear_flag||t.clear;if(!d.isValidAddress(r,this._token))return e.tx_json.src=new Error("invalid source address"),e;e.tx_json.TransactionType="AccountSet",e.tx_json.Account=r;var o=c.set_clear_flags.AccountSet;function s(t){return"number"==typeof t?t:o[t]||o["asf"+t]}return(n=n&&s(n))&&(e.tx_json.SetFlag=n),(i=i&&s(i))&&(e.tx_json.ClearFlag=i),e},b.prototype.__buildDelegateKeySet=function(t,e){var r=t.source||t.account||t.from,n=t.delegate_key;return d.isValidAddress(r,this._token)?d.isValidAddress(n,this._token)?(e.tx_json.TransactionType="SetRegularKey",e.tx_json.Account=r,e.tx_json.RegularKey=n):e.tx_json.delegate_key=new Error("invalid regular key address"):e.tx_json.src=new Error("invalid source address"),e},b.prototype.__buildSignerSet=function(){return null},b.prototype.buildAccountSetTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;if(-1===c.AccountSetTypes.indexOf(t.type))return e.tx_json.type=new Error("invalid account set type"),e;switch(t.type){case"property":return this.__buildAccountSet(t,e);case"delegate":return this.__buildDelegateKeySet(t,e);case"signer":return this.__buildSignerSet(t,e)}},b.prototype.buildOfferCreateTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;var r=t.type,n=t.source||t.from||t.account,i=t.taker_gets||t.pays,o=t.taker_pays||t.gets,s=t.app;return d.isValidAddress(n,this._token)?"string"==typeof r&&~c.OfferTypes.indexOf(r)?"string"!=typeof i||Number(i)?"object"!=typeof i||d.isValidAmount(i,this._token)?"string"!=typeof o||Number(o)?"object"!=typeof o||d.isValidAmount(o,this._token)?s&&!/^[0-9]*[1-9][0-9]*$/.test(s)?e.tx_json.app=new Error("invalid app, it is a positive integer."):(e.tx_json.TransactionType="OfferCreate","Sell"===r&&e.setFlags(r),s&&(e.tx_json.AppType=s),e.tx_json.Account=n,e.tx_json.TakerPays=v(o,this._token),e.tx_json.TakerGets=v(i,this._token)):e.tx_json.taker_pays2=new Error("invalid to gets amount object"):e.tx_json.taker_pays2=new Error("invalid to gets amount"):e.tx_json.taker_gets2=new Error("invalid to pays amount object"):e.tx_json.taker_gets2=new Error("invalid to pays amount"):e.tx_json.offer_type=new Error("invalid offer type"):e.tx_json.src=new Error("invalid source address"),e},b.prototype.buildOfferCancelTx=function(t){var e=new c(this);if(null===t||"object"!=typeof t)return e.tx_json.obj=new Error("invalid options type"),e;var r=t.source||t.from||t.account,n=t.sequence;return d.isValidAddress(r,this._token)?Number(n)?(e.tx_json.TransactionType="OfferCancel",e.tx_json.Account=r,e.tx_json.OfferSequence=Number(n)):e.tx_json.sequence=new Error("invalid sequence param"):e.tx_json.src=new Error("invalid source address"),e},b.prototype.subscribe=function(t){var e=new f(this,"subscribe");return t&&(e.message.streams=Array.isArray(t)?t:[t]),e},b.prototype.unsubscribe=function(t){var e=new f(this,"unsubscribe");return t&&(e.message.streams=Array.isArray(t)?t:[t]),e},b.prototype.createAccountStub=function(){return new u(this)},b.prototype.createOrderBookStub=function(){return new h(this)},t.exports=b},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e,r){"use strict";(function(e){t.exports=y;var n,i=r(67),o=r(3),s=r(69),a=(n="function"==typeof Symbol&&"1"!==e.env._nodeLRUCacheForceNoSymbol?function(t){return Symbol(t)}:function(t){return"_"+t})("max"),f=n("length"),u=n("lengthCalculator"),c=n("allowStale"),h=n("maxAge"),d=n("dispose"),l=n("noDisposeOnSet"),p=n("lruList"),b=n("cache");function v(){return 1}function y(t){if(!(this instanceof y))return new y(t);"number"==typeof t&&(t={max:t}),t=t||{};var e=this[a]=t.max;(!e||"number"!=typeof e||e<=0)&&(this[a]=1/0);var r=t.length||v;"function"!=typeof r&&(r=v),this[u]=r,this[c]=t.stale||!1,this[h]=t.maxAge||0,this[d]=t.dispose,this[l]=t.noDisposeOnSet||!1,this.reset()}function m(t,e,r,n){var i=r.value;w(t,i)&&(A(t,r),t[c]||(i=void 0)),i&&e.call(n,i.value,i.key,t)}function g(t,e,r){var n=t[b].get(e);if(n){var i=n.value;w(t,i)?(A(t,n),t[c]||(i=void 0)):r&&t[p].unshiftNode(n),i=i&&i.value}return i}function w(t,e){if(!e||!e.maxAge&&!t[h])return!1;var r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[h]&&r>t[h]}function _(t){if(t[f]>t[a])for(var e=t[p].tail;t[f]>t[a]&&null!==e;){var r=e.prev;A(t,e),e=r}}function A(t,e){if(e){var r=e.value;t[d]&&t[d](r.key,r.value),t[f]-=r.length,t[b].delete(r.key),t[p].removeNode(e)}}function x(t,e,r,n,i){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=i||0}Object.defineProperty(y.prototype,"max",{set:function(t){(!t||"number"!=typeof t||t<=0)&&(t=1/0),this[a]=t,_(this)},get:function(){return this[a]},enumerable:!0}),Object.defineProperty(y.prototype,"allowStale",{set:function(t){this[c]=!!t},get:function(){return this[c]},enumerable:!0}),Object.defineProperty(y.prototype,"maxAge",{set:function(t){(!t||"number"!=typeof t||t<0)&&(t=0),this[h]=t,_(this)},get:function(){return this[h]},enumerable:!0}),Object.defineProperty(y.prototype,"lengthCalculator",{set:function(t){"function"!=typeof t&&(t=v),t!==this[u]&&(this[u]=t,this[f]=0,this[p].forEach(function(t){t.length=this[u](t.value,t.key),this[f]+=t.length},this)),_(this)},get:function(){return this[u]},enumerable:!0}),Object.defineProperty(y.prototype,"length",{get:function(){return this[f]},enumerable:!0}),Object.defineProperty(y.prototype,"itemCount",{get:function(){return this[p].length},enumerable:!0}),y.prototype.rforEach=function(t,e){e=e||this;for(var r=this[p].tail;null!==r;){var n=r.prev;m(this,t,r,e),r=n}},y.prototype.forEach=function(t,e){e=e||this;for(var r=this[p].head;null!==r;){var n=r.next;m(this,t,r,e),r=n}},y.prototype.keys=function(){return this[p].toArray().map(function(t){return t.key},this)},y.prototype.values=function(){return this[p].toArray().map(function(t){return t.value},this)},y.prototype.reset=function(){this[d]&&this[p]&&this[p].length&&this[p].forEach(function(t){this[d](t.key,t.value)},this),this[b]=new i,this[p]=new s,this[f]=0},y.prototype.dump=function(){return this[p].map(function(t){if(!w(this,t))return{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}},this).toArray().filter(function(t){return t})},y.prototype.dumpLru=function(){return this[p]},y.prototype.inspect=function(t,e){var r="LRUCache {",n=!1;this[c]&&(r+="\n  allowStale: true",n=!0);var i=this[a];i&&i!==1/0&&(n&&(r+=","),r+="\n  max: "+o.inspect(i,e),n=!0);var s=this[h];s&&(n&&(r+=","),r+="\n  maxAge: "+o.inspect(s,e),n=!0);var d=this[u];d&&d!==v&&(n&&(r+=","),r+="\n  length: "+o.inspect(this[f],e),n=!0);var l=!1;return this[p].forEach(function(t){l?r+=",\n  ":(n&&(r+=",\n"),l=!0,r+="\n  ");var i=o.inspect(t.key).split("\n").join("\n  "),a={value:t.value};t.maxAge!==s&&(a.maxAge=t.maxAge),d!==v&&(a.length=t.length),w(this,t)&&(a.stale=!0),a=o.inspect(a,e).split("\n").join("\n  "),r+=i+" => "+a}),(l||n)&&(r+="\n"),r+="}"},y.prototype.set=function(t,e,r){var n=(r=r||this[h])?Date.now():0,i=this[u](e,t);if(this[b].has(t)){if(i>this[a])return A(this,this[b].get(t)),!1;var o=this[b].get(t).value;return this[d]&&(this[l]||this[d](t,o.value)),o.now=n,o.maxAge=r,o.value=e,this[f]+=i-o.length,o.length=i,this.get(t),_(this),!0}var s=new x(t,e,i,n,r);return s.length>this[a]?(this[d]&&this[d](t,e),!1):(this[f]+=s.length,this[p].unshift(s),this[b].set(t,this[p].head),_(this),!0)},y.prototype.has=function(t){return!!this[b].has(t)&&!w(this,this[b].get(t).value)},y.prototype.get=function(t){return g(this,t,!0)},y.prototype.peek=function(t){return g(this,t,!1)},y.prototype.pop=function(){var t=this[p].tail;return t?(A(this,t),t.value):null},y.prototype.del=function(t){A(this,this[b].get(t))},y.prototype.load=function(t){this.reset();for(var e=Date.now(),r=t.length-1;0<=r;r--){var n=t[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var o=i-e;0<o&&this.set(n.k,n.v,o)}}},y.prototype.prune=function(){var t=this;this[b].forEach(function(e,r){g(t,r,!1)})}}).call(this,r(21))},function(t,e,r){(function(e){"pseudomap"===e.env.npm_package_name&&"test"===e.env.npm_lifecycle_script&&(e.env.TEST_PSEUDOMAP="true"),"function"!=typeof Map||e.env.TEST_PSEUDOMAP?t.exports=r(68):t.exports=Map}).call(this,r(21))},function(t,e){var r=Object.prototype.hasOwnProperty;function n(t){if(!(this instanceof n))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),t)if(t instanceof n||"function"==typeof Map&&t instanceof Map)t.forEach(function(t,e){this.set(e,t)},this);else{if(!Array.isArray(t))throw new TypeError("invalid argument");t.forEach(function(t){this.set(t[0],t[1])},this)}}function i(t,e){return t===e||t!=t&&e!=e}function o(t,e,r){this.key=t,this.value=e,this._index=r}function s(t,e){for(var n=0,o="_"+e,s=o;r.call(t,s);s=o+n++)if(i(t[s].key,e))return t[s]}(t.exports=n).prototype.forEach=function(t,e){e=e||this,Object.keys(this._data).forEach(function(r){"size"!==r&&t.call(e,this._data[r].value,this._data[r].key)},this)},n.prototype.has=function(t){return!!s(this._data,t)},n.prototype.get=function(t){var e=s(this._data,t);return e&&e.value},n.prototype.set=function(t,e){!function(t,e,n){for(var s=0,a="_"+e,f=a;r.call(t,f);f=a+s++)if(i(t[f].key,e))return t[f].value=n;t.size++,t[f]=new o(e,n,f)}(this._data,t,e)},n.prototype.delete=function(t){var e=s(this._data,t);e&&(delete this._data[e._index],this._data.size--)},n.prototype.clear=function(){var t=Object.create(null);t.size=0,Object.defineProperty(this,"_data",{value:t,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(n.prototype,"size",{get:function(){return this._data.size},set:function(t){},enumerable:!0,configurable:!0}),n.prototype.values=n.prototype.keys=n.prototype.entries=function(){throw new Error("iterators are not implemented in this version")}},function(t,e){function r(t){var e=this;if(e instanceof r||(e=new r),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach(function(t){e.push(t)});else if(0<arguments.length)for(var n=0,i=arguments.length;n<i;n++)e.push(arguments[n]);return e}function n(t,e){t.tail=new o(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function i(t,e){t.head=new o(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function o(t,e,r,n){if(!(this instanceof o))return new o(t,e,r,n);this.list=n,this.value=t,e?(e.next=this).prev=e:this.prev=null,r?(r.prev=this).next=r:this.next=null}(t.exports=r).Node=o,(r.create=r).prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null},r.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,(t.next=e)&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},r.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,(t.prev=e)&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},r.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)n(this,arguments[t]);return this.length},r.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)i(this,arguments[t]);return this.length},r.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},r.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},r.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;null!==r;n++)t.call(e,r.value,n,this),r=r.next},r.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;null!==r;n--)t.call(e,r.value,n,this),r=r.prev},r.prototype.get=function(t){for(var e=0,r=this.head;null!==r&&e<t;e++)r=r.next;if(e===t&&null!==r)return r.value},r.prototype.getReverse=function(t){for(var e=0,r=this.tail;null!==r&&e<t;e++)r=r.prev;if(e===t&&null!==r)return r.value},r.prototype.map=function(t,e){e=e||this;for(var n=new r,i=this.head;null!==i;)n.push(t.call(e,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(t,e){e=e||this;for(var n=new r,i=this.tail;null!==i;)n.push(t.call(e,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(t,e){var r,n=this.head;if(1<arguments.length)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=t(r,n.value,i),n=n.next;return r},r.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(1<arguments.length)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=t(r,n.value,i),n=n.prev;return r},r.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},r.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},r.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new r;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<e;i++,o=o.next)n.push(o.value);return n},r.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var n=new r;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,o=this.tail;null!==o&&e<i;i--)o=o.prev;for(;null!==o&&t<i;i--,o=o.prev)n.push(o.value);return n},r.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this}},function(t,e,r){(function(e){function n(t,r){var n=i.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=i.bytesToWords(t),n=8*t.length,s=[],a=1732584193,f=-271733879,u=-1732584194,c=271733878,h=-1009589776;r[n>>5]|=128<<24-n%32,r[15+(64+n>>>9<<4)]=n;for(var d=0;d<r.length;d+=16){for(var l=a,p=f,b=u,v=c,y=h,m=0;m<80;m++){if(m<16)s[m]=r[d+m];else{var g=s[m-3]^s[m-8]^s[m-14]^s[m-16];s[m]=g<<1|g>>>31}var w=(a<<5|a>>>27)+h+(s[m]>>>0)+(m<20?1518500249+(f&u|~f&c):m<40?1859775393+(f^u^c):m<60?(f&u|f&c|u&c)-1894007588:(f^u^c)-899497514);h=c,c=u,u=f<<30|f>>>2,f=a,a=w}a+=l,f+=p,u+=b,c+=v,h+=y}return[a,f,u,c,h]}(t));return r&&r.asBytes?n:r&&r.asString?s.bytesToString(n):i.bytesToHex(n)}var i,o,s;i=r(73),o=r(29).utf8,s=r(29).bin,n._blocksize=16,n._digestsize=20,t.exports=n}).call(this,r(22).Buffer)},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,f=(1<<a)-1,u=f>>1,c=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,o=l&(1<<-c)-1,l>>=-c,c+=a;0<c;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;0<c;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===f)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=u}return(l?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,f,u=8*o-i-1,c=(1<<u)-1,h=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=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=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),2<=(e+=1<=s+h?d/f:d*Math.pow(2,1-h))*f&&(s++,f/=2),c<=s+h?(a=0,s=c):1<=s+h?(a=(e*f-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));8<=i;t[r+l]=255&a,l+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;0<u;t[r+l]=255&s,l+=p,s/=256,u-=8);t[r+l-p]|=128*b}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];0<t;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var i=t[n]<<16|t[n+1]<<8|t[n+2],o=0;o<4;o++)8*n+6*o<=8*t.length?e.push(r.charAt(i>>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,i=0;n<t.length;i=++n%4)0!=i&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|r.indexOf(t.charAt(n))>>>6-2*i);return e}},t.exports=n},function(t,e,r){"use strict";var n=r(3),i=r(75),o=r(9).EventEmitter,s=r(81),a=r(14);function f(t,e){if(o.call(this),this.setMaxListeners(0),"string"==typeof e){var r=i.parse(e),n="wss:"===r.protocol;e={host:r.hostname,port:r.port?Number(r.port):n?443:80,secure:n,path:r.path}}return null===e||"object"!=typeof e?(this.opts=new TypeError("server options not supplied"),this):f.domainRE.test(e.host)?Number.isNaN(e.port)||!Number.isFinite(e.port)?(this.port=new TypeError("server port not a number"),this):e.port<1||65535<e.port?(this.port=new TypeError("server port out of range"),this):("boolean"!=typeof e.secure&&(e.secure=!1),this._opts=e,this._url=(this._opts.secure?"wss://":"ws://")+this._opts.host+":"+this._opts.port+(this._opts.path?this._opts.path:""),this._remote=t,this._ws=null,this._connected=!1,this._opened=!1,this._state="offline",this._id=0,void(this._timer=0)):(this.opts_host=new TypeError("server host incorrect"),this)}n.inherits(f,o),f.domainRE=/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|[-_]){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|[-_]){0,61}[0-9A-Za-z])?)*\.?$/,f.onlineStates=["syncing","tracking","proposing","validating","full","connected"],f.prototype.connect=function(t){var e=this;if(!e._connected){e._ws&&e._ws.close();try{e._ws=new s(e._url)}catch(e){return t(e)}e._ws.onopen=function(){e._opened=!0,e._remote.subscribe(["ledger","server","transactions"]).submit(t)},e._ws.onclose=function(){e._handleClose()},e._ws.onerror=function(e){t(e)},e._ws.onmessage=function(t){e._remote._handleMessage(t)}}},f.prototype.disconnect=function(){this._ws.close(),this._ws=null,this._setState("offline")},f.prototype.isConnected=function(){return this._connected},f.prototype._handleClose=function(){var t=this;"offline"!==t._state&&(t._setState("offline"),0===t._timer&&(t._remote.emit("disconnect"),t._timer=setInterval(function(){t.connect(function(e){e||(clearInterval(t._timer),t._timer=0,t._remote.emit("reconnect"))})},3e3)))},f.prototype._setState=function(t){t!==this._state&&(this._state=t,this._connected="online"===t,this._connected||(this._opened=!1))},f.prototype.sendMessage=function(t,e){if(this._opened){var r=this._id++,n=a({id:r,command:t},e);return this._ws.send(JSON.stringify(n)),r}},t.exports=f},function(t,e,r){"use strict";var n=r(76),i=r(77);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=g,e.resolve=function(t,e){return g(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?g(t,!1,!0).resolveObject(e):e},e.format=function(t){return i.isString(t)&&(t=g(t)),t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),d=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(78);function g(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(a);u[0]=u[0].replace(/\\/g,"/");var g=t=u.join(a);if(g=g.trim(),!r&&1===t.split("#").length){var w=f.exec(g);if(w)return this.path=g,this.href=g,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var _=s.exec(g);if(_){var A=(_=_[0]).toLowerCase();this.protocol=A,g=g.substr(_.length)}if(r||_||g.match(/^\/\/[^@\/]+@[^@\/]+/)){var x="//"===g.substr(0,2);!x||_&&v[_]||(g=g.substr(2),this.slashes=!0)}if(!v[_]&&(x||_&&!y[_])){for(var S,M,T=-1,E=0;E<d.length;E++)-1!==(j=g.indexOf(d[E]))&&(-1===T||j<T)&&(T=j);for(-1!==(M=-1===T?g.lastIndexOf("@"):g.lastIndexOf("@",T))&&(S=g.slice(0,M),g=g.slice(M+1),this.auth=decodeURIComponent(S)),T=-1,E=0;E<h.length;E++){var j;-1!==(j=g.indexOf(h[E]))&&(-1===T||j<T)&&(T=j)}-1===T&&(T=g.length),this.host=g.slice(0,T),g=g.slice(T),this.parseHost(),this.hostname=this.hostname||"";var k="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!k)for(var O=this.hostname.split(/\./),I=(E=0,O.length);E<I;E++){var R=O[E];if(R&&!R.match(l)){for(var N="",P=0,C=R.length;P<C;P++)127<R.charCodeAt(P)?N+="x":N+=R[P];if(!N.match(l)){var L=O.slice(0,E),B=O.slice(E+1),D=R.match(p);D&&(L.push(D[1]),B.unshift(D[2])),B.length&&(g="/"+B.join(".")+g),this.hostname=L.join(".");break}}}255<this.hostname.length?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=n.toASCII(this.hostname));var q=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+q,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!b[A])for(E=0,I=c.length;E<I;E++){var F=c[E];if(-1!==g.indexOf(F)){var U=encodeURIComponent(F);U===F&&(U=escape(F)),g=g.split(F).join(U)}}var V=g.indexOf("#");-1!==V&&(this.hash=g.substr(V),g=g.slice(0,V));var H=g.indexOf("?");if(-1!==H?(this.search=g.substr(H),this.query=g.substr(H+1),e&&(this.query=m.parse(this.query)),g=g.slice(0,H)):e&&(this.search="",this.query={}),g&&(this.pathname=g),y[A]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){q=this.pathname||"";var G=this.search||"";this.path=q+G}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=m.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||y[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o=o||"",n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+o+(r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(g(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),s=0;s<n.length;s++){var a=n[s];r[a]=this[a]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var f=Object.keys(t),u=0;u<f.length;u++){var c=f[u];"protocol"!==c&&(r[c]=t[c])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!y[t.protocol]){for(var h=Object.keys(t),d=0;d<h.length;d++){var l=h[d];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var b=r.pathname||"",m=r.search||"";r.path=b+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),_=w||g||r.host&&t.pathname,A=_,x=r.pathname&&r.pathname.split("/")||[],S=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(S&&(r.hostname="",r.port=null,r.host&&(""===x[0]?x[0]=r.host:x.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),_=_&&(""===p[0]||""===x[0])),w)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,x=p;else if(p.length)(x=x||[]).pop(),x=x.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search))return S&&(r.hostname=r.host=x.shift(),(k=!!(r.host&&0<r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=k.shift(),r.host=r.hostname=k.shift())),r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=x.slice(-1)[0],T=(r.host||t.host||1<x.length)&&("."===M||".."===M)||""===M,E=0,j=x.length;0<=j;j--)"."===(M=x[j])?x.splice(j,1):".."===M?(x.splice(j,1),E++):E&&(x.splice(j,1),E--);if(!_&&!A)for(;E--;)x.unshift("..");!_||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),T&&"/"!==x.join("/").substr(-1)&&x.push("");var k,O=""===x[0]||x[0]&&"/"===x[0].charAt(0);return S&&(r.hostname=r.host=O?"":x.length?x.shift():"",(k=!!(r.host&&0<r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=k.shift(),r.host=r.hostname=k.shift())),(_=_||r.host&&x.length)&&!O&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof n&&n;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,f=36,u=1,c=26,h=38,d=700,l=72,p=128,b="-",v=/^xn--/,y=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=f-u,_=Math.floor,A=String.fromCharCode;function x(t){throw new RangeError(g[t])}function S(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function M(t,e){var r=t.split("@"),n="";return 1<r.length&&(n=r[0]+"@",t=r[1]),n+S((t=t.replace(m,".")).split("."),e).join(".")}function T(t){for(var e,r,n=[],i=0,o=t.length;i<o;)55296<=(e=t.charCodeAt(i++))&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function E(t){return S(t,function(t){var e="";return 65535<t&&(e+=A((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+A(t)}).join("")}function j(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function k(t,e,r){var n=0;for(t=r?_(t/d):t>>1,t+=_(t/e);w*c>>1<t;n+=f)t=_(t/w);return _(n+(w+1)*t/(t+h))}function O(t){var e,r,n,i,o,s,h,d,v,y,m,g=[],w=t.length,A=0,S=p,M=l;for((r=t.lastIndexOf(b))<0&&(r=0),n=0;n<r;++n)128<=t.charCodeAt(n)&&x("not-basic"),g.push(t.charCodeAt(n));for(i=0<r?r+1:0;i<w;){for(o=A,s=1,h=f;w<=i&&x("invalid-input"),m=t.charCodeAt(i++),(f<=(d=m-48<10?m-22:m-65<26?m-65:m-97<26?m-97:f)||d>_((a-A)/s))&&x("overflow"),A+=d*s,!(d<(v=h<=M?u:M+c<=h?c:h-M));h+=f)s>_(a/(y=f-v))&&x("overflow"),s*=y;M=k(A-o,e=g.length+1,0==o),_(A/e)>a-S&&x("overflow"),S+=_(A/e),A%=e,g.splice(A++,0,S)}return E(g)}function I(t){var e,r,n,i,o,s,h,d,v,y,m,g,w,S,M,E=[];for(g=(t=T(t)).length,e=p,o=l,s=r=0;s<g;++s)(m=t[s])<128&&E.push(A(m));for(n=i=E.length,i&&E.push(b);n<g;){for(h=a,s=0;s<g;++s)e<=(m=t[s])&&m<h&&(h=m);for(h-e>_((a-r)/(w=n+1))&&x("overflow"),r+=(h-e)*w,e=h,s=0;s<g;++s)if((m=t[s])<e&&++r>a&&x("overflow"),m==e){for(d=r,v=f;!(d<(y=v<=o?u:o+c<=v?c:v-o));v+=f)M=d-y,S=f-y,E.push(A(j(y+M%S,0))),d=_(M/S);E.push(A(j(d,0))),o=k(r,w,n==i),r=0,++n}++r,++e}return E.join("")}s={version:"1.4.1",ucs2:{decode:T,encode:E},decode:O,encode:I,toASCII:function(t){return M(t,function(t){return y.test(t)?"xn--"+I(t):t})},toUnicode:function(t){return M(t,function(t){return v.test(t)?O(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(11)(t),r(10))},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(79),e.encode=e.stringify=r(80)},function(t,e,r){"use strict";t.exports=function(t,e,r,i){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var f,u,c=t.length;0<a&&a<c&&(c=a);for(var h=0;h<c;++h){var d,l,p,b,v=t[h].replace(s,"%20"),y=v.indexOf(r);l=0<=y?(d=v.substr(0,y),v.substr(y+1)):(d=v,""),p=decodeURIComponent(d),b=decodeURIComponent(l),f=o,u=p,Object.prototype.hasOwnProperty.call(f,u)?n(o[p])?o[p].push(b):o[p]=[o[p],b]:o[p]=b}return o};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";function n(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}t.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),function(s){var a=encodeURIComponent(n(s))+r;return i(t[s])?o(t[s],function(t){return a+encodeURIComponent(n(t))}).join(e):a+encodeURIComponent(n(t[s]))}).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){(function(e){var r=null;"undefined"!=typeof WebSocket?r=WebSocket:"undefined"!=typeof MozWebSocket?r=MozWebSocket:void 0!==e?r=e.WebSocket||e.MozWebSocket:"undefined"!=typeof window?r=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(r=self.WebSocket||self.MozWebSocket),t.exports=r}).call(this,r(10))},function(t,e,r){"use strict";var n=o(r(31)),i=o(r(32));function o(t){return t&&t.__esModule?t:{default:t}}function s(t){return h.sha512().update(t).digest().slice(0,32)}var a=r(33),f=r(0).ec("secp256k1"),u=r(18).hexToBytes,c=r(18).bytesToHex,h=r(7),d=((0,i.default)(l,[{key:"address",value:function(){return this._keypairs?this._kp.deriveAddress(this._keypairs.publicKey):null}},{key:"secret",value:function(){return this._keypairs?this._secret:null}},{key:"toJson",value:function(){return this._keypairs?{secret:this.secret(),address:this.address()}:null}},{key:"getPublicKey",value:function(){return this._keypairs?this._keypairs.publicKey:null}},{key:"sign",value:function(t){if(!t)return null;if(!this._keypairs)return null;var e=this._keypairs.privateKey;return c(f.sign(s(t),u(e),{canonical:!0}).toDER())}},{key:"verify",value:function(t,e){if(!this._keypairs)return null;var r=this.getPublicKey();return f.verify(s(t),e,u(r))}},{key:"signTx",value:function(t){if(!t)return null;if(!this._keypairs)return null;var e=this._keypairs.privateKey;return c(f.sign(t,u(e),{canonical:!0}).toDER())}},{key:"verifyTx",value:function(t,e){if(!this._keypairs)return null;var r=this.getPublicKey();return f.verify(t,e,u(r))}}],[{key:"generate",value:function(t){var e=new a(0<arguments.length&&void 0!==t?t:"swt"),r=e.generateSeed(),n=e.deriveKeyPair(r);return{secret:r,address:e.deriveAddress(n.publicKey)}}},{key:"fromSecret",value:function(t,e){var r=1<arguments.length&&void 0!==e?e:"swt";try{var n=new a(r),i=n.deriveKeyPair(t);return{secret:t,address:n.deriveAddress(i.publicKey)}}catch(t){return null}}},{key:"isValidAddress",value:function(t,e){return new a(1<arguments.length&&void 0!==e?e:"swt").checkAddress(t)}},{key:"isValidSecret",value:function(t,e){var r=1<arguments.length&&void 0!==e?e:"swt";try{return new a(r).deriveKeyPair(t),!0}catch(t){return!1}}}]),l);function l(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"swt";(0,n.default)(this,l);try{this._kp=new a(e),this._keypairs=this._kp.deriveKeyPair(t),this._secret=t}catch(t){this._keypairs=null,this._secret=null}}t.exports=d},function(t,e,r){t.exports={default:r(84),__esModule:!0}},function(t,e,r){var n=r(85);t.exports=function(t,e,r){return n.setDesc(t,e,r)}},function(t,e){var r=Object;t.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},function(t,e){},function(t,e,r){"use strict";e.sha1=r(88),e.sha224=r(89),e.sha256=r(36),e.sha384=r(90),e.sha512=r(37)},function(t,e,r){"use strict";var n=r(2),i=r(15),o=r(35),s=n.rotl32,a=n.sum32,f=n.sum32_5,u=o.ft_1,c=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,c),(t.exports=d).blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.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],c=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=f(s(i,5),u(p,o,c,d),l,r[n],h[p]);l=d,d=c,c=s(o,30),o=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],c),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(2),i=r(36);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).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")}},function(t,e,r){"use strict";var n=r(2),i=r(37);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).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")}},function(t,e,r){"use strict";var n=r(2),i=r(15),o=n.rotl32,s=n.sum32,a=n.sum32_3,f=n.sum32_4,u=i.BlockHash;function c(){if(!(this instanceof c))return new c;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(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 d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(c,u),(e.ripemd160=c).blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],c=this.h[4],m=r,g=n,w=i,_=u,A=c,x=0;x<80;x++){var S=s(o(f(r,h(x,n,i,u),t[p[x]+e],d(x)),v[x]),c);r=c,c=u,u=o(i,10),i=n,n=S,S=s(o(f(m,h(79-x,g,w,_),t[b[x]+e],l(x)),y[x]),A),m=A,A=_,_=o(w,10),w=g,g=S}S=a(this.h[1],i,_),this.h[1]=a(this.h[2],u,A),this.h[2]=a(this.h[3],c,m),this.h[3]=a(this.h[4],r,g),this.h[4]=a(this.h[0],n,w),this.h[0]=S},c.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],b=[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],v=[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],y=[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]},function(t,e,r){"use strict";var n=r(2),i=r(8);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).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)}},function(t){t.exports={_args:[["elliptic@6.4.1","/Users/musheng/jccdex/jcc-bizain-utils"]],_from:"elliptic@6.4.1",_id:"elliptic@6.4.1",_inBundle:!1,_integrity:"sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==",_location:"/jcc_jingtum_base_lib/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.4.1",name:"elliptic",escapedName:"elliptic",rawSpec:"6.4.1",saveSpec:null,fetchSpec:"6.4.1"},_requiredBy:["/jcc_jingtum_base_lib"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",_spec:"6.4.1",_where:"/Users/musheng/jccdex/jcc-bizain-utils",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:"^2.11.3",grunt:"^0.4.5","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":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},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.4.1"}},function(t,e,r){"use strict";var n=e,i=r(1),o=r(8),s=r(38);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e){for(var r=[],n=1<<e+1,i=t.clone();0<=i.cmpn(1);){var o;if(i.isOdd()){var s=i.andln(n-1);o=(n>>1)-1<s?(n>>1)-s:s,i.isubn(o)}else o=0;r.push(o);for(var a=0!==i.cmpn(0)&&0===i.andln(n-1)?e+1:1,f=1;f<a;f++)r.push(0);i.iushrn(a)}return r},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;0<t.cmpn(-n)||0<e.cmpn(-i);){var o,s,a,f=t.andln(3)+n&3,u=e.andln(3)+i&3;3===f&&(f=-1),3===u&&(u=-1),o=0==(1&f)?0:3!=(a=t.andln(7)+n&7)&&5!==a||2!==u?f:-f,r[0].push(o),s=0==(1&u)?0:3!=(a=e.andln(7)+i&7)&&5!==a||2!==f?u:-u,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")}},function(t,e,r){"use strict";var n=r(1),i=r(0).utils,o=i.getNAF,s=i.getJSF,a=i.assert;function f(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);var r=this.n&&this.p.div(this.n);!r||0<r.cmpn(100)?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}(t.exports=f).prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var s=[],f=0;f<n.length;f+=r.step){var u=0;for(e=f+r.step-1;f<=e;e--)u=(u<<1)+n[e];s.push(u)}for(var c=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;0<d;d--){for(f=0;f<s.length;f++)(u=s[f])===d?h=h.mixedAdd(r.points[f]):u===-d&&(h=h.mixedAdd(r.points[f].neg()));c=c.add(h)}return c.toP()},f.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r),f=this.jpoint(null,null,null),u=s.length-1;0<=u;u--){for(e=0;0<=u&&0===s[u];u--)e++;if(0<=u&&e++,f=f.dblp(e),u<0)break;var c=s[u];a(0!==c),f="affine"===t.type?0<c?f.mixedAdd(i[c-1>>1]):f.mixedAdd(i[-c-1>>1].neg()):0<c?f.add(i[c-1>>1]):f.add(i[-c-1>>1].neg())}return"affine"===t.type?f.toP():f},f.prototype._wnafMulAdd=function(t,e,r,n,i){for(var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,c=0,h=0;h<n;h++){var d=(M=e[h])._getNAFPoints(t);a[h]=d.wnd,f[h]=d.points}for(h=n-1;1<=h;h-=2){var l=h-1,p=h;if(1===a[l]&&1===a[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=s(r[l],r[p]);c=Math.max(y[0].length,c),u[l]=new Array(c),u[p]=new Array(c);for(var m=0;m<c;m++){var g=0|y[0][m],w=0|y[1][m];u[l][m]=v[3*(1+g)+(1+w)],u[p][m]=0,f[l]=b}}else u[l]=o(r[l],a[l]),u[p]=o(r[p],a[p]),c=Math.max(u[l].length,c),c=Math.max(u[p].length,c)}var _=this.jpoint(null,null,null),A=this._wnafT4;for(h=c;0<=h;h--){for(var x=0;0<=h;){var S=!0;for(m=0;m<n;m++)A[m]=0|u[m][h],0!==A[m]&&(S=!1);if(!S)break;x++,h--}if(0<=h&&x++,_=_.dblp(x),h<0)break;for(m=0;m<n;m++){var M,T=A[m];0!==T&&(0<T?M=f[m][T-1>>1]:T<0&&(M=f[m][-T-1>>1].neg()),_="affine"===M.type?_.mixedAdd(M):_.add(M))}}for(h=0;h<n;h++)f[h]=null;return i?_:_.toP()},(f.BasePoint=u).prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},f.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")},u.prototype.encodeCompressed=function(t){return this.encode(t,!0)},u.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))},u.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},u.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},u.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)},u.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}},u.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}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},function(t,e,r){"use strict";var n=r(17),i=r(0),o=r(1),s=r(13),a=n.base,f=i.utils.assert;function u(t){a.call(this,"short",t),this.a=new o(t.a,16).toRed(this.red),this.b=new o(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){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(e,16),this.y=new o(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 h(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(e,16),this.y=new o(r,16),this.z=new o(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}s(u,a),(t.exports=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 o(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 o(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],f(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 o(t.a,16),b:new o(t.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:o.mont(t),r=new o(2).toRed(e).redInvm(),n=r.redNeg(),i=new o(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,i,s,a,f,u,c,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new o(1),b=new o(0),v=new o(0),y=new o(1),m=0;0!==d.cmpn(0);){var g=l.div(d);u=l.sub(g.mul(d)),c=v.sub(g.mul(p));var w=y.sub(g.mul(b));if(!n&&u.cmp(h)<0)e=f.neg(),r=p,n=u.neg(),i=c;else if(n&&2==++m)break;l=d,d=f=u,v=p,p=c,y=b,b=w}s=u.neg(),a=c;var _=n.sqr().add(i.sqr());return 0<=s.sqr().add(a.sqr()).cmp(_)&&(s=e,a=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:i},{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),f=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:f.add(u).neg()}},u.prototype.pointFromX=function(t,e){(t=new o(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)},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],f=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),n[2*o]=a,n[2*o+1]=f,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return u},s(c,a.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).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 o(t,16),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)},s(h,a.BasePoint),u.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.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)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.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),f=o.redSub(s);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),h=n.redMul(u),d=f.redSqr().redIAdd(c).redISub(h).redISub(h),l=f.redMul(h.redISub(d)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},h.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 f=s.redSqr(),u=f.redMul(s),c=r.redMul(f),h=a.redSqr().redIAdd(u).redISub(c).redISub(c),d=a.redMul(c.redISub(h)).redISub(i.redMul(u)),l=this.z.redMul(s);return this.curve.jpoint(h,d,l)},h.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,f=a.redSqr().redSqr(),u=s.redAdd(s);for(r=0;r<t;r++){var c=o.redSqr(),h=u.redSqr(),d=h.redSqr(),l=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(f)),p=o.redMul(h),b=l.redSqr().redISub(p.redAdd(p)),v=p.redISub(b),y=l.redMul(v);y=y.redIAdd(y).redISub(d);var m=u.redMul(a);r+1<t&&(f=f.redMul(d)),o=b,a=m,u=y}return this.curve.jpoint(o,u.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.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),f=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=f,e=a.redMul(s.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),l=this.x.redAdd(h).redSqr().redISub(c).redISub(d);l=l.redIAdd(l);var p=c.redAdd(c).redIAdd(c),b=p.redSqr(),v=d.redIAdd(d);v=(v=v.redIAdd(v)).redIAdd(v),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(v),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.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),f=a.redSqr().redISub(s).redISub(s);t=f;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(s.redISub(f)).redISub(u),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),l=this.x.redSub(c).redMul(this.x.redAdd(c));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(c);var v=h.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),e=l.redMul(p.redISub(t)).redISub(v)}return this.curve.jpoint(t,e,r)},h.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)),f=e.redAdd(e),u=(f=f.redIAdd(f)).redMul(s),c=a.redSqr().redISub(u.redAdd(u)),h=u.redISub(c),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(h).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,l,p)},h.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(),f=n.redIAdd(n);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(f),c=e.redMul(u);c=(c=c.redIAdd(c)).redIAdd(c);var h=this.x.redMul(a).redISub(c);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(u.redMul(f.redISub(u)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,d,l)},h.prototype.mul=function(t,e){return t=new o(t,e),this.curve._wnafMul(this,t)},h.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)},h.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),0<=n.cmp(this.curve.p))return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(17),i=r(1),o=r(13),s=n.base,a=r(0).utils;function f(t){s.call(this,"mont",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){s.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(e,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(f,s),(t.exports=f).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)},o(u,s.BasePoint),f.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},f.prototype.point=function(t,e){return new u(this,t,e)},f.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()),f=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,f)},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;0<=o;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()}},function(t,e,r){"use strict";var n=r(17),i=r(0),o=r(1),s=r(13),a=n.base,f=i.utils.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new o(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function c(t,e,r,n,i){a.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 o(e,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,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()))))}s(u,a),(t.exports=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 o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(i.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var f=a.fromRed().isOdd();return(e&&!f||!e&&f)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new o(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(i.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)},s(c,a.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),f=i.redMul(s),u=o.redMul(a),c=i.redMul(a),h=s.redMul(o);return this.curve.point(f,u,h,c)},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=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)t=n.redSub(i).redSub(o).redMul(s.redSub(this.curve.two)),e=s.redMul(u.redSub(o)),r=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),f=s.redSub(a).redISub(a);t=n.redSub(i).redISub(o).redMul(f),e=s.redMul(u.redSub(o)),r=s.redMul(f)}}else{var u=i.redAdd(o);a=this.curve._mulC(this.z).redSqr(),f=u.redSub(a).redSub(a),t=this.curve._mulC(n.redISub(u)).redMul(f),e=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(f)}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),f=r.redAdd(e),u=o.redMul(s),c=a.redMul(f),h=o.redMul(f),d=s.redMul(a);return this.curve.point(u,c,d,h)},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),f=i.redSub(a),u=i.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),h=n.redMul(f).redMul(c);return r=this.curve.twisted?(e=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),f.redMul(u)):(e=n.redMul(u).redMul(s.redSub(o)),this.curve._mulC(f).redMul(u)),this.curve.point(h,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),0<=r.cmp(this.curve.p))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},function(t,e,r){"use strict";var n,i=e,o=r(7),s=r(0),a=s.utils.assert;function f(t){"short"===t.type?this.curve=new s.curve.short(t):"edwards"===t.type?this.curve=new s.curve.edwards(t):this.curve=new s.curve.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 u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new f(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=f,u("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"]}),u("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"]}),u("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"]}),u("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"]}),u("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"]}),u("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"]}),u("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(100)}catch(t){n=void 0}u("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]})},function(t,e){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"]]}}},function(t,e,r){"use strict";var n=r(1),i=r(102),o=r(0),s=o.utils.assert,a=r(103),f=r(104);function u(t){if(!(this instanceof u))return new u(t);"string"==typeof t&&(s(o.curves.hasOwnProperty(t),"Unknown curve "+t),t=o.curves[t]),t instanceof o.curves.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=u).prototype.keyPair=function(t){return new a(this,t)},u.prototype.keyFromPrivate=function(t,e){return a.fromPrivate(this,t,e)},u.prototype.keyFromPublic=function(t,e){return a.fromPublic(this,t,e)},u.prototype.genKeyPair=function(t){t=t||{};for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new n(2));;){var a=new n(e.generate(r));if(!(0<a.cmp(s)))return a.iaddn(1),this.keyFromPrivate(a)}},u.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return 0<r&&(t=t.ushrn(r)),!e&&0<=t.cmp(this.n)?t.sub(this.n):t},u.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"}),h=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||0<=l.cmp(h))){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),v=b.umod(this.n);if(0!==v.cmpn(0)){var y=l.invm(this.n).mul(v.mul(e.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==b.cmp(v)?2:0);return o.canonical&&0<y.cmp(this.nh)&&(y=this.n.sub(y),m^=1),new f({r:v,s:y,recoveryParam:m})}}}}}},u.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||0<=o.cmp(this.n))return!1;if(s.cmpn(1)<0||0<=s.cmp(this.n))return!1;var a,u=s.invm(this.n),c=u.mul(t).umod(this.n),h=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},u.prototype.recoverPubKey=function(t,e,r,i){s((3&r)===r,"The recovery param is more than two bits"),e=new f(e,i);var o=this.n,a=new n(t),u=e.r,c=e.s,h=1&r,d=r>>1;if(0<=u.cmp(this.curve.p.umod(this.curve.n))&&d)throw new Error("Unable to find sencond key candinate");u=d?this.curve.pointFromX(u.add(this.curve.n),h):this.curve.pointFromX(u,h);var l=e.r.invm(o),p=o.sub(a).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,u,b)},u.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")}},function(t,e,r){"use strict";var n=r(7),i=r(38),o=r(8);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).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)}},function(t,e,r){"use strict";var n=r(1),i=r(0).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)}(t.exports=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())+" >"}},function(t,e,r){"use strict";var n=r(1),i=r(0).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 f(t,e){var r=t[e.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s];return e.place=s,i}function u(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 c(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).prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;if(f(t,r)+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var o=f(t,r),s=t.slice(r.place,o+r.place);if(r.place+=o,2!==t[r.place++])return!1;var u=f(t,r);if(t.length!==u+r.place)return!1;var c=t.slice(r.place,u+r.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new n(s),this.s=new n(c),!(this.recoveryParam=null)},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=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),s=[48];return c(s,o.length),s=s.concat(o),i.encode(s,t)}},function(t,e,r){"use strict";var n=r(7),i=r(0),o=i.utils,s=o.assert,a=o.parseBytes,f=r(106),u=r(107);function c(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i.curves[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=c).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()),f=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:o})},c.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)},c.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)},c.prototype.keyFromPublic=function(t){return f.fromPublic(this,t)},c.prototype.keyFromSecret=function(t){return f.fromSecret(this,t)},c.prototype.makeSignature=function(t){return t instanceof u?t:new u(this,t)},c.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},c.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)},c.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(t){return o.intFromLE(t)},c.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";var n=r(0).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)},t.exports=a},function(t,e,r){"use strict";var n=r(1),i=r(0).utils,o=i.assert,s=i.cachedProperty,a=i.parseBytes;function f(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(f,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(f,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(f,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(f,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),f.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},f.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=f},function(t,e,r){"use strict";var n=new(r(0).ec)("secp256k1"),i=r(109);t.exports={ScalarMultiple:function(t,e){for(var r=n.curve.n,o=0;o<=4294967295;o++){var s=(new i).add(t);void 0!==e&&s.addU32(e),s.addU32(o);var a=s.first256BN();if(0<a.cmpn(0)&&a.cmp(r)<0)return a}throw new Error("impossible space search)")}}},function(t,e,r){"use strict";var n=r(7),i=r(1);function o(){this.hash=n.sha512()}o.prototype.add=function(t){return this.hash.update(t),this},o.prototype.addU32=function(t){return this.add([t>>>24&255,t>>>16&255,t>>>8&255,255&t])},o.prototype.finish=function(){return this.hash.digest()},o.prototype.first256=function(){return this.finish().slice(0,32)},o.prototype.first256BN=function(){return new i(this.first256())},t.exports=o},function(t,e,r){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,a=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),f=1;f<arguments.length;f++){for(var u in r=Object(arguments[f]))i.call(r,u)&&(a[u]=r[u]);if(n){s=n(r);for(var c=0;c<s.length;c++)o.call(r,s[c])&&(a[s[c]]=r[s[c]])}}return a}},function(t,e,r){var n={};function i(t,e){for(var r in t)e[r]=t[r]}(t.exports=n).from=r(112),n.to=r(113),n.is=r(115),n.subarray=r(116),n.join=r(117),n.copy=r(118),n.create=r(119),i(r(120),n),i(r(121),n)},function(t,e,r){t.exports=function(t,e){return Array.isArray(t)?new Uint8Array(t):i[e||"utf8"](t)};var n=r(23),i={hex:function(t){for(var e=t.length/2,r=new Uint8Array(e),n="",i=0,o=t.length;i<o;++i)n+=t.charAt(i),0<i&&i%2==1&&(r[i>>>1]=parseInt(n,16),n="");return r},utf8:function(t){for(var e,r=[],n=0,i=t.length;n<i;++n)!1!==(e=s(t,n))&&(e<128?r[r.length]=e:o(r,e));return new Uint8Array(r)},base64:function(t){return new Uint8Array(n.toByteArray(t))}};function o(t,e){for(var r,n,i,o=e,s=0;++s,o>>>=1;);for(n|=[0,0,192,224,240,248,252][r=0|Math.ceil((s-1)/5)],s=7-(i=[0,0,3,4,5,6,7][r])+6*(r-1);s;)n|=+!!(e&1<<s)<<7-i,++i%8==0&&(t[t.length]=n,n=128,i=2),--s;i&&(n|=+!!(1&e)<<7-i,t[t.length]=n)}function s(t,e){e=e||0;var r,n,i=t.charCodeAt(e);if(55296<=i&&i<=56319){if(r=t.charCodeAt(e+1),n=i,isNaN(r))throw new Error("High surrogate not followed by low surrogate");return 1024*(n-55296)+(r-56320)+65536}return!(56320<=i&&i<=57343)&&i}},function(t,e,r){t.exports=function(t,e){return o[e||"utf8"](t)};var n=r(23),i=r(114),o={hex:function(t){for(var e,r="",n=0,i=t.length;n<i;++n)r+=((240&(e=t[n]))>>>4).toString(16),r+=(15&e).toString(16);return r},utf8:function(t){return i(t)},base64:function(t){return n.fromByteArray(t)}}},function(t,e){t.exports=function(t,e,o){e=void 0===e?0:e,o=void 0===o?t.length:o;var u,c,h=0,d=0;for(n.length=r.length=0;h<t.length;)c=t[h],!d&&128&c?(d+=u=a(c),u<8&&(n[n.length]=c&s[6-u])):d?(n[n.length]=c&s[6],!--d&&n.length&&(r[r.length]=i(f(n)),n.length=0)):r[r.length]=i(c),++h;return n.length&&!d&&(r[r.length]=i(f(n)),n.length=0),r.join("")};var r=[],n=[],i=String.fromCharCode,o=[64,32,16,8,4,2,1],s=[0,1,3,7,15,31,63,127];function a(t){for(var e=0;e<7&&t&o[e];++e);return e}function f(t){for(var e=0,r=0,n=t.length;r<n;++r)e|=t[r]<<6*(n-r-1);return e}},function(t,e){t.exports=function(t){return t instanceof Uint8Array}},function(t,e){t.exports=function(t,e,r){return t.subarray(e||0,r||t.length)}},function(t,e){t.exports=function(t,e){if(!t.length)return new Uint8Array(0);for(var r=void 0!==e?e:function(t){for(var e=0,r=0,n=t.length;r<n;++r)e+=t[r].byteLength;return e}(t),n=new Uint8Array(r),i=t[0],o=i.length,s=0,a=0,f=0;f<r;)a!==o?n[f++]=i[a++]:(a=0,o=(i=t[++s])&&i.length);return n}},function(t,e){t.exports=function(t,e,n,i,o){if(n=arguments.length<3?0:n,i=arguments.length<4?0:i,(o=arguments.length<5?t.length:o)!==i&&0!==e.length&&0!==t.length)return o>t.length&&(o=t.length),e.length-n<o-i&&(o=e.length-n+i),t.buffer===e.buffer?function(t,e,n,i,o){for(var s=o+i,a=new Uint8Array(r.call(t,i,s)),f=0;i<s;++i,++f)e[n++]=a[f]}(t,e,n,i,o):function(t,e,r,n,i){for(var o=i-n+r,s=r,a=n;s<o;++s,++a)e[s]=t[a]}(t,e,n,i,o)};var r=[].slice},function(t,e){t.exports=function(t){return new Uint8Array(t)}},function(t,e,r){t.exports={readUInt8:function(t,e){return t[e]},readInt8:function(t,e){var r=t[e];return r<128?r:r-256},readUInt16LE:function(t,e){return n.get(t).getUint16(e+t.byteOffset,!0)},readUInt32LE:function(t,e){return n.get(t).getUint32(e+t.byteOffset,!0)},readInt16LE:function(t,e){return n.get(t).getInt16(e+t.byteOffset,!0)},readInt32LE:function(t,e){return n.get(t).getInt32(e+t.byteOffset,!0)},readFloatLE:function(t,e){return n.get(t).getFloat32(e+t.byteOffset,!0)},readDoubleLE:function(t,e){return n.get(t).getFloat64(e+t.byteOffset,!0)},readUInt16BE:function(t,e){return n.get(t).getUint16(e+t.byteOffset,!1)},readUInt32BE:function(t,e){return n.get(t).getUint32(e+t.byteOffset,!1)},readInt16BE:function(t,e){return n.get(t).getInt16(e+t.byteOffset,!1)},readInt32BE:function(t,e){return n.get(t).getInt32(e+t.byteOffset,!1)},readFloatBE:function(t,e){return n.get(t).getFloat32(e+t.byteOffset,!1)},readDoubleBE:function(t,e){return n.get(t).getFloat64(e+t.byteOffset,!1)}};var n=r(39)},function(t,e,r){t.exports={writeUInt8:function(t,e,r){return t[r]=e},writeInt8:function(t,e,r){return t[r]=e<0?e+256:e},writeUInt16LE:function(t,e,r){return n.get(t).setUint16(r+t.byteOffset,e,!0)},writeUInt32LE:function(t,e,r){return n.get(t).setUint32(r+t.byteOffset,e,!0)},writeInt16LE:function(t,e,r){return n.get(t).setInt16(r+t.byteOffset,e,!0)},writeInt32LE:function(t,e,r){return n.get(t).setInt32(r+t.byteOffset,e,!0)},writeFloatLE:function(t,e,r){return n.get(t).setFloat32(r+t.byteOffset,e,!0)},writeDoubleLE:function(t,e,r){return n.get(t).setFloat64(r+t.byteOffset,e,!0)},writeUInt16BE:function(t,e,r){return n.get(t).setUint16(r+t.byteOffset,e,!1)},writeUInt32BE:function(t,e,r){return n.get(t).setUint32(r+t.byteOffset,e,!1)},writeInt16BE:function(t,e,r){return n.get(t).setInt16(r+t.byteOffset,e,!1)},writeInt32BE:function(t,e,r){return n.get(t).setInt32(r+t.byteOffset,e,!1)},writeFloatBE:function(t,e,r){return n.get(t).setFloat32(r+t.byteOffset,e,!1)},writeDoubleBE:function(t,e,r){return n.get(t).setFloat64(r+t.byteOffset,e,!1)}};var n=r(39)},function(t,e,r){"use strict";t.exports=[{currency:"SWT",ACCOUNT_ALPHABET:"jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz",SEED_PREFIX:33,ACCOUNT_PREFIX:0,ACCOUNT_ZERO:"jjjjjjjjjjjjjjjjjjjjjhoLvTp",ACCOUNT_ONE:"jjjjjjjjjjjjjjjjjjjjBZbvri",fee:10},{currency:"BWT",ACCOUNT_ALPHABET:"bpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2jcdeCg65rkm8oFqi1tuvAxyz",SEED_PREFIX:33,ACCOUNT_PREFIX:0,ACCOUNT_ZERO:"bbbbbbbbbbbbbbbbbbbbbhoLvTp",ACCOUNT_ONE:"bbbbbbbbbbbbbbbbbbbbBZjvri",fee:10}]},function(t,e){t.exports=function(t){for(var e={},r=t.length,n=t.charAt(0),i=0;i<t.length;i++)e[t.charAt(i)]=i;function o(t){if(0===t.length)return[];for(var i=[0],o=0;o<t.length;o++){var s=e[t[o]];if(void 0===s)return;for(var a=0,f=s;a<i.length;++a)f+=i[a]*r,i[a]=255&f,f>>=8;for(;0<f;)i.push(255&f),f>>=8}for(var u=0;t[u]===n&&u<t.length-1;++u)i.push(0);return i.reverse()}return{encode:function(e){if(0===e.length)return"";for(var n=[0],i=0;i<e.length;++i){for(var o=0,s=e[i];o<n.length;++o)s+=n[o]<<8,n[o]=s%r,s=s/r|0;for(;0<s;)n.push(s%r),s=s/r|0}for(var a="",f=0;0===e[f]&&f<e.length-1;++f)a+=t[0];for(var u=n.length-1;0<=u;--u)a+=t[n[u]];return a},decodeUnsafe:o,decode:function(t){var e=o(t);if(e)return e;throw new Error("Non-base"+r+" character")}}}},function(t,e,r){t.exports=r(125)},function(t,e,r){var n=r(126),i=r(134),o=r(143),s=i(function(t,e){n(e,o(e),t)});t.exports=s},function(t,e,r){var n=r(127),i=r(40);t.exports=function(t,e,r,o){var s=!r;r=r||{};for(var a=-1,f=e.length;++a<f;){var u=e[a],c=o?o(r[u],t[u],u,r,t):void 0;void 0===c&&(c=t[u]),s?i(r,u,c):n(r,u,c)}return r}},function(t,e,r){var n=r(40),i=r(46),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var s=t[e];o.call(t,e)&&i(s,r)&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(42),i=r(131),o=r(19),s=r(45),a=/^\[object .+?Constructor\]$/,f=Function.prototype,u=Object.prototype,c=f.toString,h=u.hasOwnProperty,d=RegExp("^"+c.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(n(t)?d:a).test(s(t))}},function(t,e,r){var n=r(43),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),r=t[a];try{var n=!(t[a]=void 0)}catch(t){}var i=s.call(t);return n&&(e?t[a]=r:delete t[a]),i}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e,r){var n,i=r(132),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!o&&o in t}},function(t,e,r){var n=r(4)["__core-js_shared__"];t.exports=n},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(135),i=r(142);t.exports=function(t){return n(function(e,r){var n=-1,o=r.length,s=1<o?r[o-1]:void 0,a=2<o?r[2]:void 0;for(s=3<t.length&&"function"==typeof s?(o--,s):void 0,a&&i(r[0],r[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++n<o;){var f=r[n];f&&t(e,f,n,s)}return e})}},function(t,e,r){var n=r(47),i=r(136),o=r(138);t.exports=function(t,e){return o(i(t,e,n),t+"")}},function(t,e,r){var n=r(137),i=Math.max;t.exports=function(t,e,r){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,s=-1,a=i(o.length-e,0),f=Array(a);++s<a;)f[s]=o[e+s];s=-1;for(var u=Array(e+1);++s<e;)u[s]=o[s];return u[e]=r(f),n(t,this,u)}}},function(t,e){t.exports=function(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(t,e,r){var n=r(139),i=r(141)(n);t.exports=i},function(t,e,r){var n=r(140),i=r(41),o=r(47),s=i?function(t,e){return i(t,"toString",{configurable:!0,enumerable:!1,value:n(e),writable:!0})}:o;t.exports=s},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e){var r=Date.now;t.exports=function(t){var e=0,n=0;return function(){var i=r(),o=16-(i-n);if(n=i,0<o){if(800<=++e)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,r){var n=r(46),i=r(25),o=r(49),s=r(19);t.exports=function(t,e,r){if(!s(r))return!1;var a=typeof e;return!!("number"==a?i(r)&&o(e,r.length):"string"==a&&e in r)&&n(r[e],t)}},function(t,e,r){var n=r(144),i=r(151),o=r(25);t.exports=function(t){return o(t)?n(t,!0):i(t)}},function(t,e,r){var n=r(145),i=r(50),o=r(51),s=r(52),a=r(49),f=r(53),u=Object.prototype.hasOwnProperty;t.exports=function(t,e){var r=o(t),c=!r&&i(t),h=!r&&!c&&s(t),d=!r&&!c&&!h&&f(t),l=r||c||h||d,p=l?n(t.length,String):[],b=p.length;for(var v in t)!e&&!u.call(t,v)||l&&("length"==v||h&&("offset"==v||"parent"==v)||d&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||a(v,b))||p.push(v);return p}},function(t,e){t.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},function(t,e,r){var n=r(16),i=r(20);t.exports=function(t){return i(t)&&"[object Arguments]"==n(t)}},function(t,e){t.exports=function(){return!1}},function(t,e,r){var n=r(16),i=r(48),o=r(20),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,t.exports=function(t){return o(t)&&i(t.length)&&!!s[n(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,r){(function(t){var n=r(44),i=e&&!e.nodeType&&e,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===i&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}();t.exports=a}).call(this,r(11)(t))},function(t,e,r){var n=r(19),i=r(26),o=r(152),s=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=i(t),r=[];for(var a in t)("constructor"!=a||!e&&s.call(t,a))&&r.push(a);return r}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},function(t,e,r){var n=r(154),i=r(157),o=r(50),s=r(51),a=r(25),f=r(52),u=r(26),c=r(53),h=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(a(t)&&(s(t)||"string"==typeof t||"function"==typeof t.splice||f(t)||c(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(u(t))return!n(t).length;for(var r in t)if(h.call(t,r))return!1;return!0}},function(t,e,r){var n=r(26),i=r(155),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return i(t);var e=[];for(var r in Object(t))o.call(t,r)&&"constructor"!=r&&e.push(r);return e}},function(t,e,r){var n=r(156)(Object.keys,Object);t.exports=n},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e,r){var n=r(158),i=r(159),o=r(160),s=r(161),a=r(162),f=r(16),u=r(45),c="[object Map]",h="[object Promise]",d="[object Set]",l="[object WeakMap]",p="[object DataView]",b=u(n),v=u(i),y=u(o),m=u(s),g=u(a),w=f;(n&&w(new n(new ArrayBuffer(1)))!=p||i&&w(new i)!=c||o&&w(o.resolve())!=h||s&&w(new s)!=d||a&&w(new a)!=l)&&(w=function(t){var e=f(t),r="[object Object]"==e?t.constructor:void 0,n=r?u(r):"";if(n)switch(n){case b:return p;case v:return c;case y:return h;case m:return d;case g:return l}return e}),t.exports=w},function(t,e,r){var n=r(12)(r(4),"DataView");t.exports=n},function(t,e,r){var n=r(12)(r(4),"Map");t.exports=n},function(t,e,r){var n=r(12)(r(4),"Promise");t.exports=n},function(t,e,r){var n=r(12)(r(4),"Set");t.exports=n},function(t,e,r){var n=r(12)(r(4),"WeakMap");t.exports=n},function(t,e){t.exports=[{currency:"SWT",ACCOUNT_ZERO:"jjjjjjjjjjjjjjjjjjjjjhoLvTp",ACCOUNT_ONE:"jjjjjjjjjjjjjjjjjjjjBZbvri",fee:1e4},{currency:"BWT",ACCOUNT_ZERO:"bbbbbbbbbbbbbbbbbbbbbhoLvTp",ACCOUNT_ONE:"bbbbbbbbbbbbbbbbbbbbBZjvri",fee:10}]},function(t,e,r){(function(t){var n=r(24),i=r(14),o=r(165),s=r(7),a=e.REQUIRED=0,f=e.OPTIONAL=1,u=e.DEFAULT=2,c=[["TransactionType",a],["Flags",f],["SourceTag",f],["LastLedgerSequence",f],["Account",a],["Sequence",f],["Fee",a],["OperationLimit",f],["SigningPubKey",f],["TxnSignature",f]],h={AccountSet:[3].concat(c,[["EmailHash",f],["WalletLocator",f],["WalletSize",f],["MessageKey",f],["Domain",f],["TransferRate",f]]),TrustSet:[20].concat(c,[["LimitAmount",f],["QualityIn",f],["QualityOut",f]]),RelationSet:[21].concat(c,[["Target",a],["RelationType",a],["LimitAmount",f]]),RelationDel:[22].concat(c,[["Target",a],["RelationType",a],["LimitAmount",f]]),OfferCreate:[7].concat(c,[["TakerPays",a],["TakerGets",a],["AppType",f],["Expiration",f]]),OfferCancel:[8].concat(c,[["OfferSequence",a]]),SetRegularKey:[5].concat(c,[["RegularKey",a]]),Payment:[0].concat(c,[["Destination",a],["Amount",a],["SendMax",f],["Paths",u],["InvoiceID",f],["DestinationTag",f]]),Contract:[9].concat(c,[["Expiration",a],["BondAmount",a],["StampEscrow",a],["JingtumEscrow",a],["CreateCode",f],["FundCode",f],["RemoveCode",f],["ExpireCode",f]]),RemoveContract:[10].concat(c,[["Target",a]]),EnableFeature:[100].concat(c,[["Feature",a]]),SetFee:[101].concat(c,[["Features",a],["BaseFee",a],["ReferenceFeeUnits",a],["ReserveBase",a],["ReserveIncrement",a]]),ConfigContract:[30].concat(c,[["Method",a],["Payload",f],["Destination",f],["Amount",f],["Contracttype",f],["ContractMethod",f],["Args",f]]),Brokerage:[205].concat(c,[["OfferFeeRateNum",a],["OfferFeeRateDen",a],["AppType",a],["Amount",a]])},d=[["LedgerIndex",f],["LedgerEntryType",a],["Flags",a]],l={AccountRoot:[97].concat(d,[["Sequence",a],["PreviousTxnLgrSeq",a],["TransferRate",f],["WalletSize",f],["OwnerCount",a],["EmailHash",f],["PreviousTxnID",a],["AccountTxnID",f],["WalletLocator",f],["Balance",a],["MessageKey",f],["Domain",f],["Account",a],["RegularKey",f]]),Contract:[99].concat(d,[["PreviousTxnLgrSeq",a],["Expiration",a],["BondAmount",a],["PreviousTxnID",a],["Balance",a],["FundCode",f],["RemoveCode",f],["ExpireCode",f],["CreateCode",f],["Account",a],["Owner",a],["Issuer",a]]),DirectoryNode:[100].concat(d,[["IndexNext",f],["IndexPrevious",f],["ExchangeRate",f],["RootIndex",a],["Owner",f],["TakerPaysCurrency",f],["TakerPaysIssuer",f],["TakerGetsCurrency",f],["TakerGetsIssuer",f],["Indexes",a]]),EnabledFeatures:[102].concat(d,[["Features",a]]),FeeSettings:[115].concat(d,[["ReferenceFeeUnits",a],["ReserveBase",a],["ReserveIncrement",a],["BaseFee",a],["LedgerIndex",f]]),GeneratorMap:[103].concat(d,[["Generator",a]]),LedgerHashes:[104].concat(d,[["LedgerEntryType",a],["Flags",a],["FirstLedgerSequence",f],["LastLedgerSequence",f],["LedgerIndex",f],["Hashes",a]]),Nickname:[110].concat(d,[["LedgerEntryType",a],["Flags",a],["LedgerIndex",f],["MinimumOffer",f],["Account",a]]),Offer:[111].concat(d,[["LedgerEntryType",a],["Flags",a],["Sequence",a],["PreviousTxnLgrSeq",a],["Expiration",f],["BookNode",a],["OwnerNode",a],["PreviousTxnID",a],["LedgerIndex",f],["BookDirectory",a],["TakerPays",a],["TakerGets",a],["Account",a]]),SkywellState:[114].concat(d,[["LedgerEntryType",a],["Flags",a],["PreviousTxnLgrSeq",a],["HighQualityIn",f],["HighQualityOut",f],["LowQualityIn",f],["LowQualityOut",f],["LowNode",f],["HighNode",f],["PreviousTxnID",a],["LedgerIndex",f],["Balance",a],["LowLimit",a],["HighLimit",a]])},p=[["TransactionIndex",a],["TransactionResult",a],["AffectedNodes",a]];function b(t){if(1<t.length)return 0;var e=t.charCodeAt(0);if(48<e){if(e<58)return e-48;if(64<e){if(e<91)return e-55;if(96<e&&e<123)return e-87}}return 0}function v(t){return 0<=t&&t<10?t+48:10<=t&&t<16?t+55:void 0}function y(e,r){if(Array.isArray(e)||t&&t.isBuffer(e))this.buffer=e;else if("string"==typeof e)this.buffer=function(t){var e,r=[],n=t.replace(/\s|0x/g,"");for(e=0;e<n.length;e+=2)e+1>n.length?r.push(16*b(n.charAt(e))):r.push(16*b(n.charAt(e))+b(n.charAt(e+1)));return r}(e);else{if(e)throw new Error("Invalid buffer passed.");this.buffer=[]}this._token=r||"swt",this.pointer=0}function m(t){return function(e){var r=this.pointer,n=r+e;if(n>this.buffer.length)throw new Error("Buffer length exceeded");var i=this.buffer.slice(r,n);return t&&(this.pointer=n),i}}y.prototype.bytes_to_str=function(t){var e,r,n="";for(e=0;e<t.length;e++)0<=(r=(240&t[e])>>4)&&r<16&&(n+=String.fromCharCode(v(r))),0<=(r=15&t[e])&&r<16&&(n+=String.fromCharCode(v(r)));return n},y.from_json=function(t,e){var r,n=i(!0,{},t),o=new y(null,e);if("number"==typeof n.TransactionType&&(n.TransactionType=y.lookup_type_tx(n.TransactionType),!n.TransactionType))throw new Error("Transaction type ID is invalid.");if("number"==typeof n.LedgerEntryType&&(n.LedgerEntryType=y.lookup_type_le(n.LedgerEntryType),!n.LedgerEntryType))throw new Error("LedgerEntryType ID is invalid.");if("string"==typeof n.TransactionType){if(r=h[n.TransactionType],!Array.isArray(r))throw new Error("Transaction type is invalid");r=r.slice(),n.TransactionType=r.shift()}else if("string"==typeof n.LedgerEntryType){if(r=l[n.LedgerEntryType],!Array.isArray(r))throw new Error("LedgerEntryType is invalid");r=r.slice(),n.LedgerEntryType=r.shift()}else{if("object"!=typeof n.AffectedNodes)throw new Error("Object to be serialized must contain either TransactionType, LedgerEntryType or AffectedNodes.");r=p}return o.serialize(r,n),o},y.check_no_missing_fields=function(t,e){for(var r,n=[],i=t.length-1;0<=i;i--){var o=t[i],s=o[0],f=o[1];a===f&&void 0===e[s]&&n.push(s)}if(0<n.length)throw r=e.TransactionType?y.lookup_type_tx(e.TransactionType):e.LedgerEntryType?y.lookup_type_le(e.LedgerEntryType):"TransactionMetaData",new Error(r+" is missing fields: "+JSON.stringify(n))},y.prototype.append=function(t){t instanceof y&&(t=t.buffer),this.buffer=this.buffer.concat(t),this.pointer+=t.length},y.prototype.resetPointer=function(){this.pointer=0},y.prototype.read=m(!0),y.prototype.peek=m(!1),y.prototype.to_hex=function(){return this.bytes_to_str(this.buffer)},y.prototype.to_json=function(){var t=this.pointer;this.resetPointer();for(var e={};this.pointer<this.buffer.length;){var r=o.parse(this),n=r[0],i=r[1];e[n]=y.jsonify_structure(i,n)}return this.pointer=t,e},y.jsonify_structure=function(t,e){var r;switch(typeof t){case"number":switch(e){case"LedgerEntryType":r=o.get_ledger_entry_type(t);break;case"TransactionResult":r=o.get_transaction_result(t);break;case"TransactionType":r=o.get_transaction_type(t);break;default:r=t}break;case"object":if(null===t)break;if("function"==typeof t.to_json)r=t.to_json();else{r=new t.constructor;for(var n=Object.keys(t),i=0,s=n.length;i<s;i++){var a=n[i];r[a]=y.jsonify_structure(t[a],a)}}break;default:r=t}return r},y.prototype.serialize=function(t,e){o.Object.serialize(this,e,!0)},y.prototype.hash=function(t,e){var r=new y(null,e);return void 0!==t&&o.Int32.serialize(r,t),r.append(this.buffer),this.bytes_to_str(s.sha512().update(r.buffer).digest().slice(0,32))},y.get_field_header=function(t,e){var r=[0];return 15<t?r.push(255&t):r[0]+=(15&t)<<4,15<e?r.push(255&e):r[0]+=15&e,r},y.sort_typedef=function(t){return n(Array.isArray(t)),t.sort(function(t,e){return t[3]!==e[3]?o[t[3]].id-o[e[3]].id:t[2]-e[2]})},y.lookup_type_tx=function(t){return n.strictEqual(typeof t,"number"),h[t]},y.lookup_type_le=function(t){return n("number"==typeof t),l[t]},e.Serializer=y}).call(this,r(22).Buffer)},function(t,e,r){function n(t){o(this,t)}var i=r(24),o=r(14),s=r(6).KeyPair,a=r(58),f=r(167).BigInteger,u=r(168),c=r(5).arraySet,h=u.Amount,d=[void 0,"Int16","Int32","Int64","Hash128","Hash256","Amount","VL","Account",void 0,void 0,void 0,void 0,void 0,"Object","Array","Int8","Hash160","PathSet","Vector256"],l={1:{1:"LedgerEntryType",2:"TransactionType"},2:{2:"Flags",3:"SourceTag",4:"Sequence",5:"PreviousTxnLgrSeq",6:"LedgerSequence",7:"CloseTime",8:"ParentCloseTime",9:"SigningTime",10:"Expiration",11:"TransferRate",12:"WalletSize",13:"OwnerCount",14:"DestinationTag",15:"Timestamp",16:"HighQualityIn",17:"HighQualityOut",18:"LowQualityIn",19:"LowQualityOut",20:"QualityIn",21:"QualityOut",22:"StampEscrow",23:"BondAmount",24:"LoadFee",25:"OfferSequence",26:"FirstLedgerSequence",27:"LastLedgerSequence",28:"TransactionIndex",29:"OperationLimit",30:"ReferenceFeeUnits",31:"ReserveBase",32:"ReserveIncrement",33:"SetFlag",34:"ClearFlag",35:"RelationType",36:"Method",37:"AppType",39:"Contracttype"},3:{1:"IndexNext",2:"IndexPrevious",3:"BookNode",4:"OwnerNode",5:"BaseFee",6:"ExchangeRate",7:"LowNode",8:"HighNode",9:"OfferFeeRateNum",10:"OfferFeeRateDen"},4:{1:"EmailHash"},5:{1:"LedgerHash",2:"ParentHash",3:"TransactionHash",4:"AccountHash",5:"PreviousTxnID",6:"LedgerIndex",7:"WalletLocator",8:"RootIndex",9:"AccountTxnID",16:"BookDirectory",17:"InvoiceID",18:"Nickname",19:"Amendment",20:"TicketID"},6:{1:"Amount",2:"Balance",3:"LimitAmount",4:"TakerPays",5:"TakerGets",6:"LowLimit",7:"HighLimit",8:"Fee",9:"SendMax",16:"MinimumOffer",17:"JingtumEscrow",18:"DeliveredAmount"},7:{1:"PublicKey",2:"MessageKey",3:"SigningPubKey",4:"TxnSignature",5:"Generator",6:"Signature",7:"Domain",8:"FundCode",9:"RemoveCode",10:"ExpireCode",11:"CreateCode",12:"MemoType",13:"MemoData",14:"MemoFormat",15:"Payload",17:"ContractMethod",18:"Parameter"},8:{1:"Account",2:"Owner",3:"Destination",4:"Issuer",7:"Target",8:"RegularKey"},14:{1:void 0,2:"TransactionMetaData",3:"CreatedNode",4:"DeletedNode",5:"ModifiedNode",6:"PreviousFields",7:"FinalFields",8:"NewFields",9:"TemplateEntry",10:"Memo",11:"Arg"},15:{1:void 0,2:"SigningAccounts",3:"TxnSignatures",4:"Signatures",5:"Template",6:"Necessary",7:"Sufficient",8:"AffectedNodes",9:"Memos",10:"Args"},16:{1:"CloseResolution",2:"TemplateEntryType",3:"TransactionResult"},17:{1:"TakerPaysCurrency",2:"TakerPaysIssuer",3:"TakerGetsCurrency",4:"TakerGetsIssuer"},18:{1:"Paths"},19:{1:"Indexes",2:"Hashes",3:"Amendments"}},p={LedgerEntryType:[1,1],TransactionType:[1,2],Flags:[2,2],SourceTag:[2,3],Sequence:[2,4],PreviousTxnLgrSeq:[2,5],LedgerSequence:[2,6],CloseTime:[2,7],ParentCloseTime:[2,8],SigningTime:[2,9],Expiration:[2,10],TransferRate:[2,11],WalletSize:[2,12],OwnerCount:[2,13],DestinationTag:[2,14],Timestamp:[2,15],HighQualityIn:[2,16],HighQualityOut:[2,17],LowQualityIn:[2,18],LowQualityOut:[2,19],QualityIn:[2,20],QualityOut:[2,21],StampEscrow:[2,22],BondAmount:[2,23],LoadFee:[2,24],OfferSequence:[2,25],FirstLedgerSequence:[2,26],LastLedgerSequence:[2,27],TransactionIndex:[2,28],OperationLimit:[2,29],ReferenceFeeUnits:[2,30],ReserveBase:[2,31],ReserveIncrement:[2,32],SetFlag:[2,33],ClearFlag:[2,34],RelationType:[2,35],Method:[2,36],AppType:[2,37],Contracttype:[2,39],IndexNext:[3,1],IndexPrevious:[3,2],BookNode:[3,3],OwnerNode:[3,4],BaseFee:[3,5],ExchangeRate:[3,6],LowNode:[3,7],HighNode:[3,8],OfferFeeRateNum:[3,9],OfferFeeRateDen:[3,10],EmailHash:[4,1],LedgerHash:[5,1],ParentHash:[5,2],TransactionHash:[5,3],AccountHash:[5,4],PreviousTxnID:[5,5],LedgerIndex:[5,6],WalletLocator:[5,7],RootIndex:[5,8],AccountTxnID:[5,9],BookDirectory:[5,16],InvoiceID:[5,17],Nickname:[5,18],Amendment:[5,19],TicketID:[5,20],Amount:[6,1],Balance:[6,2],LimitAmount:[6,3],TakerPays:[6,4],TakerGets:[6,5],LowLimit:[6,6],HighLimit:[6,7],Fee:[6,8],SendMax:[6,9],MinimumOffer:[6,16],JingtumEscrow:[6,17],DeliveredAmount:[6,18],PublicKey:[7,1],MessageKey:[7,2],SigningPubKey:[7,3],TxnSignature:[7,4],Generator:[7,5],Signature:[7,6],Domain:[7,7],FundCode:[7,8],RemoveCode:[7,9],ExpireCode:[7,10],CreateCode:[7,11],MemoType:[7,12],MemoData:[7,13],MemoFormat:[7,14],Payload:[7,15],ContractMethod:[7,17],Parameter:[7,18],Account:[8,1],Owner:[8,2],Destination:[8,3],Issuer:[8,4],Target:[8,7],RegularKey:[8,8],undefined:[15,1],TransactionMetaData:[14,2],CreatedNode:[14,3],DeletedNode:[14,4],ModifiedNode:[14,5],PreviousFields:[14,6],FinalFields:[14,7],NewFields:[14,8],TemplateEntry:[14,9],Memo:[14,10],Arg:[14,11],SigningAccounts:[15,2],TxnSignatures:[15,3],Signatures:[15,4],Template:[15,5],Necessary:[15,6],Sufficient:[15,7],AffectedNodes:[15,8],Memos:[15,9],Args:[15,10],CloseResolution:[16,1],TemplateEntryType:[16,2],TransactionResult:[16,3],TakerPaysCurrency:[17,1],TakerPaysIssuer:[17,2],TakerGetsCurrency:[17,3],TakerGetsIssuer:[17,4],Paths:[18,1],Indexes:[19,1],Hashes:[19,2],Amendments:[19,3]};function b(t){return"number"==typeof t&&isFinite(t)}function v(t){return"string"==typeof t}function y(t){return t.length%2!=0&&(t+="0"),new a(t,16).toArray(null,t.length/2)}function m(t,e,r){var i=y(e);r||n.serialize_varint(t,i.length),t.append(i)}function g(t){var e,r=unescape(encodeURIComponent(t)),n="";for(e=0;e<r.length;e++)n+=(" 00"+Number(r.charCodeAt(e)).toString(16)).substr(-2);return n.toUpperCase()}function w(t){var e,r="";for(e=0;e<t.length;e+=2){var n="0x"+t.slice(e,e+2);r+=String.fromCharCode(parseInt(n))}return decodeURIComponent(escape(r))}function _(t,e){if(!b(t))throw new Error("Value is not a number",e);if(t<0||t>=Math.pow(256,e))throw new Error("Value out of bounds");for(var r=[],n=0;n<e;n++)r.unshift(t>>>8*n&255);return r}function A(t,e){var r=0;if(4<e)throw new Error("This function only supports up to four bytes.");for(var n=0;n<e;n++)r+=t.read(1)[0]<<8*(e-n-1);return r>>>0}n.serialize_varint=function(t,e){if(e<0)throw new Error("Variable integers are unsigned.");if(e<=192)t.append([e]);else if(e<=12480)e-=193,t.append([193+(e>>>8),255&e]);else{if(!(e<=918744))throw new Error("Variable integer overflow.");e-=12481,t.append([241+(e>>>16),e>>>8&255,255&e])}},n.prototype.parse_varint=function(t){var e,r=t.read(1)[0];if(254<r)throw new Error("Invalid varint length indicator");return r<=192?e=r:r<=240?e=193+256*(r-193)+t.read(1)[0]:r<=254&&(e=12481+65536*(r-241)+256*t.read(1)[0]+t.read(1)[0]),e};var x=e.Int8=new n({serialize:function(t,e){t.append(_(e,1))},parse:function(t){return A(t,1)}});x.id=16,(e.Int16=new n({serialize:function(t,e){t.append(_(e,2))},parse:function(t){return A(t,2)}})).id=1,(e.Int32=new n({serialize:function(t,e){t.append(_(e,4))},parse:function(t){return A(t,4)}})).id=2,(e.Int64=new n({serialize:function(t,e){var r;if(b(e)){if((e=Math.floor(e))<0)throw new Error("Negative value for unsigned Int64 is invalid.");r=new a(e,10).toString(16)}else{if(!v(e))throw new Error("Invalid type for Int64");if(!function(t){return v(t)&&/^[0-9A-F]{0,16}$/i.test(t)}(e))throw new Error("Not a valid hex Int64.");r=e}if(16<r.length)throw new Error("Int64 is too large");for(;r.length<16;)r="0"+r;m(t,r,!0)},parse:function(t){var e=t.read(8),r=new f([0].concat(e),256);return i(r instanceof f),r}})).id=3,(e.Hash128=new n({serialize:function(t,e){if(!(v(e)&&/^[0-9A-F]{0,16}$/i.test(e)&&e.length<=32))throw new Error("Invalid Hash128");m(t,e,!0)},parse:function(t){var e=t.read(16);return Array.isArray(e)&&e.length,NaN}})).id=4;var S=e.Hash256=new n({serialize:function(t,e){if(!(v(e)&&/^[0-9A-F]{0,16}$/i.test(e)&&e.length<=64))throw new Error("Invalid Hash256");m(t,e,!0)},parse:function(){return NaN}});S.id=5;var M=e.Hash160=new n({serialize:function(t,e){m(t,y(e),!0)},parse:function(t){return new s(t._token).convertBytesToAddress(t.read(20))}});M.id=17;var T=new n({from_json_to_bytes:function(t){for(var e=new Array(20),r=0;r<20;r++)e[r]=0;switch(typeof t){case"string":if(function(t){return v(t)&&/^[0-9A-F]+$/i.test(t)}(t)&&40===t.length)e=y(t);else{if(!function(t){return v(t)&&/^[A-Z0-9]{3}$/.test(t)}(t))throw new Error("Input tum code not valid!");var n=t;if(3<=n.length&&n.length<=6)for(var i=n.length-1,o=i;0<=o;o--)e[14-o]=255&n.charCodeAt(i-o)}break;case"number":case"object":throw new Error("Input tum code not valid!")}return e},serialize:function(t,e){var r=e.to_bytes();if(!r)throw new Error("Tried to serialize invalid/unimplemented currency type.");t.append(r)},from_bytes:function(t){return Array.isArray(t)&&20===t.length?new f([0].concat(t),256):NaN},parse:function(t){var e=t.read(20);return this.from_bytes(e)}});function E(t){var e;switch(typeof t){case"number":switch(t){case 0:e="Payment";break;case 3:e="AccountSet";break;case 5:e="SetRegularKey";break;case 7:e="OfferCreate";break;case 8:e="OfferCancel";break;case 9:e="Contract";break;case 10:e="RemoveContract";break;case 20:e="TrustSet";break;case 21:e="RelationSet";break;case 22:e="RelationDel";break;case 30:e="ConfigContract";break;case 100:e="EnableFeature";break;case 101:e="SetFee";break;default:throw new Error("Invalid transaction type!")}break;case"string":switch(t){case"Payment":e=0;break;case"AccountSet":e=3;break;case"SetRegularKey":e=5;break;case"OfferCreate":e=7;break;case"OfferCancel":e=8;break;case"Contract":e=9;break;case"RemoveContract":e=10;break;case"TrustSet":e=20;break;case"RelationSet":e=21;break;case"RelationDel":e=22;break;case"ConfigContract":e=30;break;case"EnableFeature":e=100;break;case"SetFee":e=101;break;default:throw new Error("Invalid transaction type!")}break;default:throw new Error("Invalid input type for transaction type!")}return e}function j(t){var e;switch(typeof t){case"number":switch(t){case 97:e="AccountRoot";break;case 99:e="Contract";break;case 100:e="DirectoryNode";break;case 102:e="EnabledFeatures";break;case 115:e="FeeSettings";break;case 103:e="GeneratorMap";break;case 104:e="LedgerHashes";break;case 110:e="Nickname";break;case 111:e="Offer";break;case 114:e="SkywellState";break;default:throw new Error("Invalid input type for ransaction result!")}break;case"string":switch(t){case"AccountRoot":e=97;break;case"Contract":e=99;break;case"DirectoryNode":e=100;break;case"EnabledFeatures":e=102;break;case"FeeSettings":e=115;break;case"GeneratorMap":e=103;break;case"LedgerHashes":e=104;break;case"Nickname":e=110;break;case"Offer":e=111;break;case"SkywellState":e=114;break;default:e=0}break;default:e="UndefinedLedgerEntry"}return e}function k(t,r,n){var i,o=p[r],s=o[0],a=o[1],f=(s<16?s<<4:0)|(a<16?a:0);"string"==typeof n&&("LedgerEntryType"===r?n=j(n):"TransactionResult"===r&&(n=E(n))),x.serialize(t,f),16<=s&&x.serialize(t,s),16<=a&&x.serialize(t,a),i="Memo"===r&&"object"==typeof n?e.STMemo:e[d[s]];try{i.serialize(t,n)}catch(t){throw t.message+=" ("+r+")",t}}function O(t){var r=t.read(1)[0],n=r>>4;0===n&&(n=t.read(1)[0]);var o=15&r,s=0==o?l[n][t.read(1)[0]]:l[n][o];i(s,"Unknown field - header byte is 0x"+r.toString(16));var a="Memo"===s?e.STMemo:e[d[n]];return i(a,"Unknown type - header byte is 0x"+r.toString(16)),[s,a.parse(t)]}function I(t){return t.sort(function(t,e){var r=p[t],n=r[0],i=r[1],o=p[e],s=o[0],a=o[1];return n!==s?n-s:i-a})}(e.Amount=new n({serialize:function(t,e){var r=h.from_json(e,t._token);if(!r.is_valid())throw new Error("Not a valid Amount object.");var n=c(8,0);if(r.is_native()){var i=new a(r._value,10).toString(16);if(16<i.length)throw new Error("Amount Value out of bounds");for(;i.length<16;)i="0"+i;(n=y(i))[0]&=63,r.is_negative()||(n[0]|=64),t.append(n)}else{var o=0,f=0;o|=1<<31,r.is_zero()||(r.is_negative()||(o|=1<<30),o|=(97+r._offset&255)<<22,o|=4194303&r._value.shrn(32).toNumber(),f=4294967295&r._value.toNumber());var u,d,l,p,b=[o,f],v=b.length;d=0===v?0:(u=b[v-1],32*(v-1)+(Math.round(u/1099511627776)||32));var m=[];for(l=0;l<d/8;l++)0==(3&l)&&(p=b[l/4]),m.push(p>>>24),p<<=8;if(8<m.length)throw new Error("Invalid byte array length in AMOUNT value representation");n=m,t.append(n);var g=r.tum_to_bytes();t.append(g);var w=new s(t._token);t.append(w.convertAddressToBytes(r.issuer()))}},parse:function(t){for(var e=new h(t._token),r=t.read(8),n=!(127&r[0]),i=1;i<8;i++)n=n&&!r[i];if(128&r[0]){var o=T.parse(t),a=t.read(20),u=new s(t._token).convertBytesToAddress(a),c=((63&r[0])<<2)+(r[1]>>>6)-97,d=r.slice(1);d[0]&=63;var l=new f(d,256);if(l.equals(f.ZERO)&&!n)throw new Error("Invalid zero representation");e._value=l,e._offset=c,e._currency=o,e._issuer=u,e._is_native=!1}else{var p=r.slice();p[0]&=63,e._value=new f(p,256),e._is_native=!0}return e._is_negative=!(n||64&r[0]),e}})).id=6,(e.VariableLength=e.VL=new n({serialize:function(t,e){if("string"!=typeof e)throw new Error("Unknown datatype.");m(t,e)},parse:function(t){var e=this.parse_varint(t);return function(t){return t.map(function(t){var e=t.toString(16).toUpperCase();return 1<e.length?e:"0"+e}).join("")}(t.read(e))}})).id=7,(e.Account=new n({serialize:function(t,e){var r=new s(t._token).convertAddressToBytes(e);n.serialize_varint(t,r.length),t.append(r)},parse:function(t){var e=this.parse_varint(t);if(20!==e)throw new Error("Non-standard-length account ID");return new s(t._token).convertBytesToAddress(t.read(e))}})).id=8,(e.PathSet=new n({typeBoundary:255,typeEnd:0,typeAccount:1,typeCurrency:16,typeIssuer:32,serialize:function(t,e){for(var r=new s(t._token),n=0,i=e.length;n<i;n++){n&&x.serialize(t,this.typeBoundary);for(var o=0,a=e[n].length;o<a;o++){var f=e[n][o],u=0;if(f.account&&(u|=this.typeAccount),f.currency&&(u|=this.typeCurrency),f.issuer&&(u|=this.typeIssuer),x.serialize(t,u),f.account&&t.append(r.convertAddressToBytes(f.account)),f.currency){var c=T.from_json_to_bytes(f.currency,f.non_native);t.append(c)}f.issuer&&t.append(r.convertAddressToBytes(f.issuer))}}x.serialize(t,this.typeEnd)},parse:function(t){for(var e,r=[],n=[];(e=t.read(1)[0])!==this.typeEnd;)if(e!==this.typeBoundary){var i={};if(e&this.typeAccount&&(i.account=M.parse(t)),e&this.typeCurrency&&(i.currency=T.parse(t),"SWT"!==i.currency.to_json()||i.currency.is_native()||(i.non_native=!0)),e&this.typeIssuer&&(i.issuer=M.parse(t)),!(i.account||i.currency||i.issuer))throw new Error("Invalid path entry");n.push(i)}else n&&r.push(n),n=[];return n&&r.push(n),r}})).id=18,(e.Vector256=new n({serialize:function(t,e){for(var r=0,n=e.length;r<n;r++)S.serialize(t,e[r])},parse:function(t){for(var e=this.parse_varint(t),r=[],n=0;n<e/32;n++)r.push(S.parse(t));return r}})).id=19,e.STMemo=new n({serialize:function(t,e,r){var n=[];Object.keys(e).forEach(function(t){if(t[0]!==t[0].toLowerCase()){if(void 0===p[t])throw new Error('JSON contains unknown field: "'+t+'"');n.push(t)}}),n=I(n);for(var i="json"===e.MemoFormat,o=0;o<n.length;o++){var s=n[o],a=e[s];switch(s){case"MemoType":case"MemoFormat":a=g(a);break;case"MemoData":if("string"!=typeof a){if(!i)throw new Error("MemoData can only be a JSON object with a valid json MemoFormat");try{a=g(JSON.stringify(a))}catch(t){throw new Error("MemoFormat json with invalid JSON in MemoData field")}}else v(a)&&(a=g(a))}k(t,s,a)}r||x.serialize(t,225)},parse:function(t){for(var e={};225!==t.peek(1)[0];){var r=O(t);e[r[0]]=r[1]}if(void 0!==e.MemoType&&(e.parsed_memo_type=w(e.MemoType)),void 0!==e.MemoFormat&&(e.parsed_memo_format=w(e.MemoFormat)),void 0!==e.MemoData)if("json"===e.parsed_memo_format)try{e.parsed_memo_data=JSON.parse(w(e.MemoData))}catch(t){}else"text"===e.parsed_memo_format&&(e.parsed_memo_data=w(e.MemoData));return t.read(1),e}}),e.serialize=e.serialize_whatever=k,e.get_transaction_type=E,e.get_transaction_result=function(t){var e;switch(typeof t){case"number":switch(t){case 0:e="tesSUCCESS";break;case 100:e="tecCLAIM";break;case 101:e="tecPATH_PARTIAL";break;case 102:e="tecUNFUNDED_ADD";break;case 103:e="tecUNFUNDED_OFFER";break;case 104:e="tecUNFUNDED_PAYMENT";break;case 105:e="tecFAILED_PROCESSING";break;case 121:e="tecDIR_FULL";break;case 122:e="tecINSUF_RESERVE_LINE";break;case 141:e="tecINSUFFICIENT_RESERVE";break;default:throw new Error("Invalid transaction result!")}break;case"string":switch(t){case"tesSUCCESS":e=0;break;case"tecCLAIM":e=100;break;case"tecPATH_PARTIAL":e=101;break;case"tecUNFUNDED_ADD":e=102;break;case"tecUNFUNDED_OFFER":e=103;break;case"tecUNFUNDED_PAYMENT":e=104;break;case"tecFAILED_PROCESSING":e=105;break;case"tecDIR_FULL":e=121;break;case"tecINSUF_RESERVE_LINE":e=122;break;case"tecINSUFFICIENT_RESERVE":e=141;break;default:throw new Error("Invalid transaction result!")}break;default:throw new Error("Invalid input type for transaction result!")}return e},e.get_ledger_entry_type=j,e.parse=e.parse_whatever=O,(e.Object=new n({serialize:function(t,e,r){var n=[];Object.keys(e).forEach(function(t){if(t[0]!==t[0].toLowerCase()){if(void 0===p[t])throw new Error('JSON contains unknown field: "'+t+'"');n.push(t)}}),n=I(n);for(var i=0;i<n.length;i++)k(t,n[i],e[n[i]]);r||x.serialize(t,225)},parse:function(t){for(var e={};225!==t.peek(1)[0];){var r=O(t);e[r[0]]=r[1]}return t.read(1),e}})).id=14,(e.Array=new n({serialize:function(t,e){for(var r=0,n=e.length;r<n;r++){var i=Object.keys(e[r]);if(1!==i.length)throw Error("Cannot serialize an array containing non-single-key objects");var o=i[0];k(t,o,e[r][o])}x.serialize(t,241)},parse:function(t){for(var e=[];241!==t.peek(1)[0];){var r=O(t),n={};n[r[0]]=r[1],e.push(n)}return t.read(1),e}})).id=15},function(t,e){},function(t,e,r){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function n(){return new r(null)}var i="undefined"!=typeof navigator;e=i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;0<=--o;){var f=32767&this[t],u=this[t++]>>15,c=a*f+u*s;i=((f=s*f+((32767&c)<<15)+r[n]+(1073741823&i))>>>30)+(c>>>15)+a*u+(i>>>30),r[n++]=1073741823&f}return i},30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(;0<=--o;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},26):(r.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;0<=--o;){var f=16383&this[t],u=this[t++]>>14,c=a*f+u*s;i=((f=s*f+((16383&c)<<14)+r[n]+i)>>28)+(c>>14)+a*u,r[n++]=268435455&f}return i},28),r.prototype.DB=e,r.prototype.DM=(1<<e)-1,r.prototype.DV=1<<e,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-e,r.prototype.F2=2*e-52;var o,s,a="0123456789abcdefghijklmnopqrstuvwxyz",f=new Array;for(o="0".charCodeAt(0),s=0;s<=9;++s)f[o++]=s;for(o="a".charCodeAt(0),s=10;s<36;++s)f[o++]=s;for(o="A".charCodeAt(0),s=10;s<36;++s)f[o++]=s;function u(t){return a.charAt(t)}function c(t,e){var r=f[t.charCodeAt(e)];return null==r?-1:r}function h(t){var e=n();return e.fromInt(t),e}function d(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function l(t){this.m=t}function p(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function b(t,e){return t&e}function v(t,e){return t|e}function y(t,e){return t^e}function m(t,e){return t&~e}function g(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function w(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function _(){}function A(t){return t}function x(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||0<=t.compareTo(this.m)?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},l.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},p.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&0<e.compareTo(r.ZERO)&&this.m.subTo(e,e),e},p.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},p.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),0<=t.compareTo(this.m)&&t.subTo(this.m,t)},p.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},p.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;0<=e;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,0<t?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;0<=--i;){var a=8==n?255&t[i]:c(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,0<s&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),o&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;0<this.t&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;0<=r;--r)e[r+t]=this[r];for(r=t-1;0<=r;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,o=(1<<i)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;0<=r;--r)e[r+s+1]=this[r]>>i|a,a=(this[r]&o)<<n;for(r=s-1;0<=r;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&o)<<i,e[s-r]=this[s]>>n;0<n&&(e[this.t-r-1]|=(this.s&o)<<i),e.t=this.t-r,e.clamp()}},r.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:0<n&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;0<=--o;)e[o]=0;for(o=0;o<i.t;++o)e[o+n.t]=n.am(0,i[o],e,o,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;0<=--r;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}0<t.t&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t<o.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=n());var a=n(),f=this.s,u=t.s,c=this.DB-d(o[o.t-1]);0<c?(o.lShiftTo(c,a),s.lShiftTo(c,i)):(o.copyTo(a),s.copyTo(i));var h=a.t,l=a[h-1];if(0!=l){var p=l*(1<<this.F1)+(1<h?a[h-2]>>this.F2:0),b=this.FV/p,v=(1<<this.F1)/p,y=1<<this.F2,m=i.t,g=m-h,w=null==e?n():e;for(a.dlShiftTo(g,w),0<=i.compareTo(w)&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t<h;)a[a.t++]=0;for(;0<=--g;){var _=i[--m]==l?this.DM:Math.floor(i[m]*b+(i[m-1]+y)*v);if((i[m]+=a.am(0,_,i,g,0,h))<_)for(a.dlShiftTo(g,w),i.subTo(w,i);i[m]<--_;)i.subTo(w,i)}null!=e&&(i.drShiftTo(h,e),f!=u&&r.ZERO.subTo(e,e)),i.t=h,i.clamp(),0<c&&i.rShiftTo(c,i),f<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return 0<(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)?this.DV-e:-e},r.prototype.isEven=function(){return 0==(0<this.t?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(4294967295<t||t<1)return r.ONE;var i=n(),o=n(),s=e.convert(this),a=d(t)-1;for(s.copyTo(i);0<=--a;)if(e.sqrTo(i,o),0<(t&1<<a))e.mulTo(o,s,i);else{var f=i;i=o,o=f}return e.revert(i)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%e;if(0<s--)for(a<this.DB&&0<(r=this[s]>>a)&&(i=!0,o=u(r));0<=s;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),0<r&&(i=!0),i&&(o+=u(r));return i?o:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;0<=--r;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&0<e.compareTo(r.ZERO)&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new l(e):new p(e),this.exp(t,r)},r.ZERO=h(0),r.ONE=h(1),_.prototype.convert=A,_.prototype.revert=A,_.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},_.prototype.sqrTo=function(t,e){t.squareTo(e)},x.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},x.prototype.revert=function(t){return t},x.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);0<=t.compareTo(this.m);)t.subTo(this.m,t)},x.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},x.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var S,M,T,E=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],j=(1<<26)/E[E.length-1];function k(){!function(t){M[T++]^=255&t,M[T++]^=t>>8&255,M[T++]^=t>>16&255,M[T++]^=t>>24&255,L<=T&&(T-=L)}((new Date).getTime())}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||36<t)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=h(r),o=n(),s=n(),a="";for(this.divRemTo(i,o,s);0<o.signum();)a=(r+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,s=0,a=0,f=0;f<t.length;++f){var u=c(t,f);u<0?"-"==t.charAt(f)&&0==this.signum()&&(o=!0):(a=e*a+u,++s>=n&&(this.dMultiply(i),this.dAddOffset(a,0),a=s=0))}0<s&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),0<o?i[0]&=(1<<o)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(t,e,r){var n,i,o=Math.min(t.t,this.t);for(n=0;n<o;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(i=t.s&this.DM,n=o;n<this.t;++n)r[n]=e(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,0<n?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;0<i;)r[--i]=0;for(n=r.t-this.t;i<n;++i)r[i+this.t]=this.am(0,t[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t[i],r,i,0,e-i);r.clamp()},r.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;0<=--n;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(0<this.t)if(0==e)r=this[0]%t;else for(var n=this.t-1;0<=n;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);E.length<(t=t+1>>1)&&(t=E.length);for(var s=n(),a=0;a<t;++a){s.fromInt(E[Math.floor(Math.random()*E.length)]);var f=s.modPow(o,this);if(0!=f.compareTo(r.ONE)&&0!=f.compareTo(e)){for(var u=1;u++<i&&0!=f.compareTo(e);)if(0==(f=f.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=f.compareTo(e))return!1}}return!0},r.prototype.clone=function(){var t=n();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(0<t--)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);0<=t;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(0<i||r!=this.s)&&(e[i++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return 0<this.compareTo(t)?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,b,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,v,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,y,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.not=function(){for(var t=n(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=n();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=n();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+g(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=w(this[r]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},r.prototype.setBit=function(t){return this.changeBit(t,v)},r.prototype.clearBit=function(t){return this.changeBit(t,m)},r.prototype.flipBit=function(t){return this.changeBit(t,y)},r.prototype.add=function(t){var e=n();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=n();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=n();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=n();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=n();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=n(),r=n();return this.divRemTo(t,e,r),new Array(e,r)},r.prototype.modPow=function(t,e){var r,i,o=t.bitLength(),s=h(1);if(o<=0)return s;r=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new l(e):e.isEven()?new x(e):new p(e);var a=new Array,f=3,u=r-1,c=(1<<r)-1;if(a[1]=i.convert(this),1<r){var b=n();for(i.sqrTo(a[1],b);f<=c;)a[f]=n(),i.mulTo(b,a[f-2],a[f]),f+=2}var v,y,m=t.t-1,g=!0,w=n();for(o=d(t[m])-1;0<=m;){for(u<=o?v=t[m]>>o-u&c:(v=(t[m]&(1<<o+1)-1)<<u-o,0<m&&(v|=t[m-1]>>this.DB+o-u)),f=r;0==(1&v);)v>>=1,--f;if((o-=f)<0&&(o+=this.DB,--m),g)a[v].copyTo(s),g=!1;else{for(;1<f;)i.sqrTo(s,w),i.sqrTo(w,s),f-=2;0<f?i.sqrTo(s,w):(y=s,s=w,w=y),i.mulTo(w,a[v],s)}for(;0<=m&&0==(t[m]&1<<o);)i.sqrTo(s,w),y=s,s=w,w=y,--o<0&&(o=this.DB-1,--m)}return i.revert(s)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return r.ZERO;for(var n=t.clone(),i=this.clone(),o=h(1),s=h(0),a=h(0),f=h(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(o.isEven()&&s.isEven()||(o.addTo(this,o),s.subTo(t,s)),o.rShiftTo(1,o)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;i.isEven();)i.rShiftTo(1,i),e?(a.isEven()&&f.isEven()||(a.addTo(this,a),f.subTo(t,f)),a.rShiftTo(1,a)):f.isEven()||f.subTo(t,f),f.rShiftTo(1,f);0<=n.compareTo(i)?(n.subTo(i,n),e&&o.subTo(a,o),s.subTo(f,s)):(i.subTo(n,i),e&&a.subTo(o,a),f.subTo(s,f))}return 0!=i.compareTo(r.ONE)?r.ZERO:0<=f.compareTo(t)?f.subtract(t):f.signum()<0?(f.addTo(t,f),f.signum()<0?f.add(t):f):f},r.prototype.pow=function(t){return this.exp(t,new _)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),0<o&&(e.rShiftTo(o,e),r.rShiftTo(o,r));0<e.signum();)0<(i=e.getLowestSetBit())&&e.rShiftTo(i,e),0<(i=r.getLowestSetBit())&&r.rShiftTo(i,r),0<=e.compareTo(r)?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return 0<o&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=E[E.length-1]){for(e=0;e<E.length;++e)if(r[0]==E[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<E.length;){for(var n=E[e],i=e+1;i<E.length&&n<j;)n*=E[i++];for(n=r.modInt(n);e<i;)if(n%E[e++]==0)return!1}return r.millerRabin(t)},r.prototype.square=function(){var t=n();return this.squareTo(t),t},r.prototype.Barrett=x,null==M){var O;if(M=new Array,T=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var I=new Uint8Array(32);for(window.crypto.getRandomValues(I),O=0;O<32;++O)M[T++]=I[O]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var R=window.crypto.random(32);for(O=0;O<R.length;++O)M[T++]=255&R.charCodeAt(O)}for(;T<L;)O=Math.floor(65536*Math.random()),M[T++]=O>>>8,M[T++]=255&O;T=0,k()}function N(){if(null==S){for(k(),(S=new C).init(M),T=0;T<M.length;++T)M[T]=0;T=0}return S.next()}function P(){}function C(){this.i=0,this.j=0,this.S=new Array}P.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=N()},C.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(e=r=0;e<256;++e)r=r+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[r],this.S[r]=n;this.i=0,this.j=0},C.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var L=256;t.exports={default:r,BigInteger:r,SecureRandom:P}}).call(this)},function(t,e,r){var n=r(14),i=r(6).Wallet,o=r(58),s=r(27),a=r(169).isTumCode;function f(t){this._value=new o,this._offset=0,this._is_native=!0,this._is_negative=!1,this._currency=null,this._issuer=null,this._token=t||"swt"}n(f,{currency_xns:0,currency_one:1,xns_precision:6,bi_5:5,bi_7:7,bi_10:10,bi_1e14:1e14,bi_1e16:1e16,bi_1e17:1e17,bi_1e32:1e32,bi_man_max_value:1e16,bi_man_min_value:1e15,bi_xns_max:9e18,bi_xns_min:-9e18,bi_xns_unit:1e6,cMinOffset:-96,cMaxOffset:80,max_value:"9999999999999999e80",min_value:"-1000000000000000e-96"}),f.from_json=function(t,e){return new f(e=e||"swt").parse_json(t)},f.prototype.is_valid=function(){return!0},f.prototype.currency=function(){return this._currency},f.prototype.is_native=function(){return this._is_native},f.prototype.is_negative=function(){return this._is_negative},f.prototype.is_positive=function(){return!this.is_zero()&&!this.is_negative()},f.prototype.is_zero=function(){return this._value.isZero()},f.prototype.issuer=function(){return this._issuer},f.prototype.parse_issuer=function(t){return i.isValidAddress(t,this._token)&&(this._issuer=t),this},f.prototype.parse_json=function(t){if("number"==typeof t)this.parse_swt_value(t.toString());else if("string"==typeof t)this.parse_swt_value(t);else{if("object"!=typeof t)throw new Error("Amount.parse_json: Unsupported JSON type!");if(!a(t.currency))throw new Error("Amount.parse_json: Input JSON has invalid Tum info!");if("SWT"!==t.currency){if(this._currency=t.currency,this._is_native=!1,void 0===t.issuer||null===t.issuer)throw new Error("Amount.parse_json: Input JSON has invalid issuer info!");if(!i.isValidAddress(t.issuer,this._token))throw new Error("Amount.parse_json: Input JSON has invalid issuer info!");this._issuer=t.issuer;var e=Number(t.value);e=String(e.toExponential());var r=15-(e=Number(e.substr(e.lastIndexOf("e")+1))),n=Math.pow(10,r),f=new s(t.value).mul(n).toString();this._value=new o(f,10),this._offset=-1*r}else this.parse_swt_value(t.value.toString())}return this},f.prototype.parse_swt_value=function(t){var e;return"string"==typeof t&&(e=t.match(/^(-?)(\d*)(\.\d{0,6})?$/)),e?(void 0===e[3]?this._value=1e6*e[2]:this._value=1e6*(e[2]+e[3]),this._is_native=!0,this._offset=0,this._is_negative=!!e[1]&&0!==this._value,this._value>f.bi_xns_max&&(this._value=NaN)):this._value=NaN,this},f.prototype.parse_tum_value=function(t){switch(this._is_native=!1,typeof t){case"number":this._is_negative=t<0,this._value=new o(Math.abs(t)),this._offset=0;break;case"string":var e=t.match(/^(-?)(\d+)$/),r=!e&&t.match(/^(-?)(\d*)\.(\d*)$/),n=!r&&t.match(/^(-?)(\d*)e(-?\d+)$/);if(n)this._value=n[2],this._offset=parseInt(n[3]),this._is_negative=!!n[1];else if(r){var i=r[3].length;this._value=this._offset=-i,this._is_negative=!!r[1]}else e?(this._value=e[2],this._offset=0,this._is_negative=!!e[1]):this._value=NaN;break;default:this._value=NaN}return this},f.prototype.to_json=function(){var t;if(this._is_native)t=this.to_text();else{var e={value:this._value,currency:this._currency};this.is_valid()&&(e.issuer=this._issuer),t=e}return t},f.prototype.tum_to_bytes=function(){for(var t=new Array(20),e=0;e<20;e++)t[e]=0;if(3<=this._currency.length&&this._currency.length<=6)for(var r=this._currency,n=r.length-1,i=n;0<=i;i--)t[14-i]=255&r.charCodeAt(n-i);else{if(40!==this._currency.length)throw new Error("Incorrect currency code length.");if(!/^[0-9A-F]/i.test(this._currency))throw new Error("Invalid currency code.");t=new o(this._currency,16).toArray(null,20)}return t},e.Amount=f},function(t,e,r){var n=3,i=6,o=40,s=r(6).Wallet;function a(t){return!(!/^-?\d+(?:[.,]\d*?)?$/.test(t)||Number.isNaN(parseFloat(t)))}function f(t){return!!String(t).match(/^[0-9A-Z]+$/)}function u(t){return"string"==typeof t&&!!t&&t.length>=n&&t.length<=i}function c(t){return f(t)&&String(t).length===o}function h(t){return"string"==typeof t&&("SWT"===t||u(t)||c(t))}e.isCustomTum=c,e.allNumeric=function(t){return!!String(t).match(/^[0-9]+$/)},e.isRelation=function(t){return"string"==typeof t&&("freeze"===t||"autorize"===t)},e.isTumCode=h,e.isCurrency=u,e.isAmount=function(t,e){if(null===t||"object"!=typeof t)return!1;if("string"!=typeof t.value||!a(t.value))return!1;if(!h(t.currency))return!1;if(void 0!==t.issuer&&""!==t.issuer){if(!s.isValidAddress(t.issuer,e))return!1}else{if("SWT"!==t.currency)return!1;t.issuer=""}return!0},e.isBalance=function(t,e){return!!(null!==t&&"object"==typeof t&&a(t.freezed)&&a(t.value)&&h(t.currency)&&s.isValidAddress(t.counterparty,e))},e.isLetterNumer=f},function(t,e,r){var n=r(16),i=r(20);t.exports=function(t){return"number"==typeof t||i(t)&&"[object Number]"==n(t)}},function(t,e,r){"use strict";function n(t,e,r,n){t[s]=t[s]||{},t[s][e]=t[s][e]||{},t[s][e].params=t[s][e].params||[],t[s][e].params[r]=n}Object.defineProperty(e,"__esModule",{value:!0});var i=r(28),o=r(60),s=Symbol(),a=Symbol(),f=Symbol(),u=Symbol(),c=Symbol();e.isValidBizainAddress=function(t,e,r){n(t,e,r,a)},e.isValidBizainSecret=function(t,e,r){n(t,e,r,u)},e.isValidMemo=function(t,e,r){n(t,e,r,f)},e.isValidAmount=function(t,e,r){n(t,e,r,c)},e.validate=function(t,e,r){var n=r.value;r.value=function(){var r=t[s][e].params;if(Array.isArray(r))for(var h=r.length,d=0;d<h;d++){var l=r[d],p=arguments[d];switch(l){case a:if(!o.isValidAddress(p,"bwt"))throw new Error(p+" is invalid bizain address.");break;case u:if(!o.isValidSecret(p,"bwt"))throw new Error(p+" is invalid bizain secret.");break;case c:var b=new i.default(p);if(!i.default.isBigNumber(b)||!b.isGreaterThan(0))throw new Error(p+" is invalid amount.");break;case f:if(!o.isValidAddress(p.jtaddress))throw new Error(p.jtaddress+" is invalid jingtum address in memo.")}}return n.apply(this,arguments)}}}],t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(t){return e[t]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=61);function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var e,r});