diff --git a/build/js/index.js b/build/js/index.js index 043892d..897b70e 100644 --- a/build/js/index.js +++ b/build/js/index.js @@ -1,2 +1,2 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/Users/evanmarshall/Documents/dlive/steem-dev/build",r(r.s=397)}([function(t,e,r){"use strict";(function(t){var n=r(311),i=r(310),o=r(138);function a(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().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 U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return N(t).length;default:if(n)return U(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):r>2147483647?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,a=1,s=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=2,s/=2,f/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-f),o=r;o>=0;o--){for(var h=!0,l=0;li&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+h<=r)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&u)<<6|63&o)>127&&(c=f);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(f=(15&u)<<12|(63&o)<<6|63&a)>2047&&(f<55296||f>57343)&&(c=f);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(f=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&f<1114112&&(c=f)}null===c?(c=65533,h=1):c>65535&&(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);var r="",n=0;for(;nthis.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 T(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return B(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(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 this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(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(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,s=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),h=0;hi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return E(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function R(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,o){return o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,o){return o||P(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,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return e||j(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||j(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||j(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||j(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||j(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||j(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||j(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},f.prototype.readInt8=function(t,e){return e||j(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||j(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||j(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||j(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||j(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||j(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||j(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||j(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||j(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)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(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||C(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(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):R(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(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):R(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);C(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&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);C(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(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||C(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(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):R(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(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):R(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return F(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),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function N(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(5))},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){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e,r){var n=r(0),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},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){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(251).Buffer}catch(t){}function s(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var 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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,f=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,h=67108863&f,l=Math.min(u,e.length-1),d=Math.max(0,u-t.length+1);d<=l;d++){var p=u-d|0;c+=(a=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&a}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(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],d=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?b+r:u[l-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]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,f="le"===e,u=new t(o),c=this.clone();if(f){for(s=0;!c.isZero();s++)a=c.andln(255),c.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,v=0|a[2],y=8191&v,m=v>>>13,g=0|a[3],_=8191&g,w=g>>>13,E=0|a[4],S=8191&E,k=E>>>13,x=0|a[5],A=8191&x,B=x>>>13,M=0|a[6],T=8191&M,I=M>>>13,j=0|a[7],C=8191&j,O=j>>>13,R=0|a[8],P=8191&R,L=R>>>13,F=0|a[9],D=8191&F,q=F>>>13,U=0|s[0],N=8191&U,z=U>>>13,H=0|s[1],V=8191&H,K=H>>>13,W=0|s[2],G=8191&W,Y=W>>>13,X=0|s[3],Z=8191&X,J=X>>>13,$=0|s[4],Q=8191&$,tt=$>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ft=8191&st,ut=st>>>13,ct=0|s[8],ht=8191&ct,lt=ct>>>13,dt=0|s[9],pt=8191&dt,bt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(u+(n=Math.imul(h,N))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(l,N)|0))<<13)|0;u=((o=Math.imul(l,z))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,N),i=(i=Math.imul(p,z))+Math.imul(b,N)|0,o=Math.imul(b,z);var yt=(u+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(l,V)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,N),i=(i=Math.imul(y,z))+Math.imul(m,N)|0,o=Math.imul(m,z),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(b,V)|0,o=o+Math.imul(b,K)|0;var mt=(u+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(l,G)|0))<<13)|0;u=((o=o+Math.imul(l,Y)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(_,N),i=(i=Math.imul(_,z))+Math.imul(w,N)|0,o=Math.imul(w,z),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,K)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,Y)|0;var gt=(u+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,J)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(S,N),i=(i=Math.imul(S,z))+Math.imul(k,N)|0,o=Math.imul(k,z),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,K)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,J)|0;var _t=(u+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(l,Q)|0))<<13)|0;u=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(A,N),i=(i=Math.imul(A,z))+Math.imul(B,N)|0,o=Math.imul(B,z),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Y)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,J)|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 wt=(u+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(l,rt)|0))<<13)|0;u=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,N),i=(i=Math.imul(T,z))+Math.imul(I,N)|0,o=Math.imul(I,z),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,J)|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 Et=(u+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,at)|0)+Math.imul(l,ot)|0))<<13)|0;u=((o=o+Math.imul(l,at)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,N),i=(i=Math.imul(C,z))+Math.imul(O,N)|0,o=Math.imul(O,z),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,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,at)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,at)|0;var St=(u+(n=n+Math.imul(h,ft)|0)|0)+((8191&(i=(i=i+Math.imul(h,ut)|0)+Math.imul(l,ft)|0))<<13)|0;u=((o=o+Math.imul(l,ut)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(P,N),i=(i=Math.imul(P,z))+Math.imul(L,N)|0,o=Math.imul(L,z),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|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 kt=(u+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,lt)|0)+Math.imul(l,ht)|0))<<13)|0;u=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(D,N),i=(i=Math.imul(D,z))+Math.imul(q,N)|0,o=Math.imul(q,z),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|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,lt)|0)+Math.imul(b,ht)|0,o=o+Math.imul(b,lt)|0;var xt=(u+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(l,pt)|0))<<13)|0;u=((o=o+Math.imul(l,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,K))+Math.imul(q,V)|0,o=Math.imul(q,K),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(_,ft)|0,i=(i=i+Math.imul(_,ut)|0)+Math.imul(w,ft)|0,o=o+Math.imul(w,ut)|0,n=n+Math.imul(y,ht)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,lt)|0;var At=(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)+(At>>>26)|0,At&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,Y))+Math.imul(q,G)|0,o=Math.imul(q,Y),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,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(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,ut)|0)+Math.imul(k,ft)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(_,ht)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(w,ht)|0,o=o+Math.imul(w,lt)|0;var Bt=(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)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,J))+Math.imul(q,Z)|0,o=Math.imul(q,J),n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,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,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,ut)|0)+Math.imul(B,ft)|0,o=o+Math.imul(B,ut)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(k,ht)|0,o=o+Math.imul(k,lt)|0;var Mt=(u+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,bt)|0)+Math.imul(w,pt)|0))<<13)|0;u=((o=o+Math.imul(w,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=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(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(I,ft)|0,o=o+Math.imul(I,ut)|0,n=n+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(B,ht)|0,o=o+Math.imul(B,lt)|0;var Tt=(u+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,bt)|0)+Math.imul(k,pt)|0))<<13)|0;u=((o=o+Math.imul(k,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=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(P,ot)|0,i=(i=i+Math.imul(P,at)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,at)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,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,lt)|0)+Math.imul(I,ht)|0,o=o+Math.imul(I,lt)|0;var It=(u+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(B,pt)|0))<<13)|0;u=((o=o+Math.imul(B,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(q,ot)|0,o=Math.imul(q,at),n=n+Math.imul(P,ft)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(L,ft)|0,o=o+Math.imul(L,ut)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,lt)|0;var jt=(u+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,bt)|0)+Math.imul(I,pt)|0))<<13)|0;u=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=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(P,ht)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(L,ht)|0,o=o+Math.imul(L,lt)|0;var Ct=(u+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(O,pt)|0))<<13)|0;u=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(D,ht),i=(i=Math.imul(D,lt))+Math.imul(q,ht)|0,o=Math.imul(q,lt);var Ot=(u+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,bt)|0)+Math.imul(L,pt)|0))<<13)|0;u=((o=o+Math.imul(L,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Rt=(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)+(Rt>>>26)|0,Rt&=67108863,f[0]=vt,f[1]=yt,f[2]=mt,f[3]=gt,f[4]=_t,f[5]=wt,f[6]=Et,f[7]=St,f[8]=kt,f[9]=xt,f[10]=At,f[11]=Bt,f[12]=Mt,f[13]=Tt,f[14]=It,f[15]=jt,f[16]=Ct,f[17]=Ot,f[18]=Rt,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||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(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>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=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>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==c||u>=i);u--){var h=0|this.words[u];this.words[u]=c<<26-o|h>>>o,c=h&s}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&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(f/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,f=n.length-i.length;if("mod"!==e){(s=new o(null)).length=f+1,s.words=new Array(s.length);for(var u=0;u=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=l)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||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?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):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,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=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 l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(c),f.isub(h)),s.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(f)):(r.isub(e),s.isub(i),f.isub(a))}return{a:s,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,a=new o(1),s=new o(0),f=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0==(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(f),a.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var 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 _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(m,y),m.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},m.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(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 _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return v[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),f=s.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),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var b=d,v=0;0!==b.cmp(s);v++)b=b.redSqr();n(v=0;n--){for(var u=e.words[n],c=f-1;c>=0;c--){var h=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}f=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,E),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)}).call(this,r(73)(t))},function(t,e,r){"use strict";var n=e;n.version=r(245).version,n.utils=r(244),n.rand=r(104),n.curve=r(47),n.curves=r(239),n.ec=r(231),n.eddsa=r(227)},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(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:a}catch(t){n=a}}();var f,u=[],c=!1,h=-1;function l(){c&&f&&(c=!1,f.length?u=f.concat(u):h=-1,u.length&&d())}function d(){if(!c){var t=s(l);c=!0;for(var e=u.length;e;){for(f=u,u=[];++h1)for(var r=1;r=0;u--)if(c[u]!==h[u])return!1;for(u=c.length-1;u>=0;u--)if(f=c[u],!m(t[f],e[f],r,n))return!1;return!0}(t,e,r,a))}return r?t===e:t==e}function g(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 w(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&&v(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&o.isError(i),f=!t&&i&&!r;if((s&&a&&_(i,r)||f)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!_(i,r)||!t&&i)throw i}h.AssertionError=function(t){var e;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=p(b((e=this).actual),128)+" "+e.operator+" "+p(b(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=d(r),a=i.indexOf("\n"+o);if(a>=0){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}},o.inherits(h.AssertionError,Error),h.fail=v,h.ok=y,h.equal=function(t,e,r){t!=e&&v(t,e,r,"==",h.equal)},h.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",h.notEqual)},h.deepEqual=function(t,e,r){m(t,e,!1)||v(t,e,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,r){m(t,e,!0)||v(t,e,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,r){m(t,e,!1)&&v(t,e,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,r,n){m(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",h.strictEqual)},h.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",h.notStrictEqual)},h.throws=function(t,e,r){w(!0,t,e,r)},h.doesNotThrow=function(t,e,r){w(!1,t,e,r)},h.ifError=function(t){if(t)throw t};var E=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,r(5))},function(t,e,r){"use strict";var n=r(7),i=r(1);function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var f=0,u=e;return f+=(u=u+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,f,u){var c=0,h=e;return c+=(h=h+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,f,u){return e+n+o+s+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){var n=r(125);r(274),t.exports=n},function(t,e,r){var n=r(158)("wks"),i=r(81),o=r(15).Symbol,a="function"==typeof o;(t.exports=function(t){return n[t]||(n[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=n},function(t,e,r){"use strict";var n=o(r(23)),i=o(r(64));function o(t){return t&&t.__esModule?t:{default:t}}t.exports={sha1:function(t,e){return(0,n.default)("sha1").update(t).digest(e)},sha256:function(t,e){return(0,n.default)("sha256").update(t).digest(e)},sha512:function(t,e){return(0,n.default)("sha512").update(t).digest(e)},HmacSHA256:function(t,e){return(0,i.default)("sha256",e).update(t).digest()},ripemd160:function(t){return(0,n.default)("rmd160").update(t).digest()}}},function(t,e,r){var n=r(2).Buffer,i=r(53).Transform,o=r(66).StringDecoder;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1)(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},function(t,e){var r=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=r)},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e,r){"use strict";var n=r(52).nextTick,i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var o=r(36);o.inherits=r(1);var a=r(137),s=r(67);o.inherits(h,a);for(var f=i(s.prototype),u=0;u65536)throw new Error("requested too many random bytes");var a=new e.Uint8Array(t);t>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof r)return n.nextTick(function(){r(null,s)});return s}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(5),r(6))},function(t,e,r){var n=r(2).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";(function(e){var n=r(1),i=r(70),o=r(69),a=r(65),s=r(13);function f(t){s.call(this,"digest"),this._hash=t,this.buffers=[]}function u(t){s.call(this,"digest"),this._hash=t}n(f,s),f.prototype._update=function(t){this.buffers.push(t)},f.prototype._final=function(){var t=e.concat(this.buffers),r=this._hash(t);return this.buffers=null,r},n(u,s),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new f(i):new u("rmd160"===t||"ripemd160"===t?new o:a(t))}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var n,i=function(){function t(t,e){for(var r=0;r=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=0)throw new Error("Child offset went out of bounds, try again");var i=this.d.add(n);if(0===i.signum())throw new Error("Child offset derived to an invalid key, try again");return new t(i)}},{key:"toHex",value:function(){return this.toBuffer().toString("hex")}},{key:"toPublicKey",value:function(){return this.toPublic()}}],[{key:"fromBuffer",value:function(r){if(!e.isBuffer(r))throw new Error("Expecting paramter to be a Buffer type");if(32!==r.length&&console.log("WARN: Expecting 32 bytes, instead got "+r.length+", stack trace:",(new Error).stack),0===r.length)throw new Error("Empty buffer");return new t(s.fromBuffer(r))}},{key:"fromSeed",value:function(e){if("string"!=typeof e)throw new Error("seed must be of type string");return t.fromBuffer(c.sha256(e))}},{key:"isWif",value:function(t){try{return this.fromWif(t),!0}catch(t){return!1}}},{key:"fromWif",value:function(r){var n=new e(f.decode(r)),i=n.readUInt8(0);u.equal(128,i,"Expected version 128, instead got "+i);var o=n.slice(0,-4),a=n.slice(-4),s=c.sha256(o);if(s=(s=c.sha256(s)).slice(0,4),a.toString()!==s.toString())throw new Error("Invalid WIF key (checksum miss-match)");return o=o.slice(1),t.fromBuffer(o)}},{key:"fromHex",value:function(r){return t.fromBuffer(new e(r,"hex"))}}]),t}();t.exports=d;var p=function(t){return null==t?t:t.Q?t:h.fromStringOrThrow(t)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){var n=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.Q.compressed;return this.Q.getEncoded(t)}},{key:"toUncompressed",value:function(){var e=this.Q.getEncoded(!1),r=o.Point.decodeFrom(a,e);return t.fromPoint(r)}},{key:"toBlockchainAddress",value:function(){var t=this.toBuffer(),e=f.sha512(t);return f.ripemd160(e)}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.get("address_prefix");return this.toPublicKeyString(t)}},{key:"toPublicKeyString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.get("address_prefix");if(this.pubdata)return t+this.pubdata;var r=this.toBuffer(),n=f.ripemd160(r),i=e.concat([r,n.slice(0,4)]);return this.pubdata=s.encode(i),t+this.pubdata}},{key:"toAddressString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.get("address_prefix"),r=this.toBuffer(),n=f.sha512(r),i=f.ripemd160(n),o=f.ripemd160(i);return i=e.concat([i,o.slice(0,4)]),t+s.encode(i)}},{key:"toPtsAddy",value:function(){var t=this.toBuffer(),r=f.sha256(t),n=f.ripemd160(r);n=e.concat([new e([56]),n]);var i=f.sha256(n);return i=f.sha256(i),n=e.concat([n,i.slice(0,4)]),s.encode(n)}},{key:"child",value:function(r){c(e.isBuffer(r),"Buffer required: offset"),c.equal(r.length,32,"offset length"),r=e.concat([this.toBuffer(),r]),r=f.sha256(r);var n=i.fromBuffer(r);if(n.compareTo(l)>=0)throw new Error("Child offset went out of bounds, try again");var o=h.multiply(n),s=this.Q.add(o);if(a.isInfinity(s))throw new Error("Child offset derived to an invalid key, try again");return t.fromPoint(s)}},{key:"toHex",value:function(){return this.toBuffer().toString("hex")}}],[{key:"fromBinary",value:function(r){return t.fromBuffer(new e(r,"binary"))}},{key:"fromBuffer",value:function(e){return new t(o.Point.decodeFrom(a,e))}},{key:"fromPoint",value:function(e){return new t(e)}},{key:"fromString",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.get("address_prefix");try{return t.fromStringOrThrow(e,r)}catch(t){return null}}},{key:"fromStringOrThrow",value:function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.get("address_prefix"),i=r.slice(0,n.length);c.equal(n,i,"Expecting key to begin with "+n+", instead got "+i),r=r.slice(n.length);var o=(r=new e(s.decode(r),"binary")).slice(-4);r=r.slice(0,-4);var a=f.ripemd160(r);return a=a.slice(0,4),c.deepEqual(o,a,"Checksum did not match"),t.fromBuffer(r)}},{key:"fromHex",value:function(r){return t.fromBuffer(new e(r,"hex"))}},{key:"fromStringHex",value:function(r){return t.fromString(new e(r,"hex"))}}]),t}();t.exports=d}).call(this,r(0).Buffer)},function(t,e,r){(function(e){t.exports=function(t,r){for(var n=Math.min(t.length,r.length),i=new e(n),o=0;o1024&&(e.push(i.apply(String,t)),t.length=0),Array.prototype.push.apply(t,arguments)}}function s(t,e,r,n,i){var o,a,s=8*i-n-1,f=(1<>1,c=-7,h=r?i-1:0,l=r?-1:1,d=t[e+h];for(h+=l,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=l,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=l,c-=8);if(0===o)o=1-u;else{if(o===f)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)}function f(t,e,r,n,i,o){var a,s,f,u=8*o-i-1,c=(1<>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=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?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),(e+=a+h>=1?l/f:l*Math.pow(2,1-h))*f>=2&&(a++,f/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*f-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,u-=8);t[r+d-p]|=128*b}e.accessor=function(){return Uint8Array},e.allocate=function(t,r,n){return new e(t,r,n)},e.concat=function(t,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var o,a=0,s=0,f=t.length;s0&&(a+=o);if(0===a)return new e(0,n,i);var u,c=new e(a,n,i);for(s=0;s0&&(a.buffer=t.buffer,a.offset=t.byteOffset,a.limit=t.byteOffset+t.byteLength,a.view=new Uint8Array(t.buffer));else if(t instanceof ArrayBuffer)a=new e(0,i,o),t.byteLength>0&&(a.buffer=t,a.offset=0,a.limit=t.byteLength,a.view=t.byteLength>0?new Uint8Array(t):null);else{if("[object Array]"!==Object.prototype.toString.call(t))throw TypeError("Illegal buffer");(a=new e(t.length,i,o)).limit=t.length;for(var s=0;s>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n,i=e,o=t.length,a=o>>3,s=0;for(e+=this.writeVarint32(o,e);a--;)n=1&!!t[s++]|(1&!!t[s++])<<1|(1&!!t[s++])<<2|(1&!!t[s++])<<3|(1&!!t[s++])<<4|(1&!!t[s++])<<5|(1&!!t[s++])<<6|(1&!!t[s++])<<7,this.writeByte(n,e++);if(s>3,a=0,s=[];for(t+=n.length;o--;)r=this.readByte(t++),s[a++]=!!(1&r),s[a++]=!!(2&r),s[a++]=!!(4&r),s[a++]=!!(8&r),s[a++]=!!(16&r),s[a++]=!!(32&r),s[a++]=!!(64&r),s[a++]=!!(128&r);if(a>f++&1)}return e&&(this.offset=t),s},r.readBytes=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+t+") <= "+this.buffer.byteLength)}var n=this.slice(e,e+t);return r&&(this.offset+=t),n},r.writeBytes=r.append,r.writeInt8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return 128==(128&r)&&(r=-(255-r+1)),e&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=1,this.view[e]=t,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r=this.view[t];return e&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t],r|=this.view[t+1]<<8):(r=this.view[t]<<8,r|=this.view[t+1]),32768==(32768&r)&&(r=-(65535-r+1)),e&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t],r|=this.view[t+1]<<8):(r=this.view[t]<<8,r|=this.view[t+1]),e&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),r|=0,e&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0),e&&(this.offset+=4),r},r.readUInt32=r.readUint32,t&&(r.writeInt64=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var o=e.low,a=e.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a):(this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),n&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var o=new t(n,i,!1);return r&&(this.offset+=8),o},r.readLong=r.readInt64,r.writeUint64=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var o=e.low,a=e.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a):(this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),n&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,i=this.view[e+2]<<16,i|=this.view[e+1]<<8,i|=this.view[e],i+=this.view[e+3]<<24>>>0):(i=this.view[e+1]<<16,i|=this.view[e+2]<<8,i|=this.view[e+3],i+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var o=new t(n,i,!0);return r&&(this.offset+=8),o},r.readUInt64=r.readUint64),r.writeFloat32=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=4,f(this.view,t,e,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var r=s(this.view,t,this.littleEndian,23,4);return e&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=8;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=8,f(this.view,t,e,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var r=s(this.view,t,this.littleEndian,52,8);return e&&(this.offset+=8),r},r.readDouble=r.readFloat64,e.MAX_VARINT32_BYTES=5,e.calculateVarint32=function(t){return(t>>>=0)<128?1:t<16384?2:t<1<<21?3:t<1<<28?4:5},e.zigZagEncode32=function(t){return((t|=0)<<1^t>>31)>>>0},e.zigZagDecode32=function(t){return t>>>1^-(1&t)|0},r.writeVarint32=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,o=e.calculateVarint32(t);r+=o;var a=this.buffer.byteLength;for(r>a&&this.resize((a*=2)>r?a:r),r-=o,t>>>=0;t>=128;)i=127&t|128,this.view[r++]=i,t>>>=7;return this.view[r++]=t,n?(this.offset=r,this):o},r.writeVarint32ZigZag=function(t,r){return this.writeVarint32(e.zigZagEncode32(t),r)},r.readVarint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r,n=0,i=0;do{if(!this.noAssert&&t>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}r=this.view[t++],n<5&&(i|=(127&r)<<7*n),++n}while(0!=(128&r));return i|=0,e?(this.offset=t,i):{value:i,length:n}},r.readVarint32ZigZag=function(t){var r=this.readVarint32(t);return"object"==typeof r?r.value=e.zigZagDecode32(r.value):r=e.zigZagDecode32(r),r},t&&(e.MAX_VARINT64_BYTES=10,e.calculateVarint64=function(e){"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e));var r=e.toInt()>>>0,n=e.shiftRightUnsigned(28).toInt()>>>0,i=e.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:r<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:i<128?9:10},e.zigZagEncode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},e.zigZagDecode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(t.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,n){var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"==typeof r)r=t.fromNumber(r);else if("string"==typeof r)r=t.fromString(r);else if(!(r&&r instanceof t))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=t.fromNumber(r,!1):"string"==typeof r?r=t.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var o=e.calculateVarint64(r),a=r.toInt()>>>0,s=r.shiftRightUnsigned(28).toInt()>>>0,f=r.shiftRightUnsigned(56).toInt()>>>0;n+=o;var u=this.buffer.byteLength;switch(n>u&&this.resize((u*=2)>n?u:n),n-=o,o){case 10:this.view[n+9]=f>>>7&1;case 9:this.view[n+8]=9!==o?128|f:127&f;case 8:this.view[n+7]=8!==o?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==o?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==o?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==o?128|s:127&s;case 4:this.view[n+3]=4!==o?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==o?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==o?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==o?128|a:127&a}return i?(this.offset+=o,this):o},r.writeVarint64ZigZag=function(t,r){return this.writeVarint64(e.zigZagEncode64(t),r)},r.readVarint64=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,i=0,o=0,a=0,s=0;if(s=this.view[e++],i=127&s,128&s&&(s=this.view[e++],i|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],i|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],i|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],o|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],a=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[e++],a|=(127&s)<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var f=t.fromBits(i|o<<28,o>>>4|a<<24,!1);return r?(this.offset=e,f):{value:f,length:e-n}},r.readVarint64ZigZag=function(r){var n=this.readVarint64(r);return n&&n.value instanceof t?n.value=e.zigZagDecode64(n.value):n=e.zigZagDecode64(n),n}),r.writeCString=function(t,e){var r=void 0===e;r&&(e=this.offset);var n,i=t.length;if(!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");for(n=0;n>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}i=c.calculateUTF16asUTF8(o(t))[1],e+=i+1;var a=this.buffer.byteLength;return e>a&&this.resize((a*=2)>e?a:e),e-=i+1,c.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),this.view[e++]=0,r?(this.offset=e,this):i},r.readCString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var r,n=t,i=-1;return c.decodeUTF8toUTF16(function(){if(0===i)return null;if(t>=this.limit)throw RangeError("Illegal range: Truncated data, "+t+" < "+this.limit);return 0===(i=this.view[t++])?null:i}.bind(this),r=a(),!0),e?(this.offset=t,r()):{string:r(),length:t-n}},r.writeIString=function(t,e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n,i=e;n=c.calculateUTF16asUTF8(o(t),this.noAssert)[1],e+=4+n;var a=this.buffer.byteLength;if(e>a&&this.resize((a*=2)>e?a:e),e-=4+n,this.littleEndian?(this.view[e+3]=n>>>24&255,this.view[e+2]=n>>>16&255,this.view[e+1]=n>>>8&255,this.view[e]=255&n):(this.view[e]=n>>>24&255,this.view[e+1]=n>>>16&255,this.view[e+2]=n>>>8&255,this.view[e+3]=255&n),e+=4,c.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),e!==i+4+n)throw RangeError("Illegal range: Truncated data, "+e+" == "+(e+4+n));return r?(this.offset=e,this):e-i},r.readIString=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var n=t,i=this.readUint32(t),o=this.readUTF8String(i,e.METRICS_BYTES,t+=4);return t+=o.length,r?(this.offset=t,o.string):{string:o.string,length:t-n}},e.METRICS_CHARS="c",e.METRICS_BYTES="b",r.writeUTF8String=function(t,e){var r,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var i=e;r=c.calculateUTF16asUTF8(o(t))[1],e+=r;var a=this.buffer.byteLength;return e>a&&this.resize((a*=2)>e?a:e),e-=r,c.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),n?(this.offset=e,this):e-i},r.writeString=r.writeUTF8String,e.calculateUTF8Chars=function(t){return c.calculateUTF16asUTF8(o(t))[0]},e.calculateUTF8Bytes=function(t){return c.calculateUTF16asUTF8(o(t))[1]},e.calculateString=e.calculateUTF8Bytes,r.readUTF8String=function(t,r,n){"number"==typeof r&&(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),void 0===r&&(r=e.METRICS_CHARS),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");if(t|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var o,s=0,f=n;if(r===e.METRICS_CHARS){if(o=a(),c.decodeUTF8(function(){return s>>=0)<0||n+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+t+") <= "+this.buffer.byteLength)}var u=n+t;if(c.decodeUTF8toUTF16(function(){return n>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,a,s=r;i=c.calculateUTF16asUTF8(o(t),this.noAssert)[1],a=e.calculateVarint32(i),r+=a+i;var f=this.buffer.byteLength;if(r>f&&this.resize((f*=2)>r?f:r),r-=a+i,r+=this.writeVarint32(i,r),c.encodeUTF16toUTF8(o(t),function(t){this.view[r++]=t}.bind(this)),r!==s+i+a)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+a));return n?(this.offset=r,this):r-s},r.readVString=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,i=this.readVarint32(t),o=this.readUTF8String(i.value,e.METRICS_BYTES,t+=i.length);return t+=o.length,r?(this.offset=t,o.string):{string:o.string,length:t-n}},r.append=function(t,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,r));var o=t.limit-t.offset;if(o<=0)return this;n+=o;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=o,this.view.set(t.view.subarray(t.offset,t.limit),n),t.offset+=o,i&&(this.offset+=o),this},r.appendTo=function(t,e){return t.append(this,e),this},r.assert=function(t){return this.noAssert=!t,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(t){var r=new e(0,this.littleEndian,this.noAssert);return t?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}if(0===t&&e===this.buffer.byteLength)return this;var r=e-t;if(0===r)return this.buffer=n,this.view=null,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(r),o=new Uint8Array(i);return o.set(this.view.subarray(t,e)),this.buffer=i,this.view=o,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=r,this},r.copy=function(t,r){if(void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t===r)return new e(0,this.littleEndian,this.noAssert);var n=r-t,i=new e(n,this.littleEndian,this.noAssert);return i.offset=0,i.limit=n,i.markedOffset>=0&&(i.markedOffset-=t),this.copyTo(i,0,t,r),i},r.copyTo=function(t,r,n,i){var o,a;if(!this.noAssert&&!e.isByteBuffer(t))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(a=void 0===r)?t.offset:0|r,n=(o=void 0===n)?this.offset:0|n,i=void 0===i?this.limit:0|i,r<0||r>t.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+t.buffer.byteLength);if(n<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=i-n;return 0===s?t:(t.ensureCapacity(r+s),t.view.set(this.view.subarray(n,i),r),o&&(this.offset+=s),a&&(t.offset+=s),this)},r.ensureCapacity=function(t){var e=this.buffer.byteLength;return et?e:t):this},r.fill=function(t,e,r){var n=void 0===e;if(n&&(e=this.offset),"string"==typeof t&&t.length>0&&(t=t.charCodeAt(0)),void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e>=r)return this;for(;e>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=t,this},r.order=function(t){if(!this.noAssert&&"boolean"!=typeof t)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!t,this},r.LE=function(t){return this.littleEndian=void 0===t||!!t,this},r.BE=function(t){return this.littleEndian=void 0!==t&&!t,this},r.prepend=function(t,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,r));var o=t.limit-t.offset;if(o<=0)return this;var a=o-n;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),f=new Uint8Array(s);f.set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=s,this.view=f,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}else new Uint8Array(this.buffer);return this.view.set(t.view.subarray(t.offset,t.limit),n-o),t.offset=t.limit,i&&(this.offset-=o),this},r.prependTo=function(t,e){return t.prepend(this,e),this},r.printDebug=function(t){"function"!=typeof t&&(t=console.log.bind(console)),t(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal capacity: "+t+" (not an integer)");if((t|=0)<0)throw RangeError("Illegal capacity: 0 <= "+t)}if(this.buffer.byteLength>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}return t===e?this:(Array.prototype.reverse.call(this.view.subarray(t,e)),this)},r.skip=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");t|=0}var e=this.offset+t;if(!this.noAssert&&(e<0||e>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+t+" <= "+this.buffer.byteLength);return this.offset=e,this},r.slice=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=t,r.limit=e,r},r.toBuffer=function(t){var e=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(!t&&0===e&&r===this.buffer.byteLength)return this.buffer;if(e===r)return n;var i=new ArrayBuffer(r-e);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(e,r),0),i},r.toArrayBuffer=r.toBuffer,r.toString=function(t,e,r){if(void 0===t)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof t&&(r=e=t="utf8"),t){case"utf8":return this.toUTF8(e,r);case"base64":return this.toBase64(e,r);case"hex":return this.toHex(e,r);case"binary":return this.toBinary(e,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+t)}};var u=function(){for(var t={},e=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],n=0,i=e.length;n>2&63]),i=(3&n)<<4,null!==(n=t())?(r(e[63&((i|=n>>4&15)|n>>4&15)]),i=(15&n)<<2,null!==(n=t())?(r(e[63&(i|n>>6&3)]),r(e[63&n])):(r(e[63&i]),r(61))):(r(e[63&i]),r(61),r(61))},t.decode=function(t,e){var n,i,o;function a(t){throw Error("Illegal character code: "+t)}for(;null!==(n=t());)if(void 0===(i=r[n])&&a(n),null!==(n=t())&&(void 0===(o=r[n])&&a(n),e(i<<2>>>0|(48&o)>>4),null!==(n=t()))){if(void 0===(i=r[n])){if(61===n)break;a(n)}if(e((15&o)<<4>>>0|(60&i)>>2),null!==(n=t())){if(void 0===(o=r[n])){if(61===n)break;a(n)}e((3&i)<<6>>>0|o)}}},t.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},t}();r.toBase64=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity||t>e)throw RangeError("begin, end");var r;return u.encode(function(){return tthis.capacity()||t>e)throw RangeError("begin, end");if(t===e)return"";for(var r=[],n=[];t=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},e.fromBinary=function(t,r){if("string"!=typeof t)throw TypeError("str");for(var n,i=0,o=t.length,a=new e(o,r);i255)throw RangeError("illegal char code: "+n);a.view[i++]=n}return a.limit=o,a},r.toDebug=function(t){for(var e,r=-1,n=this.buffer.byteLength,i="",o="",a="";r32&&e<127?String.fromCharCode(e):".")),++r,t&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}r===this.offset&&r===this.limit?i+=r===this.markedOffset?"!":"|":r===this.offset?i+=r===this.markedOffset?"[":"<":r===this.limit?i+=r===this.markedOffset?"]":">":i+=r===this.markedOffset?"'":t||0!==r&&r!==n?" ":""}if(t&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return t?a:i},e.fromDebug=function(t,r,n){for(var i,o,a=t.length,s=new e((a+1)/3|0,r,n),f=0,u=0,c=!1,h=!1,l=!1,d=!1,p=!1;f":if(!n){if(d){p=!0;break}d=!0}s.limit=u,c=!1;break;case"'":if(!n){if(l){p=!0;break}l=!0}s.markedOffset=u,c=!1;break;case" ":c=!1;break;default:if(!n&&c){p=!0;break}if(o=parseInt(i+t.charAt(f++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=o,c=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+f)}if(!n){if(!h||!d)throw TypeError("Illegal str: Missing offset or limit");if(u>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}for(var r,n=new Array(e-t);t255))throw TypeError("Illegal str: Contains non-hex characters");a.view[f++]=i}return a.limit=f,a};var c=function(){var t={MAX_CODEPOINT:1114111,encodeUTF8:function(t,e){var r=null;for("number"==typeof t&&(r=t,t=function(){return null});null!==r||null!==(r=t());)r<128?e(127&r):r<2048?(e(r>>6&31|192),e(63&r|128)):r<65536?(e(r>>12&15|224),e(r>>6&63|128),e(63&r|128)):(e(r>>18&7|240),e(r>>12&63|128),e(r>>6&63|128),e(63&r|128)),r=null},decodeUTF8:function(t,e){for(var r,n,i,o,a=function(t){t=t.slice(0,t.indexOf(null));var e=Error(t.toString());throw e.name="TruncatedError",e.bytes=t,e};null!==(r=t());)if(0==(128&r))e(r);else if(192==(224&r))null===(n=t())&&a([r,n]),e((31&r)<<6|63&n);else if(224==(240&r))(null===(n=t())||null===(i=t()))&&a([r,n,i]),e((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=t())||null===(i=t())||null===(o=t()))&&a([r,n,i,o]),e((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}},UTF16toUTF8:function(t,e){for(var r,n=null;null!==(r=null!==n?n:t());)r>=55296&&r<=57343&&null!==(n=t())&&n>=56320&&n<=57343?(e(1024*(r-55296)+n-56320+65536),n=null):e(r);null!==n&&e(n)},UTF8toUTF16:function(t,e){var r=null;for("number"==typeof t&&(r=t,t=function(){return null});null!==r||null!==(r=t());)r<=65535?e(r):(e(55296+((r-=65536)>>10)),e(r%1024+56320)),r=null},encodeUTF16toUTF8:function(e,r){t.UTF16toUTF8(e,function(e){t.encodeUTF8(e,r)})},decodeUTF8toUTF16:function(e,r){t.decodeUTF8(e,function(e){t.UTF8toUTF16(e,r)})},calculateCodePoint:function(t){return t<128?1:t<2048?2:t<65536?3:4},calculateUTF8:function(t){for(var e,r=0;null!==(e=t());)r+=e<128?1:e<2048?2:e<65536?3:4;return r},calculateUTF16asUTF8:function(e){var r=0,n=0;return t.UTF16toUTF8(e,function(t){++r,n+=t<128?1:t<2048?2:t<65536?3:4}),[r,n]}};return t}();return r.toUTF8=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var r;try{c.decodeUTF8toUTF16(function(){return t0&&this._events[t].length>a&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){if(!n(e))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},r.prototype.removeListener=function(t,e){var r,o,a,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(a=(r=this._events[t]).length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){o=s;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(156);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){var n=r(173);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e,r){var n=r(179);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e,r){var n=r(89)(Object,"create");t.exports=n},function(t,e,r){(function(e){var n=r(224),i=r(212),o=r(211),a=r(51),s=r(110);function f(t){var r;"object"!=typeof t||e.isBuffer(t)||(r=t.passphrase,t=t.key),"string"==typeof t&&(t=new e(t));var f,u,c=o(t,r),h=c.tag,l=c.data;switch(h){case"CERTIFICATE":u=n.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=n.PublicKey.decode(l,"der")),f=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=n.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+f)}throw new Error("unknown key type "+h);case"ENCRYPTED PRIVATE KEY":l=function(t,r){var n=t.algorithm.decrypt.kde.kdeparams.salt,o=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),f=i[t.algorithm.decrypt.cipher.algo.join(".")],u=t.algorithm.decrypt.cipher.iv,c=t.subjectPrivateKey,h=parseInt(f.split("-")[1],10)/8,l=s.pbkdf2Sync(r,n,o,h),d=a.createDecipheriv(f,l,u),p=[];return p.push(d.update(c)),p.push(d.final()),e.concat(p)}(l=n.EncryptedPrivateKey.decode(l,"der"),r);case"PRIVATE KEY":switch(f=(u=n.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:n.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=n.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+f)}throw new Error("unknown key type "+h);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=n.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+h)}}t.exports=f,f.signature=n.signature}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var n=e;n.base=r(243),n.short=r(242),n.mont=r(241),n.edwards=r(240)},function(t,e,r){var n=r(124),i=r(123),o=r(273);t.exports={Curve:i,Point:n,getCurveByName:o}},function(t,e,r){var n=r(2).Buffer,i=r(278);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),f=n.alloc(o||0),u=n.alloc(0);a>0||o>0;){var c=new i;c.update(u),c.update(t),e&&c.update(e),u=c.digest();var h=0;if(a>0){var l=s.length-a;h=Math.min(a,u.length),u.copy(s,l,0,h),a-=h}if(h0){var d=f.length-o,p=Math.min(o,u.length-h);u.copy(f,d,h,h+p),o-=p}}return u.fill(0),{key:s,iv:f}}},function(t,e,r){var n=r(2).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i>>24]^c[p>>>16&255]^h[b>>>8&255]^l[255&v]^e[y++],a=u[p>>>24]^c[b>>>16&255]^h[v>>>8&255]^l[255&d]^e[y++],s=u[b>>>24]^c[v>>>16&255]^h[d>>>8&255]^l[255&p]^e[y++],f=u[v>>>24]^c[d>>>16&255]^h[p>>>8&255]^l[255&b]^e[y++],d=o,p=a,b=s,v=f;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[255&v])^e[y++],a=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[v>>>8&255]<<8|n[255&d])^e[y++],s=(n[b>>>24]<<24|n[v>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[y++],f=(n[v>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&b])^e[y++],[o>>>=0,a>>>=0,s>>>=0,f>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],f=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,f=0;f<256;++f){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[a]=u,n[u]=a;var c=t[a],h=t[c],l=t[h],d=257*t[u]^16843008*u;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*l^65537*h^257*c^16843008*a,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===a?a=s=1:(a=c^t[t[t[l^c]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(t){this._key=i(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=f.SBOX[a>>>24]<<24|f.SBOX[a>>>16&255]<<16|f.SBOX[a>>>8&255]<<8|f.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e==4&&(a=f.SBOX[a>>>24]<<24|f.SBOX[a>>>16&255]<<16|f.SBOX[a>>>8&255]<<8|f.SBOX[255&a]),i[o]=i[o-e]^a}for(var u=[],c=0;c>>24]]^f.INV_SUB_MIX[1][f.SBOX[l>>>16&255]]^f.INV_SUB_MIX[2][f.SBOX[l>>>8&255]]^f.INV_SUB_MIX[3][f.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,f.SUB_MIX,f.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,f.INV_SUB_MIX,f.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},function(t,e,r){var n=r(286),i=r(276),o=r(128);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},function(t,e,r){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},f.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},f.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},f.prototype._reset=function(){this._isTickUsed=!1},r.exports=f,r.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},f=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var u=r(o),c=new t(e);c._propagateFrom(this,1);var h=this._target();if(c._setBoundTo(u),u instanceof t){var l={promiseRejectionQueued:!1,promise:c,target:h,bindingPromise:u};h._then(e,a,void 0,c,l),u._then(s,f,void 0,c,l),c._setOnCancel(u)}else c._resolveCallback(h);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(t){}return i},e.exports=i},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){var r=t("./util"),n=r.canEvaluate;function i(t){var n=this.pop(),i=function(t,n){var i;if(null!=t&&(i=t[n]),"function"!=typeof i){var o="Object "+r.classString(t)+" has no method '"+r.toString(n)+"'";throw new e.TypeError(o)}return i}(t,n);return i.apply(t,this)}function o(t){return t[this]}function a(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}r.isIdentifier,e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(i,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=a;else if(n){var i=(void 0)(t);e=null!==i?i:o}else e=o;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,f=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),f.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,f=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=f,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},{}],9:[function(t,r,n){"use strict";r.exports=function(r,n){var i,o,a,s=r._getDomain,f=r._async,u=t("./errors").Warning,c=t("./util"),h=c.canAttachTrace,l=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,p=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,b=null,v=null,y=!1,m=!(0==c.env("BLUEBIRD_DEBUG")),g=!(0==c.env("BLUEBIRD_WARNINGS")||!m&&!c.env("BLUEBIRD_WARNINGS")),_=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!m&&!c.env("BLUEBIRD_LONG_STACK_TRACES")),w=0!=c.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(g||!!c.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){H("rejectionHandled",i,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),H("unhandledRejection",o,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return q(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:c.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:c.domainBind(e,t):void 0};var E=function(){};r.longStackTraces=function(){if(f.haveItemsQueued()&&!J.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!J.longStackTraces&&K()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace;J.longStackTraces=!0,E=function(){if(f.haveItemsQueued()&&!J.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,n.deactivateLongStackTraces(),f.enableTrampoline(),J.longStackTraces=!1},r.prototype._captureStackTrace=F,r.prototype._attachExtraTrace=D,n.activateLongStackTraces(),f.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return J.longStackTraces&&K()};var S=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!c.global.dispatchEvent(r)}}if("function"==typeof Event){var t=new Event("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,!c.global.dispatchEvent(r)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!c.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),k=c.isNode?function(){return e.emit.apply(e,arguments)}:c.global?function(t){var e="on"+t.toLowerCase(),r=c.global[e];return!!r&&(r.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function x(t,e){return{promise:e}}var A={promiseCreated:x,promiseFulfilled:x,promiseRejected:x,promiseResolved:x,promiseCancelled:x,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:x},B=function(t){var e=!1;try{e=k.apply(null,arguments)}catch(t){f.throwLater(t),e=!0}var r=!1;try{r=S(t,A[t].apply(null,arguments))}catch(t){f.throwLater(t),r=!0}return r||e};function M(){return!1}function T(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+c.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function I(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?c.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function j(){return this._onCancelField}function C(t){this._onCancelField=t}function O(){this._cancellationParent=void 0,this._onCancelField=void 0}function R(t,e){if(0!=(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}r.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&E()),"warnings"in t){var e=t.warnings;J.warnings=!!e,w=J.warnings,c.isObject(e)&&"wForgottenReturn"in e&&(w=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!J.cancellation){if(f.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=O,r.prototype._propagateFrom=R,r.prototype._onCancel=j,r.prototype._setOnCancel=C,r.prototype._attachCancellationCallback=I,r.prototype._execute=T,P=R,J.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!J.monitoring?(J.monitoring=!0,r.prototype._fireEvent=B):!t.monitoring&&J.monitoring&&(J.monitoring=!1,r.prototype._fireEvent=M)),r},r.prototype._fireEvent=M,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var P=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function L(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function F(){this._trace=new X(this._peekContext())}function D(t,e){if(h(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=N(t);c.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),c.notEnumerableProp(t,"__stackCleaned__",!0)}}}function q(t,e,n){if(J.warnings){var i,o=new u(t);if(e)n._attachExtraTrace(o);else if(J.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=N(o);o.stack=a.message+"\n"+a.stack.join("\n")}B("warning",o)||z(o,"",!0)}}function U(t){for(var e=[],r=0;r0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:U(e)}}function z(t,e,r){if("undefined"!=typeof console){var n;if(c.isObject(t)){var i=t.stack;n=e+v(i,t)}else n=e+String(t);"function"==typeof a?a(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function H(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){f.throwLater(t)}"unhandledRejection"===t?B(t,r,n)||i||z(r,"Unhandled rejection "):B(t,n)}function V(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{if(e=t&&"function"==typeof t.toString?t.toString():c.toString(t),/\[object [a-zA-Z0-9$_]+\]/.test(e))try{var r=JSON.stringify(t);e=r}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){return t.length<41?t:t.substr(0,38)+"..."}(e)+">, no stack trace)"}function K(){return"function"==typeof Z}var W=function(){return!1},G=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y(t){var e=t.match(G);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function X(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);Z(this,X),e>32&&this.uncycle()}c.inherits(X,Error),n.CapturedTrace=X,X.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;for(var n=(t=this._length=n)-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;n0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var f=n>0?e[n-1]:this;s=0;--c)e[c]._length=u,u++;return}}}},X.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=N(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(U(i.stack.split("\n"))),i=i._parent;!function(t){for(var e=t[0],r=1;r=0;--s)if(n[s]===o){a=s;break}for(var s=a;s>=0;--s){var f=n[s];if(e[i]!==f)break;e.pop(),i--}e=n}}(n),function(t){for(var e=0;e=0)return b=/@/,v=e,y=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(v=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?V(e):e.toString()},null):(b=t,v=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(t){console.warn(t)},c.isNode&&e.stderr.isTTY?a=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:c.isNode||"string"!=typeof(new Error).stack||(a=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var J={warnings:g,longStackTraces:!1,cancellation:!1,monitoring:!1};return _&&r.longStackTraces(),{longStackTraces:function(){return J.longStackTraces},warnings:function(){return J.warnings},cancellation:function(){return J.cancellation},monitoring:function(){return J.monitoring},propagateFromFunction:function(){return P},boundValueFunction:function(){return L},checkForgottenReturns:function(t,e,r,n,i){if(void 0===t&&null!==e&&w){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),f=U(s),u=f.length-1;u>=0;--u){var c=f[u];if(!d.test(c)){var h=c.match(p);h&&(o="at "+h[1]+":"+h[2]+":"+h[3]+" ");break}}if(f.length>0)for(var l=f[0],u=0;u0&&(a="\n"+s[u-1]);break}}var b="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(b,!0,e)}},setBounds:function(t,e){if(K()){for(var r,n,i=t.stack.split("\n"),o=e.stack.split("\n"),a=-1,s=-1,f=0;f=s||(W=function(t){if(l.test(t))return!0;var e=Y(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:q,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),q(r)},CapturedTrace:X,fireDomEvent:S,fireGlobalEvent:k}}},{"./errors":12,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];return n instanceof t&&n.suppressUnhandledRejections(),this.caught(r,function(){return n})}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.reduce,n=t.all;function i(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(i,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(i,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},{}],12:[function(t,e,r){"use strict";var n,i,o=t("./es5"),a=o.freeze,s=t("./util"),f=s.inherits,u=s.notEnumerableProp;function c(t,e){function r(n){if(!(this instanceof r))return new r(n);u(this,"message","string"==typeof n?n:e),u(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return f(r,Error),r}var h=c("Warning","warning"),l=c("CancellationError","cancellation error"),d=c("TimeoutError","timeout error"),p=c("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(t){n=c("TypeError","type error"),i=c("RangeError","range error")}for(var b="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function h(){return d.call(this,this.promise._target()._settledValue())}function l(t){if(!c(this,t))return a.e=t,a}function d(t){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var f=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t);if(f===n)return f;if(void 0!==f){i._setReturnedNonUndefined();var d=r(f,i);if(d instanceof e){if(null!=this.cancelPromise){if(d._isCancelled()){var p=new o("late cancellation observer");return i._attachExtraTrace(p),a.e=p,a}d.isPending()&&d._attachCancellationCallback(new u(this))}return d._then(h,l,void 0,this,void 0)}}}return i.isRejected()?(c(this),a.e=t,a):(c(this),t)}return f.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){c(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new f(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,d,d)},e.prototype.tap=function(t){return this._passThrough(t,1,d)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,d);var n,o=new Array(r-1),a=0;for(n=0;n0&&"function"==typeof arguments[e]&&(t=arguments[e]);var n=[].slice.call(arguments);t&&n.pop();var i=new r(n).promise();return void 0!==t?i.spread(t):i}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=e._getDomain,f=t("./util"),u=f.tryCatch,c=f.errorObj,h=e._async;function l(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=s();this._callback=null===i?e:f.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function d(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+f.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+f.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+f.classString(i.concurrency)));a=i.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new l(t,r,a,o).promise()}f.inherits(l,r),l.prototype._asyncInit=function(){this._init$(void 0,-2)},l.prototype._init=function(){},l.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,f=this._limit;if(r<0){if(n[r=-1*r-1]=t,f>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(f>=1&&this._inFlight>=f)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var h=this._promise,l=this._callback,d=h._boundValue();h._pushContext();var p=u(l).call(d,t,r,o),b=h._popContext();if(a.checkForgottenReturns(p,b,null!==s?"Promise.filter":"Promise.map",h),p===c)return this._reject(p.e),!0;var v=i(p,this._promise);if(v instanceof e){var y=(v=v._target())._bitField;if(0==(50397184&y))return f>=1&&this._inFlight++,n[r]=v,v._proxy(this,-1*(r+1)),!1;if(0==(33554432&y))return 0!=(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);p=v._value()}n[r]=p}var m=++this._totalResolved;return m>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},l.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],c=arguments[2];n=a.isArray(u)?s(t).apply(c,u):s(t).call(c,u)}else n=s(t)();var h=f._popContext();return o.checkForgottenReturns(n,h,"Promise.try",f),f._resolveFromSyncValue(n),f},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";var n=t("./util"),i=n.maybeWrapAsError,o=t("./errors"),a=o.OperationalError,s=t("./es5"),f=/^(?:name|message|stack|cause)$/;function u(t){var e;if(function(t){return t instanceof Error&&s.getPrototypeOf(t)===Error.prototype}(t)){(e=new a(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=s.keys(t),i=0;i1){var r,n=new Array(e-1),i=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+u.classString(t);arguments.length>1&&(r+=", "+u.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},T.prototype.done=function(t,e){var r=this._then(t,e,void 0,void 0,void 0);r._setIsFinal()},T.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+u.classString(t)):this.all()._then(t,void 0,void 0,y,void 0)},T.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},T.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new _(this).promise()},T.prototype.error=function(t){return this.caught(u.originatesFromRejection,t)},T.getNewLibraryCopy=r.exports,T.is=function(t){return t instanceof T},T.fromNode=T.fromCallback=function(t){var e=new T(v);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=M(t)(A(e,r));return n===B&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},T.all=function(t){return new _(t).promise()},T.cast=function(t){var e=g(t);return e instanceof T||((e=new T(v))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},T.resolve=T.fulfilled=T.cast,T.reject=T.rejected=function(t){var e=new T(v);return e._captureStackTrace(),e._rejectCallback(t,!0),e},T.setScheduler=function(t){if("function"!=typeof t)throw new p("expecting a function but got "+u.classString(t));return l.setScheduler(t)},T.prototype._then=function(t,e,r,n,i){var o=void 0!==i,a=o?i:new T(v),f=this._target(),c=f._bitField;o||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():f===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var h=s();if(0!=(50397184&c)){var d,p,y=f._settlePromiseCtx;0!=(33554432&c)?(p=f._rejectionHandler0,d=t):0!=(16777216&c)?(p=f._fulfillmentHandler0,d=e,f._unsetRejectionIsUnhandled()):(y=f._settlePromiseLateCancellationObserver,p=new b("late cancellation observer"),f._attachExtraTrace(p),d=e),l.invoke(y,f,{handler:null===h?d:"function"==typeof d&&u.domainBind(h,d),promise:a,receiver:n,value:p})}else f._addCallbacks(t,e,a,n,h);return a},T.prototype._length=function(){return 65535&this._bitField},T.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},T.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},T.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},T.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},T.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},T.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},T.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},T.prototype._isFinal=function(){return(4194304&this._bitField)>0},T.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},T.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},T.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},T.prototype._setAsyncGuaranteed=function(){l.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},T.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==f)return void 0===e&&this._isBound()?this._boundValue():e},T.prototype._promiseAt=function(t){return this[4*t-4+2]},T.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},T.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},T.prototype._boundValue=function(){},T.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=f),this._addCallbacks(e,r,n,i,null)},T.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=f),this._addCallbacks(r,n,i,o,null)},T.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:u.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:u.domainBind(i,e));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===i?t:u.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:u.domainBind(i,e))}return this._setLength(o+1),o},T.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},T.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(n(),!1);var r=g(t,this);if(!(r instanceof T))return this._fulfill(t);e&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var o=i._bitField;if(0==(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():l.settlePromises(this))}},T.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return l.fatalError(t,u.isNode);(65535&e)>0?l.settlePromises(this):this._ensurePossibleRejectionHandled()}},T.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!=(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},T.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},T.defer=T.pending=function(){S.deprecated("Promise.defer","new Promise");var t=new T(v);return{promise:t,resolve:I,reject:j}},u.notEnumerableProp(T,"_makeSelfResolutionError",n),t("./method")(T,v,g,o,S),t("./bind")(T,v,g,S),t("./cancel")(T,_,o,S),t("./direct_resolve")(T),t("./synchronous_inspection")(T),t("./join")(T,_,g,v,l,s),T.Promise=T,T.version="3.5.1",t("./map.js")(T,_,o,g,v,S),t("./call_get.js")(T),t("./using.js")(T,o,g,E,v,S),t("./timers.js")(T,v,S),t("./generators.js")(T,o,v,g,a,S),t("./nodeify.js")(T),t("./promisify.js")(T,v),t("./props.js")(T,_,g,o),t("./race.js")(T,v,g,o),t("./reduce.js")(T,_,o,g,v,S),t("./settle.js")(T,_,S),t("./some.js")(T,_,o),t("./filter.js")(T,v),t("./each.js")(T,v),t("./any.js")(T),u.toFastProperties(T),u.toFastProperties(T.prototype),C({a:1}),C({b:2}),C({c:3}),C(1),C(function(){}),C(void 0),C(!1),C(new T(v)),S.setBounds(h.firstLineError,u.lastLineError),T}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){var a=t("./util");function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.isArray,a.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,o){var s=n(this._values,this._promise);if(s instanceof e){var f=(s=s._target())._bitField;if(this._values=s,0==(50397184&f))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0==(33554432&f))return 0!=(16777216&f)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(o));else{var u=i("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var n;if(this._isMap)n=function(t){for(var e=new o,r=t.length/2|0,n=0;n>1},e.prototype.props=function(){return h(this)},e.props=function(t){return h(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseFulfilled=function(t,e){var r=new i;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},a.prototype._promiseRejected=function(t,e){var r=new i;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new a(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=t("./errors").RangeError,a=t("./errors").AggregateError,s=i.isArray,f={};function u(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(t),i=r.promise();return r.setHowMany(e),r.init(),i}i.inherits(u,r),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(t){this._howMany=t},u.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(f),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(t){this._values.push(t)},u.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new o(e)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return c(t,e)},e.prototype.some=function(t){return c(this,t)},e._SomePromiseArray=u}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){var n=t("./util"),i=n.errorObj,o=n.isObject,a={}.hasOwnProperty;return function(t,s){if(o(t)){if(t instanceof e)return t;var f=function(t){try{return function(t){return t.then}(t)}catch(t){return i.e=t,i}}(t);if(f===i){s&&s._pushContext();var u=e.reject(f.e);return s&&s._popContext(),u}if("function"==typeof f){if(function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(t)){var u=new e(r);return t._then(u._fulfill,u._reject,void 0,u,null),u}return function(t,o,a){var s=new e(r),f=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var u=!0,c=n.tryCatch(o).call(t,function(t){s&&(s._resolveCallback(t),s=null)},function(t){s&&(s._rejectCallback(t,u,!0),s=null)});return u=!1,s&&c===i&&(s._rejectCallback(c.e,!0,!0),s=null),f}(t,f,s)}}return t}}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=e.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return f(+this).thenReturn(t)},f=e.delay=function(t,i){var o,f;return void 0!==i?(o=e.resolve(i)._then(s,null,null,t,void 0),n.cancellation()&&i instanceof e&&o._setOnCancel(i)):(o=new e(r),f=setTimeout(function(){o._fulfill()},+t),n.cancellation()&&o._setOnCancel(new a(f)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};function u(t){return clearTimeout(this.handle),t}function c(t){throw clearTimeout(this.handle),t}e.prototype.delay=function(t){return f(t,this)},e.prototype.timeout=function(t,e){var r,s;t=+t;var f=new a(setTimeout(function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new o("operation timed out"):new o(e),i.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)},t));return n.cancellation()?(s=this.then(),(r=s._then(u,c,void 0,f,void 0))._setOnCancel(f)):r=this._then(u,c,void 0,f,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=t("./util"),f=t("./errors").TypeError,u=t("./util").inherits,c=s.errorObj,h=s.tryCatch,l={};function d(t){setTimeout(function(){throw t},0)}function p(t,r){var i=0,a=t.length,s=new e(o);return function o(){if(i>=a)return s._fulfill();var f=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[i++]);if(f instanceof e&&f._isDisposable()){try{f=n(f._getDisposer().tryDispose(r),t.promise)}catch(t){return d(t)}if(f instanceof e)return f._then(o,d,null,null,null)}o()}(),s}function b(t,e,r){this._data=t,this._promise=e,this._context=r}function v(t,e,r){this.constructor$(t,e,r)}function y(t){return b.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function m(t){this.length=t,this.promise=null,this[t-1]=null}b.prototype.data=function(){return this._data},b.prototype.promise=function(){return this._promise},b.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():l},b.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==l?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},b.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},u(v,b),v.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},m.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new v(t,this,i());throw new f}}},{"./errors":12,"./util":36}],36:[function(t,n,i){"use strict";var o=t("./es5"),a="undefined"==typeof navigator,s={e:{}},f,u="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0!==this?this:null;function c(){try{var t=f;return f=null,t.apply(this,arguments)}catch(t){return s.e=t,s}}function h(t){return f=t,c}var l=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function d(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function p(t){return"function"==typeof t||"object"==typeof t&&null!==t}function b(t){return d(t)?new Error(B(t)):t}function v(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=w.test(t+"")&&o.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function S(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}var k=/^[a-z$_][a-z$_0-9]*$/i;function x(t){return k.test(t)}function A(t,e,r){for(var n=new Array(t),i=0;i10||H[0]>0),z.isNode&&z.toFastProperties(e);try{throw new Error}catch(t){z.lastLineError=t}n.exports=z},{"./es5":13}]},{},[4])(4)}(),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,r(6),r(5),r(146).setImmediate)},function(t,e,r){var n=r(41),i=r(366),o=r(365),a=r(26),s=r(84),f=r(151),u={},c={};(e=t.exports=function(t,e,r,h,l){var d,p,b,v,y=l?function(){return t}:f(t),m=n(r,h,e?2:1),g=0;if("function"!=typeof y)throw TypeError(t+" is not iterable!");if(o(y)){for(d=s(t.length);d>g;g++)if((v=e?m(a(p=t[g])[0],p[1]):m(t[g]))===u||v===c)return v}else for(b=y.call(t);!(p=b.next()).done;)if((v=i(b,m,p.value,e))===u||v===c)return v}).BREAK=u,e.RETURN=c},function(t,e,r){var n=r(56),i=r(54),o="[object Symbol]";t.exports=function(t){return"symbol"==typeof t||i(t)&&n(t)==o}},function(t,e,r){var n=e;n.utils=r(9),n.common=r(30),n.sha=r(238),n.ripemd=r(234),n.hmac=r(233),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,r){(function(e){var n=r(3),i=r(21);function o(t,r){var i=function(t){var e=a(t);return{blinder:e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(r),o=r.modulus.byteLength(),s=(n.mont(r.modulus),new n(t).mul(i.blinder).umod(r.modulus)),f=s.toRed(n.mont(r.prime1)),u=s.toRed(n.mont(r.prime2)),c=r.coefficient,h=r.prime1,l=r.prime2,d=f.redPow(r.exponent1),p=u.redPow(r.exponent2);d=d.fromRed(),p=p.fromRed();var b=d.isub(p).imul(c).umod(h);return b.imul(l),p.iadd(b),new e(p.imul(i.unblinder).umod(r.modulus).toArray(!1,o))}function a(t){for(var e=t.modulus.byteLength(),r=new n(i(e));r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new n(i(e));return r}t.exports=o,o.getr=a}).call(this,r(0).Buffer)},function(t,e,r){"use strict";e.utils=r(258),e.Cipher=r(257),e.DES=r(256),e.CBC=r(255),e.EDE=r(254)},function(t,e,r){var n={ECB:r(285),CBC:r(284),CFB:r(283),CFB8:r(282),CFB1:r(281),OFB:r(280),CTR:r(130),GCM:r(130)},i=r(128);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},function(t,e,r){"use strict";var n=r(1),i=r(291),o=r(13),a=r(2).Buffer,s=r(70),f=r(69),u=r(65),c=a.alloc(128);function h(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new f:u(t)).update(e).digest():e.length>5==6?2:t>>4==14?3:t>>3==30?4:-1}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�".repeat(r+2)}}(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function f(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){"use strict";(function(e,n,i){var o=r(52).nextTick;function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=m;var s,f=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?n:o;m.WritableState=y;var u=r(36);u.inherits=r(1);var c={deprecate:r(301)},h=r(136),l=r(2).Buffer,d=i.Uint8Array||function(){};var p,b=r(135);function v(){}function y(t,e){s=s||r(16),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,u=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o(i,n),o(k,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),k(t,e))}(t,r,n,e,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?f(_,t,r,a,i):_(t,r,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function m(t){if(s=s||r(16),!(p.call(m,this)||this instanceof s))return new m(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function g(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),k(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,f=!0;r;)i[s]=r,r.isBuf||(f=!1),r=r.next,s+=1;i.allBuffers=f,g(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,h=r.callback;if(g(t,e,!1,e.objectMode?1:u.length,u,c,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function E(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var r=E(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(m,h),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===m&&(t&&t._writableState instanceof y)}})):p=function(t){return t instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof d);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=v),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var f=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},m.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,k(t,e),r&&(e.finished?o(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),m.prototype.destroy=b.destroy,m.prototype._undestroy=b.undestroy,m.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(6),r(146).setImmediate,r(5))},function(t,e,r){(e=t.exports=r(137)).Stream=e,e.Readable=e,e.Writable=r(67),e.Duplex=r(16),e.Transform=r(134),e.PassThrough=r(300)},function(t,e,r){"use strict";(function(e){var n=r(1),i=r(305);function o(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function a(t,e){return t<>>32-e}function s(t,e,r,n,i,o,s,f){return a(t+(e^r^n)+o+s|0,f)+i|0}function f(t,e,r,n,i,o,s,f){return a(t+(e&r|~e&n)+o+s|0,f)+i|0}function u(t,e,r,n,i,o,s,f){return a(t+((e|~r)^n)+o+s|0,f)+i|0}function c(t,e,r,n,i,o,s,f){return a(t+(e&n|r&~n)+o+s|0,f)+i|0}function h(t,e,r,n,i,o,s,f){return a(t+(e^(r|~n))+o+s|0,f)+i|0}n(o,i),o.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d,l=this._e;l=s(l,r=s(r,n,i,o,l,t[0],0,11),n,i=a(i,10),o,t[1],0,14),n=s(n=a(n,10),i=s(i,o=s(o,l,r,n,i,t[2],0,15),l,r=a(r,10),n,t[3],0,12),o,l=a(l,10),r,t[4],0,5),o=s(o=a(o,10),l=s(l,r=s(r,n,i,o,l,t[5],0,8),n,i=a(i,10),o,t[6],0,7),r,n=a(n,10),i,t[7],0,9),r=s(r=a(r,10),n=s(n,i=s(i,o,l,r,n,t[8],0,11),o,l=a(l,10),r,t[9],0,13),i,o=a(o,10),l,t[10],0,14),i=s(i=a(i,10),o=s(o,l=s(l,r,n,i,o,t[11],0,15),r,n=a(n,10),i,t[12],0,6),l,r=a(r,10),n,t[13],0,7),l=f(l=a(l,10),r=s(r,n=s(n,i,o,l,r,t[14],0,9),i,o=a(o,10),l,t[15],0,8),n,i=a(i,10),o,t[7],1518500249,7),n=f(n=a(n,10),i=f(i,o=f(o,l,r,n,i,t[4],1518500249,6),l,r=a(r,10),n,t[13],1518500249,8),o,l=a(l,10),r,t[1],1518500249,13),o=f(o=a(o,10),l=f(l,r=f(r,n,i,o,l,t[10],1518500249,11),n,i=a(i,10),o,t[6],1518500249,9),r,n=a(n,10),i,t[15],1518500249,7),r=f(r=a(r,10),n=f(n,i=f(i,o,l,r,n,t[3],1518500249,15),o,l=a(l,10),r,t[12],1518500249,7),i,o=a(o,10),l,t[0],1518500249,12),i=f(i=a(i,10),o=f(o,l=f(l,r,n,i,o,t[9],1518500249,15),r,n=a(n,10),i,t[5],1518500249,9),l,r=a(r,10),n,t[2],1518500249,11),l=f(l=a(l,10),r=f(r,n=f(n,i,o,l,r,t[14],1518500249,7),i,o=a(o,10),l,t[11],1518500249,13),n,i=a(i,10),o,t[8],1518500249,12),n=u(n=a(n,10),i=u(i,o=u(o,l,r,n,i,t[3],1859775393,11),l,r=a(r,10),n,t[10],1859775393,13),o,l=a(l,10),r,t[14],1859775393,6),o=u(o=a(o,10),l=u(l,r=u(r,n,i,o,l,t[4],1859775393,7),n,i=a(i,10),o,t[9],1859775393,14),r,n=a(n,10),i,t[15],1859775393,9),r=u(r=a(r,10),n=u(n,i=u(i,o,l,r,n,t[8],1859775393,13),o,l=a(l,10),r,t[1],1859775393,15),i,o=a(o,10),l,t[2],1859775393,14),i=u(i=a(i,10),o=u(o,l=u(l,r,n,i,o,t[7],1859775393,8),r,n=a(n,10),i,t[0],1859775393,13),l,r=a(r,10),n,t[6],1859775393,6),l=u(l=a(l,10),r=u(r,n=u(n,i,o,l,r,t[13],1859775393,5),i,o=a(o,10),l,t[11],1859775393,12),n,i=a(i,10),o,t[5],1859775393,7),n=c(n=a(n,10),i=c(i,o=u(o,l,r,n,i,t[12],1859775393,5),l,r=a(r,10),n,t[1],2400959708,11),o,l=a(l,10),r,t[9],2400959708,12),o=c(o=a(o,10),l=c(l,r=c(r,n,i,o,l,t[11],2400959708,14),n,i=a(i,10),o,t[10],2400959708,15),r,n=a(n,10),i,t[0],2400959708,14),r=c(r=a(r,10),n=c(n,i=c(i,o,l,r,n,t[8],2400959708,15),o,l=a(l,10),r,t[12],2400959708,9),i,o=a(o,10),l,t[4],2400959708,8),i=c(i=a(i,10),o=c(o,l=c(l,r,n,i,o,t[13],2400959708,9),r,n=a(n,10),i,t[3],2400959708,14),l,r=a(r,10),n,t[7],2400959708,5),l=c(l=a(l,10),r=c(r,n=c(n,i,o,l,r,t[15],2400959708,6),i,o=a(o,10),l,t[14],2400959708,8),n,i=a(i,10),o,t[5],2400959708,6),n=h(n=a(n,10),i=c(i,o=c(o,l,r,n,i,t[6],2400959708,5),l,r=a(r,10),n,t[2],2400959708,12),o,l=a(l,10),r,t[4],2840853838,9),o=h(o=a(o,10),l=h(l,r=h(r,n,i,o,l,t[0],2840853838,15),n,i=a(i,10),o,t[5],2840853838,5),r,n=a(n,10),i,t[9],2840853838,11),r=h(r=a(r,10),n=h(n,i=h(i,o,l,r,n,t[7],2840853838,6),o,l=a(l,10),r,t[12],2840853838,8),i,o=a(o,10),l,t[2],2840853838,13),i=h(i=a(i,10),o=h(o,l=h(l,r,n,i,o,t[10],2840853838,12),r,n=a(n,10),i,t[14],2840853838,5),l,r=a(r,10),n,t[1],2840853838,12),l=h(l=a(l,10),r=h(r,n=h(n,i,o,l,r,t[3],2840853838,13),i,o=a(o,10),l,t[8],2840853838,14),n,i=a(i,10),o,t[11],2840853838,11),n=h(n=a(n,10),i=h(i,o=h(o,l,r,n,i,t[6],2840853838,8),l,r=a(r,10),n,t[15],2840853838,5),o,l=a(l,10),r,t[13],2840853838,6),o=a(o,10);var d=this._a,p=this._b,b=this._c,v=this._d,y=this._e;y=h(y,d=h(d,p,b,v,y,t[5],1352829926,8),p,b=a(b,10),v,t[14],1352829926,9),p=h(p=a(p,10),b=h(b,v=h(v,y,d,p,b,t[7],1352829926,9),y,d=a(d,10),p,t[0],1352829926,11),v,y=a(y,10),d,t[9],1352829926,13),v=h(v=a(v,10),y=h(y,d=h(d,p,b,v,y,t[2],1352829926,15),p,b=a(b,10),v,t[11],1352829926,15),d,p=a(p,10),b,t[4],1352829926,5),d=h(d=a(d,10),p=h(p,b=h(b,v,y,d,p,t[13],1352829926,7),v,y=a(y,10),d,t[6],1352829926,7),b,v=a(v,10),y,t[15],1352829926,8),b=h(b=a(b,10),v=h(v,y=h(y,d,p,b,v,t[8],1352829926,11),d,p=a(p,10),b,t[1],1352829926,14),y,d=a(d,10),p,t[10],1352829926,14),y=c(y=a(y,10),d=h(d,p=h(p,b,v,y,d,t[3],1352829926,12),b,v=a(v,10),y,t[12],1352829926,6),p,b=a(b,10),v,t[6],1548603684,9),p=c(p=a(p,10),b=c(b,v=c(v,y,d,p,b,t[11],1548603684,13),y,d=a(d,10),p,t[3],1548603684,15),v,y=a(y,10),d,t[7],1548603684,7),v=c(v=a(v,10),y=c(y,d=c(d,p,b,v,y,t[0],1548603684,12),p,b=a(b,10),v,t[13],1548603684,8),d,p=a(p,10),b,t[5],1548603684,9),d=c(d=a(d,10),p=c(p,b=c(b,v,y,d,p,t[10],1548603684,11),v,y=a(y,10),d,t[14],1548603684,7),b,v=a(v,10),y,t[15],1548603684,7),b=c(b=a(b,10),v=c(v,y=c(y,d,p,b,v,t[8],1548603684,12),d,p=a(p,10),b,t[12],1548603684,7),y,d=a(d,10),p,t[4],1548603684,6),y=c(y=a(y,10),d=c(d,p=c(p,b,v,y,d,t[9],1548603684,15),b,v=a(v,10),y,t[1],1548603684,13),p,b=a(b,10),v,t[2],1548603684,11),p=u(p=a(p,10),b=u(b,v=u(v,y,d,p,b,t[15],1836072691,9),y,d=a(d,10),p,t[5],1836072691,7),v,y=a(y,10),d,t[1],1836072691,15),v=u(v=a(v,10),y=u(y,d=u(d,p,b,v,y,t[3],1836072691,11),p,b=a(b,10),v,t[7],1836072691,8),d,p=a(p,10),b,t[14],1836072691,6),d=u(d=a(d,10),p=u(p,b=u(b,v,y,d,p,t[6],1836072691,6),v,y=a(y,10),d,t[9],1836072691,14),b,v=a(v,10),y,t[11],1836072691,12),b=u(b=a(b,10),v=u(v,y=u(y,d,p,b,v,t[8],1836072691,13),d,p=a(p,10),b,t[12],1836072691,5),y,d=a(d,10),p,t[2],1836072691,14),y=u(y=a(y,10),d=u(d,p=u(p,b,v,y,d,t[10],1836072691,13),b,v=a(v,10),y,t[0],1836072691,13),p,b=a(b,10),v,t[4],1836072691,7),p=f(p=a(p,10),b=f(b,v=u(v,y,d,p,b,t[13],1836072691,5),y,d=a(d,10),p,t[8],2053994217,15),v,y=a(y,10),d,t[6],2053994217,5),v=f(v=a(v,10),y=f(y,d=f(d,p,b,v,y,t[4],2053994217,8),p,b=a(b,10),v,t[1],2053994217,11),d,p=a(p,10),b,t[3],2053994217,14),d=f(d=a(d,10),p=f(p,b=f(b,v,y,d,p,t[11],2053994217,14),v,y=a(y,10),d,t[15],2053994217,6),b,v=a(v,10),y,t[0],2053994217,14),b=f(b=a(b,10),v=f(v,y=f(y,d,p,b,v,t[5],2053994217,6),d,p=a(p,10),b,t[12],2053994217,9),y,d=a(d,10),p,t[2],2053994217,12),y=f(y=a(y,10),d=f(d,p=f(p,b,v,y,d,t[13],2053994217,9),b,v=a(v,10),y,t[9],2053994217,12),p,b=a(b,10),v,t[7],2053994217,5),p=s(p=a(p,10),b=f(b,v=f(v,y,d,p,b,t[10],2053994217,15),y,d=a(d,10),p,t[14],2053994217,8),v,y=a(y,10),d,t[12],0,8),v=s(v=a(v,10),y=s(y,d=s(d,p,b,v,y,t[15],0,5),p,b=a(b,10),v,t[10],0,12),d,p=a(p,10),b,t[4],0,9),d=s(d=a(d,10),p=s(p,b=s(b,v,y,d,p,t[1],0,12),v,y=a(y,10),d,t[5],0,5),b,v=a(v,10),y,t[8],0,14),b=s(b=a(b,10),v=s(v,y=s(y,d,p,b,v,t[7],0,6),d,p=a(p,10),b,t[6],0,8),y,d=a(d,10),p,t[2],0,13),y=s(y=a(y,10),d=s(d,p=s(p,b,v,y,d,t[13],0,6),b,v=a(v,10),y,t[14],0,5),p,b=a(b,10),v,t[0],0,15),p=s(p=a(p,10),b=s(b,v=s(v,y,d,p,b,t[3],0,13),y,d=a(d,10),p,t[9],0,11),v,y=a(y,10),d,t[11],0,11),v=a(v,10);var m=this._b+i+v|0;this._b=this._c+o+y|0,this._c=this._d+l+d|0,this._d=this._e+r+p|0,this._e=this._a+n+b|0,this._a=m},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new e(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=o}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var n=r(306);function i(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,i=-1732584194,o=271733878,h=0;h>>32-s,r);var a,s}function a(t,e,r,n,i,a,s){return o(e&r|~e&n,t,e,i,a,s)}function s(t,e,r,n,i,a,s){return o(e&n|r&~n,t,e,i,a,s)}function f(t,e,r,n,i,a,s){return o(e^r^n,t,e,i,a,s)}function u(t,e,r,n,i,a,s){return o(r^(e|~n),t,e,i,a,s)}function c(t,e){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}t.exports=function(t){return n(t,i)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=function(t){return t.replace(n,function(t,e){return e.toUpperCase()})},e.validateAccountName=function(t){var e=void 0,r=void 0,n=void 0,i=void 0;if(i="Account name should ",!t)return i+"not be empty.";var o=t.length;if(o<3)return i+"be longer.";if(o>16)return i+"be shorter.";/\./.test(t)&&(i="Each account segment should ");var a=t.split(".");for(e=0,n=a.length;e=3))return i+"be longer"}return null};var n=/_([a-z])/g},function(t,e,r){(function(n){function i(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==n&&"env"in n&&(t=n.env.DEBUG),t}(e=t.exports=r(317)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,o=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&"%c"===t&&(o=++i)}),t.splice(o,0,n)},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=i,e.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(i())}).call(this,r(6))},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(55).Symbol;t.exports=n},function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r._setTransport(t),r._setLogger(t),r.options=t,r.seqNo=0,f.default.forEach(function(t){var e=t.method_name||(0,c.camelCase)(t.method),n=t.params||[];r[e+"With"]=function(e,i){return r.send(t.api,{method:t.method,params:n.map(function(t){return e[t]})},i)},r[e]=function(){for(var t=arguments.length,i=Array(t),o=0;o1&&"function"==typeof this.__logger[t]){var e=Array.prototype.slice.call(arguments,1);this.__logger[t].apply(this.__logger,e)}else this.__logger.log.apply(this.__logger,arguments)}},{key:"start",value:function(){return this.transport.start()}},{key:"stop",value:function(){return this.transport.stop()}},{key:"send",value:function(t,e,r){var n=r;if(this.__logger){var i=Math.random(),o=this;this.log("xmit:"+i+":",e),n=function(t,e){t?o.log("error","rsp:"+i+":\n\n",t,e):o.log("rsp:"+i+":",e),r&&r.apply(o,arguments)}}return this.transport.send(t,e,n)}},{key:"call",value:function(t,e,r){if("http"===this._transportType){var n=++this.seqNo;(0,d.jsonRpc)(this.options.uri,{method:t,params:e,id:n}).then(function(t){r(null,t)},function(t){r(t)})}else r(new Error("RPC methods can only be called when using http transport"))}},{key:"signedCall",value:function(t,e,r,n,i){if("http"===this._transportType){var o=++this.seqNo,a=void 0;try{a=(0,p.sign)({method:t,params:e,id:o},r,[n])}catch(t){return void i(t)}(0,d.jsonRpc)(this.options.uri,a).then(function(t){i(null,t)},function(t){i(t)})}else i(new Error("RPC methods can only be called when using http transport"))}},{key:"setOptions",value:function(t){Object.assign(this.options,t),this._setLogger(t),this._setTransport(t),this.transport.setOptions(t)}},{key:"setWebSocket",value:function(t){this.setOptions({websocket:t})}},{key:"setUri",value:function(t){this.setOptions({uri:t})}},{key:"streamBlockNumber",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"head",e=this,r=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;"function"==typeof t&&(r=t,t="head");var i="",o=!0;return function s(){o&&e.getDynamicGlobalPropertiesAsync().then(function(e){var o="irreversible"===t?e.last_irreversible_block_num:e.head_block_number;if(o!==i)if(i)for(var f=i;f0&&void 0!==arguments[0]?arguments[0]:"head",r=arguments[1];"function"==typeof e&&(r=e,e="head");var n="",i="",o=this.streamBlockNumber(e,function(e,a){if(e)return o(),void r(e);(n=a)!==i&&(i=n,t.getBlock(n,r))});return o}},{key:"streamTransactions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"head",e=arguments[1];"function"==typeof t&&(e=t,t="head");var r=this.streamBlock(t,function(t,n){if(t)return r(),void e(t);n&&n.transactions&&n.transactions.forEach(function(t){e(null,t)})});return r}},{key:"streamOperations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"head",e=arguments[1];"function"==typeof t&&(e=t,t="head");var r=this.streamTransactions(t,function(t,n){if(t)return r(),void e(t);n.operations.forEach(function(t){e(null,t)})});return r}},{key:"broadcastTransactionSynchronousWith",value:function(t,e){var r=t.trx;return this.send("network_broadcast_api",{method:"broadcast_transaction_synchronous",params:[r]},function(t,n){if(t){var i=l.ops.signed_transaction,o=i.toObject(r),a=i.toBuffer(r);t.digest=h.hash.sha256(a).toString("hex"),t.transaction_id=a.toString("hex"),t.transaction=JSON.stringify(o),e(t,"")}else e("",n)})}}]),e}(),y=new v(s.default);(t.exports=y).Steem=v},function(t,e,r){var n=r(85),i=r(11)("toStringTag"),o="Arguments"==n(function(){return arguments}());t.exports=function(t){var e,r,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?r:o?n(e):"Object"==(a=n(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,r){"use strict";var n=r(376)(!0);r(79)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){var n=r(19).f,i=r(42),o=r(11)("toStringTag");t.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},function(t,e,r){"use strict";var n=r(382),i=r(27),o=r(381),a=r(20),s=r(42),f=r(25),u=r(380),c=r(78),h=r(377),l=r(11)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,r,b,v,y,m){u(r,e,b);var g,_,w,E=function(t){if(!d&&t in A)return A[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},S=e+" Iterator",k="values"==v,x=!1,A=t.prototype,B=A[l]||A["@@iterator"]||v&&A[v],M=!d&&B||E(v),T=v?k?E("entries"):M:void 0,I="Array"==e&&A.entries||B;if(I&&(w=h(I.call(new t)))!==Object.prototype&&w.next&&(c(w,S,!0),n||s(w,l)||a(w,l,p)),k&&B&&"values"!==B.name&&(x=!0,M=function(){return B.call(this)}),n&&!m||!d&&!x&&A[l]||a(A,l,M),f[e]=M,f[S]=p,v)if(g={values:k?M:E("values"),keys:y?M:E("keys"),entries:T},m)for(_ in g)_ in A||o(A,_,g[_]);else i(i.P+i.F*(d||x),e,g);return g}},function(t,e,r){r(384);for(var n=r(15),i=r(20),o=r(25),a=r(11)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;f0?n:r)(t)}},function(t,e,r){var n=r(83),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){var n=r(159),i=r(87);t.exports=function(t){return n(i(t))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(87);t.exports=function(t){return Object(n(t))}},function(t,e,r){var n=r(191),i=r(187);t.exports=function(t,e){var r=i(t,e);return n(r)?r:void 0}},function(t,e,r){"use strict";var n,i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=r(202),a=(n=o)&&n.__esModule?n:{default:n},s=r(37);t.exports=function(t){function e(t,e){var r=parseFloat(t.vesting_shares.split(" ")[0]),n=parseFloat(e.total_vesting_shares.split(" ")[0]);return parseFloat(e.total_vesting_fund_steem.split(" ")[0])*(r/n)}function r(t,e){var r=t?t.reduce(function(t,e){return-1!==e.sell_price.base.indexOf("SBD")&&(t+=e.for_sale),t},0)/e:0;return{steemOrders:t?t.reduce(function(t,e){return-1!==e.sell_price.base.indexOf("STEEM")&&(t+=e.for_sale),t},0)/e:0,sbdOrders:r}}function n(t){var e=0,r=0;return t.forEach(function(t){var n=t.amount.split(" "),o=i(n,2),a=o[0],s=o[1];"STEEM"===s?e+=parseFloat(a):"SBD"===s&&(r+=parseFloat(a))}),{savings_pending:e,savings_sbd_pending:r}}return{reputation:function(t){if(null==t)return t;t=parseInt(t);var e=String(t),r="-"===e.charAt(0),n=e=r?e.substring(1):e,i=parseInt(n.substring(0,4)),o=Math.log(i)/Math.log(10),a=n.length-1+(o-parseInt(o));return isNaN(a)&&(a=0),a=Math.max(a-9,0),a=9*(a*=r?-1:1)+25,a=parseInt(a)},vestToSteem:function(t,e,r){return parseFloat(r)*(parseFloat(t)/parseFloat(e))},commentPermlink:function(t,e){var r=(new Date).toISOString().replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();return"re-"+t+"-"+(e=e.replace(/(-\d{8}t\d{9}z)/g,""))+"-"+r},amount:function(t,e){return t.toFixed(3)+" "+e},numberWithCommas:function(t){return t.replace(/\B(?=(\d{3})+(?!\d))/g,",")},vestingSteem:e,estimateAccountValue:function(i){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=o.gprops,f=o.feed_price,u=o.open_orders,c=o.savings_withdraws,h=o.vesting_steem,l=[],d=i.name,p=void 0,b=void 0;return h&&f||(s&&f?h=e(i,s):l.push(t.getStateAsync("/@{username}").then(function(t){s=t.props,f=t.feed_price,h=e(i,s)}))),u?p=r(u,1e3):l.push(t.getOpenOrdersAsync(d).then(function(t){p=r(t,1e3)})),c?b=n(c):l.push(t.getSavingsWithdrawFromAsync(d).then(function(t){b=n(t)})),Promise.all(l).then(function(){var t=void 0,e=f,r=e.base,n=e.quote;/ SBD$/.test(r)&&/ STEEM$/.test(n)&&(t=parseFloat(r.split(" ")[0]));var o=i.savings_balance,s=i.savings_sbd_balance,u=parseFloat(i.balance.split(" ")[0]),c=parseFloat(o.split(" ")[0]),l=parseFloat(i.sbd_balance),d=parseFloat(s.split(" ")[0]),v=0,y=(new Date).getTime();(i.other_history||[]).reduce(function(t,e){if("convert"!==(0,a.default)(e,[1,"op",0],""))return t;if(new Date((0,a.default)(e,[1,"timestamp"])).getTime()+3024e52&&void 0!==arguments[2]?arguments[2]:["owner","active","posting","memo"]).forEach(function(n){r[n]=this.toWif(t,e,n),r[n+"Pubkey"]=this.wifToPublic(r[n])}.bind(this)),r},p.isWif=function(t){var r=!1;try{var n=new e(i.decode(t)),o=n.slice(0,-4),a=n.slice(-4),s=d.sha256(o);s=(s=d.sha256(s)).slice(0,4),a.toString()==s.toString()&&(r=!0)}catch(t){}return r},p.toWif=function(t,r,n){var o=(t+n+r).trim().split(/[\t\n\v\f\r ]+/).join(" "),a=d.sha256(o),s=e.concat([new e([128]),a]),f=d.sha256(s);f=(f=d.sha256(f)).slice(0,4);var u=e.concat([s,f]);return i.encode(u)},p.wifIsValid=function(t,e){return this.wifToPublic(t)==e},p.wifToPublic=function(t){var e=h.fromWif(t);return e=e.toPublic().toString()},p.isPubkey=function(t,e){return null!=l.fromString(t,e)},p.signTransaction=function(t,r){var n=[];t.signatures&&(n=[].concat(t.signatures));var i=new e(f.get("chain_id"),"hex"),o=b.toBuffer(t);for(var a in r){var s=c.signBuffer(e.concat([i,o]),r[a]);n.push(s.toBuffer())}return v.toObject(Object.assign(t,{signatures:n}))},t.exports=p}).call(this,r(0).Buffer)},function(t,e,r){(function(e){var n=r(3);t.exports=function(t,r){return new e(t.toRed(n.mont(r.modulus)).redPow(new n(r.publicExponent)).fromRed().toArray())}}).call(this,r(0).Buffer)},function(t,e){t.exports=function(t,e){for(var r=t.length,n=-1;++n=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var f=1,u=n.length;u>=256;u>>=8)f++;(o=new i(2+f))[0]=a,o[1]=128|f;u=1+f;for(var c=n.length;c>0;u--,c>>=8)o[u]=255&c;return this._createEncoderBuffer([o,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new i(2*t.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),f=s.length-1;for(n=t.length-1;n>=0;n--){a=t[n];for(s[f--]=127&a;(a>>=7)>0;)s[f--]=128|127&a}return this._createEncoderBuffer(s)},u.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[c(n.getFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=new i(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var a=t;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function h(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},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>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),f=0;!s.testn(f);f++);for(var u=t.shrn(f),c=s.toRed(o);e>0;e--){var h=this._randrange(new n(2),s);r&&r(h);var l=h.toRed(o).redPow(u);if(0!==l.cmp(a)&&0!==l.cmp(c)){for(var d=1;d0;e--){var c=this._randrange(new n(2),a),h=t.gcd(c);if(0!==h.cmpn(1))return h;var l=c.toRed(i).redPow(f);if(0!==l.cmp(o)&&0!==l.cmp(u)){for(var d=1;dt;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(f),e.cmp(f)){if(!e.cmp(u))for(;r.mod(c).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(v(p=r.shrn(1))&&v(r)&&y(p)&&y(r)&&a.test(p)&&a.test(r))return r}}},function(t,e,r){var n=r(70),i=r(69),o=r(65),a=r(109),s=r(108),f=r(2).Buffer,u=f.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?i:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),s="sha512"===t||"sha384"===t?128:64;e.length>s?e=a(e):e.length=6?"utf-8":"binary";t.exports=r}).call(this,r(6))},function(t,e){var r=Math.pow(2,30)-1;t.exports=function(t,e){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof e)throw new TypeError("Key length not a number");if(e<0||e>r||e!=e)throw new TypeError("Bad key length")}},function(t,e,r){e.pbkdf2=r(261),e.pbkdf2Sync=r(107)},function(t){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(21),e.createHash=e.Hash=r(23),e.createHmac=e.Hmac=r(64);var n=r(262),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var a=r(110);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=r(260);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var f=r(252);e.DiffieHellmanGroup=f.DiffieHellmanGroup,e.createDiffieHellmanGroup=f.createDiffieHellmanGroup,e.getDiffieHellman=f.getDiffieHellman,e.createDiffieHellman=f.createDiffieHellman,e.DiffieHellman=f.DiffieHellman;var u=r(247);e.createSign=u.createSign,e.Sign=u.Sign,e.createVerify=u.createVerify,e.Verify=u.Verify,e.createECDH=r(209);var c=r(208);e.publicEncrypt=c.publicEncrypt,e.privateEncrypt=c.privateEncrypt,e.publicDecrypt=c.publicDecrypt,e.privateDecrypt=c.privateDecrypt;var h=r(205);e.randomFill=h.randomFill,e.randomFillSync=h.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e,r){"use strict";var n=o(r(117)),i=o(r(119));function o(t){return t&&t.__esModule?t:{default:t}}var a=n.default.uint16,s=n.default.uint32,f=n.default.int16,u=n.default.uint64,c=n.default.string,h=n.default.string_binary,l=n.default.bytes,d=n.default.bool,p=n.default.array,b=n.default.static_variant,v=n.default.map,y=n.default.set,m=n.default.public_key,g=n.default.time_point_sec,_=n.default.optional,w=n.default.asset,E=n.default.void,S=n.default.void,k=n.default.void,x=b();t.exports.operation=x;var A=function(e,r){var n=new i.default(e,r);return t.exports[e]=n},B=new A(0,{beneficiaries:y(new A("beneficiaries",{account:c,weight:a}))}),M=new A("signed_transaction",{ref_block_num:a,ref_block_prefix:s,expiration:g,operations:p(x),extensions:y(E),signatures:p(l(65))}),T=(new A("signed_block",{previous:l(20),timestamp:g,witness:c,transaction_merkle_root:l(20),extensions:y(b([E,k,S])),witness_signature:l(65),transactions:p(M)}),new A("block_header",{previous:l(20),timestamp:g,witness:c,transaction_merkle_root:l(20),extensions:y(b([E,k,S]))}),new A("signed_block_header",{previous:l(20),timestamp:g,witness:c,transaction_merkle_root:l(20),extensions:y(b([E,k,S])),witness_signature:l(65)})),I=new A("vote",{voter:c,author:c,permlink:c,weight:f}),j=new A("comment",{parent_author:c,parent_permlink:c,author:c,permlink:c,title:c,body:c,json_metadata:c}),C=new A("transfer",{from:c,to:c,amount:w,memo:c}),O=new A("transfer_to_vesting",{from:c,to:c,amount:w}),R=new A("withdraw_vesting",{account:c,vesting_shares:w}),P=new A("limit_order_create",{owner:c,orderid:s,amount_to_sell:w,min_to_receive:w,fill_or_kill:d,expiration:g}),L=new A("limit_order_cancel",{owner:c,orderid:s}),F=new A("price",{base:w,quote:w}),D=new A("feed_publish",{publisher:c,exchange_rate:F}),q=new A("convert",{owner:c,requestid:s,amount:w}),U=new A("authority",{weight_threshold:s,account_auths:v(c,a),key_auths:v(m,a)}),N=new A("account_create",{fee:w,creator:c,new_account_name:c,owner:U,active:U,posting:U,memo_key:m,json_metadata:c}),z=new A("account_update",{account:c,owner:_(U),active:_(U),posting:_(U),memo_key:m,json_metadata:c}),H=new A("witness_update",{owner:c,url:c,block_signing_key:m,props:new A("chain_properties",{account_creation_fee:w,maximum_block_size:s,sbd_interest_rate:a}),fee:w}),V=new A("account_witness_vote",{account:c,witness:c,approve:d}),K=new A("account_witness_proxy",{account:c,proxy:c}),W=new A("pow",{worker:m,input:l(32),signature:l(65),work:l(32)}),G=new A("custom",{required_auths:y(c),id:a,data:l()}),Y=new A("report_over_production",{reporter:c,first_block:T,second_block:T}),X=new A("delete_comment",{author:c,permlink:c}),Z=new A("custom_json",{required_auths:y(c),required_posting_auths:y(c),id:c,json:c}),J=new A("comment_options",{author:c,permlink:c,max_accepted_payout:w,percent_steem_dollars:a,allow_votes:d,allow_curation_rewards:d,extensions:y(b([B]))}),$=new A("set_withdraw_vesting_route",{from_account:c,to_account:c,percent:a,auto_vest:d}),Q=new A("limit_order_create2",{owner:c,orderid:s,amount_to_sell:w,exchange_rate:F,fill_or_kill:d,expiration:g}),tt=new A("challenge_authority",{challenger:c,challenged:c,require_owner:d}),et=new A("prove_authority",{challenged:c,require_owner:d}),rt=new A("request_account_recovery",{recovery_account:c,account_to_recover:c,new_owner_authority:U,extensions:y(E)}),nt=new A("recover_account",{account_to_recover:c,new_owner_authority:U,recent_owner_authority:U,extensions:y(E)}),it=new A("change_recovery_account",{account_to_recover:c,new_recovery_account:c,extensions:y(E)}),ot=new A("escrow_transfer",{from:c,to:c,sbd_amount:w,steem_amount:w,escrow_id:s,agent:c,fee:w,json_meta:c,ratification_deadline:g,escrow_expiration:g}),at=new A("escrow_dispute",{from:c,to:c,agent:c,who:c,escrow_id:s}),st=new A("escrow_release",{from:c,to:c,agent:c,who:c,receiver:c,escrow_id:s,sbd_amount:w,steem_amount:w}),ft=new A("pow2_input",{worker_account:c,prev_block:l(20),nonce:u}),ut=new A("pow2",{input:ft,pow_summary:s}),ct=(new A("equihash_pow",{input:ft,proof:new A("equihash_proof",{n:s,k:s,seed:l(32),inputs:p(s)}),prev_block:l(20),pow_summary:s}),new A("escrow_approve",{from:c,to:c,agent:c,who:c,escrow_id:s,approve:d})),ht=new A("transfer_to_savings",{from:c,to:c,amount:w,memo:c}),lt=new A("transfer_from_savings",{from:c,request_id:s,to:c,amount:w,memo:c}),dt=new A("cancel_transfer_from_savings",{from:c,request_id:s}),pt=new A("custom_binary",{required_owner_auths:y(c),required_active_auths:y(c),required_posting_auths:y(c),required_auths:p(U),id:c,data:l()}),bt=new A("decline_voting_rights",{account:c,decline:d}),vt=new A("reset_account",{reset_account:c,account_to_reset:c,new_owner_authority:U}),yt=new A("set_reset_account",{account:c,current_reset_account:c,reset_account:c}),mt=new A("claim_reward_balance",{account:c,reward_steem:w,reward_sbd:w,reward_vests:w}),gt=new A("delegate_vesting_shares",{delegator:c,delegatee:c,vesting_shares:w}),_t=new A("account_create_with_delegation",{fee:w,delegation:w,creator:c,new_account_name:c,owner:U,active:U,posting:U,memo_key:m,json_metadata:c,extensions:y(E)}),wt=new A("fill_convert_request",{owner:c,requestid:s,amount_in:w,amount_out:w}),Et=new A("author_reward",{author:c,permlink:c,sbd_payout:w,steem_payout:w,vesting_payout:w}),St=new A("curation_reward",{curator:c,reward:w,comment_author:c,comment_permlink:c}),kt=new A("comment_reward",{author:c,permlink:c,payout:w}),xt=new A("liquidity_reward",{owner:c,payout:w}),At=new A("interest",{owner:c,interest:w}),Bt=new A("fill_vesting_withdraw",{from_account:c,to_account:c,withdrawn:w,deposited:w}),Mt=new A("fill_order",{current_owner:c,current_orderid:s,current_pays:w,open_owner:c,open_orderid:s,open_pays:w}),Tt=new A("shutdown_witness",{owner:c}),It=new A("fill_transfer_from_savings",{from:c,to:c,amount:w,request_id:s,memo:c}),jt=new A("hardfork",{hardfork_id:s}),Ct=new A("comment_payout_update",{author:c,permlink:c}),Ot=new A("return_vesting_delegation",{account:c,vesting_shares:w}),Rt=new A("comment_benefactor_reward",{benefactor:c,author:c,permlink:c,reward:w});x.st_operations=[I,j,C,O,R,P,L,D,q,N,z,H,V,K,W,G,Y,X,Z,J,$,Q,tt,et,rt,nt,it,ot,at,st,ut,ct,ht,lt,dt,pt,bt,vt,yt,mt,gt,_t,wt,Et,St,kt,xt,At,Bt,Mt,Tt,It,jt,Ct,Ot,Rt];new A("transaction",{ref_block_num:a,ref_block_prefix:s,expiration:g,operations:p(x),extensions:y(E)}),new A("encrypted_memo",{from:m,to:m,nonce:u,check:s,encrypted:h})},function(t,e,r){"use strict";var n;t.exports=n={},n.reserved_spaces={relative_protocol_ids:0,protocol_ids:1,implementation_ids:2},n.operations={vote:0,comment:1,transfer:2,transfer_to_vesting:3,withdraw_vesting:4,limit_order_create:5,limit_order_cancel:6,feed_publish:7,convert:8,account_create:9,account_update:10,witness_update:11,account_witness_vote:12,account_witness_proxy:13,pow:14,custom:15,report_over_production:16,delete_comment:17,custom_json:18,comment_options:19,set_withdraw_vesting_route:20,limit_order_create2:21,challenge_authority:22,prove_authority:23,request_account_recovery:24,recover_account:25,change_recovery_account:26,escrow_transfer:27,escrow_dispute:28,escrow_release:29,pow2:30,escrow_approve:31,transfer_to_savings:32,transfer_from_savings:33,cancel_transfer_from_savings:34,custom_binary:35,decline_voting_rights:36,reset_account:37,set_reset_account:38,claim_reward_balance:39,delegate_vesting_shares:40,account_create_with_delegation:41,fill_convert_request:42,author_reward:43,curation_reward:44,comment_reward:45,liquidity_reward:46,interest:47,fill_vesting_withdraw:48,fill_order:49,shutdown_witness:50,fill_transfer_from_savings:51,hardfork:52,comment_payout_update:53,return_vesting_delegation:54,comment_benefactor_reward:55},n.object_type={null:0,base:1}},function(t,e,r){"use strict";var n,i,o,a,s,f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u=r(34).Long,c=r(114);t.exports=n={is_empty:i=function(t){return null===t||void 0===t},required:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(i(t))throw new Error("value required "+e+" "+t);return t},require_long:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!u.isLong(t))throw new Error("Long value required "+e+" "+t);return t},string:function(t){if(i(t))return t;if("string"!=typeof t)throw new Error("string required: "+t);return t},number:function(t){if(i(t))return t;if("number"!=typeof t)throw new Error("number required: "+t);return t},whole_number:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(i(t))return t;if(/\./.test(t))throw new Error("whole number required "+e+" "+t);return t},unsigned:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(i(t))return t;if(/-/.test(t))throw new Error("unsigned required "+e+" "+t);return t},is_digits:function(t){return"numeric"==typeof t||/^[0-9]+$/.test(t)},to_number:o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return i(t)?t:(n.no_overflow53(t,e),"number"==typeof t?t:parseInt(t))},to_long:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return i(t)?t:u.isLong(t)?t:(n.no_overflow64(t,e),"number"==typeof t&&(t=""+t),u.fromString(t))},to_string:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(i(t))return t;if("string"==typeof t)return t;if("number"==typeof t)return n.no_overflow53(t,e),""+t;if(u.isLong(t))return t.toString();throw"unsupported type "+e+": ("+(void 0===t?"undefined":f(t))+") "+t},require_test:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(i(e))return e;if(!t.test(e))throw new Error("unmatched "+t+" "+r+" "+e);return e},require_match:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(i(e))return e;var n=e.match(t);if(null===n)throw new Error("unmatched "+t+" "+r+" "+e);return n},require_range:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(i(r))return r;o(r);if(re)throw new Error("out of range "+r+" "+n+" "+r);return r},require_object_type:a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments[1],r=arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if(i(r))return r;var o=c.object_type[e];if(!o)throw new Error("Unknown object type: "+e+", "+n+", "+r);if(!new RegExp(t+"."+o+".[0-9]+$").test(r))throw new Error("Expecting "+e+" in format "+t+"."+o+".[0-9]+ instead of "+r+" "+n+" "+r);return r},get_instance:function(t,e,r,n){return i(r)?r:(a(t,e,r,n),o(r.split(".")[2]))},require_relative_type:function(t,e,r){return a(0,t,e,r),e},get_relative_instance:function(t,e,r){return i(e)?e:(a(0,t,e,r),o(e.split(".")[2]))},require_protocol_type:function(t,e,r){return a(1,t,e,r),e},get_protocol_instance:function(t,e,r){return i(e)?e:(a(1,t,e,r),o(e.split(".")[2]))},get_protocol_type:s=function(t,e){if(i(t))return t;(void 0)(t,e);var r=t.split(".");return o(r[1])},get_protocol_type_name:function(t,e){if(i(t))return t;var r=s(t,e);return Object.keys(c.object_type)[r]},require_implementation_type:function(t,e,r){return a(2,t,e,r),e},get_implementation_instance:function(t,e,r){return i(e)?e:(a(2,t,e,r),o(e.split(".")[2]))},no_overflow53:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("number"!=typeof t)if("string"!=typeof t){if(!u.isLong(t))throw"unsupported type "+e+": ("+(void 0===t?"undefined":f(t))+") "+t;n.no_overflow53(t.toInt(),e)}else{parseInt(t);if(t>9007199254740991||t<-9007199254740991)throw new Error("overflow "+e+" "+t)}else if(t>9007199254740991||t<-9007199254740991)throw new Error("overflow "+e+" "+t)},no_overflow64:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!u.isLong(t))if(void 0===t.t||void 0===t.s)if("string"!=typeof t){if("number"!=typeof t)throw"unsupported type "+e+": ("+(void 0===t?"undefined":f(t))+") "+t;if(t>9007199254740991||t<-9007199254740991)throw new Error("overflow "+e+" "+t)}else{for(t=t.replace(/^0+/,"");/0$/.test(t);)t=t.substring(0,t.length-1);if(/\.$/.test(t)&&(t=t.substring(0,t.length-1)),""===t&&(t="0"),u.fromString(t).toString()!==t.trim())throw new Error("overflow "+e+" "+t)}else n.no_overflow64(t.toString(),e)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.toImpliedDecimal=function(t,e){"number"==typeof t?((0,s.default)(t<=9007199254740991,"overflow"),t=""+t):t.toString&&(t=t.toString());(0,s.default)("string"==typeof t,"number should be an actual number or string: "+(void 0===t?"undefined":i(t))),t=t.trim(),(0,s.default)(/^[0-9]*\.?[0-9]*$/.test(t),"Invalid decimal number "+t);var r=t.split("."),o=n(r,2),a=o[0],f=void 0===a?"":a,u=o[1],c=void 0===u?"":u,h=e-c.length;(0,s.default)(h>=0,"Too many decimal digits in "+t+" to create an implied decimal of "+e);for(var l=0;l6)throw new Error("Symbols are not longer than 6 characters "+a+"-"+a.length);t.writeInt64(f.to_long(i.replace(".","")));var s=i.indexOf("."),u=-1===s?0:i.length-s-1;t.writeUint8(u),t.append(a.toUpperCase(),"binary");for(var c=0;c<7-a.length;c++)t.writeUint8(0)},fromObject:function(t){return t},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?"0.000 STEEM":t}},l.uint8={fromByteBuffer:function(t){return t.readUint8()},appendByteBuffer:function(t,e){f.require_range(0,255,e,"uint8 "+e),t.writeUint8(e)},fromObject:function(t){return f.require_range(0,255,t,"uint8 "+t),t},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?0:(f.require_range(0,255,t,"uint8 "+t),parseInt(t))}},l.uint16={fromByteBuffer:function(t){return t.readUint16()},appendByteBuffer:function(t,e){f.require_range(0,65535,e,"uint16 "+e),t.writeUint16(e)},fromObject:function(t){return f.require_range(0,65535,t,"uint16 "+t),t},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?0:(f.require_range(0,65535,t,"uint16 "+t),parseInt(t))}},l.uint32={fromByteBuffer:function(t){return t.readUint32()},appendByteBuffer:function(t,e){f.require_range(0,4294967295,e,"uint32 "+e),t.writeUint32(e)},fromObject:function(t){return f.require_range(0,4294967295,t,"uint32 "+t),t},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?0:(f.require_range(0,4294967295,t,"uint32 "+t),parseInt(t))}};var p=-1*Math.pow(2,31),b=Math.pow(2,31)-1;l.varint32={fromByteBuffer:function(t){return t.readVarint32()},appendByteBuffer:function(t,e){f.require_range(p,b,e,"uint32 "+e),t.writeVarint32(e)},fromObject:function(t){return f.require_range(p,b,t,"uint32 "+t),t},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?0:(f.require_range(p,b,t,"uint32 "+t),parseInt(t))}},l.int16={fromByteBuffer:function(t){return t.readInt16()},appendByteBuffer:function(t,e){t.writeInt16(e)},fromObject:function(t){return t},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?0:parseInt(t)}},l.int64={fromByteBuffer:function(t){return t.readInt64()},appendByteBuffer:function(t,e){f.required(e),t.writeInt64(f.to_long(e))},fromObject:function(t){return f.required(t),f.to_long(t)},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?"0":(f.required(t),f.to_long(t).toString())}},l.uint64={fromByteBuffer:function(t){return t.readUint64()},appendByteBuffer:function(t,e){t.writeUint64(f.to_long(f.unsigned(e)))},fromObject:function(t){return f.to_long(f.unsigned(t))},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?"0":f.to_long(t).toString()}},l.string={fromByteBuffer:function(t){return new n(t.readVString(),"utf8")},appendByteBuffer:function(t,e){f.required(e),t.writeVString(e.toString())},fromObject:function(t){return f.required(t),new n(t,"utf8")},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?"":t.toString("utf8")}},l.string_binary={fromByteBuffer:function(t){var e,r=t.readVarint32();return e=t.copy(t.offset,t.offset+r),t.skip(r),new n(e.toBinary(),"binary")},appendByteBuffer:function(t,e){t.writeVarint32(e.length),t.append(e.toString("binary"),"binary")},fromObject:function(t){return f.required(t),new n(t)},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?"":t.toString()}},l.bytes=function(t){return{fromByteBuffer:function(e){if(void 0===t){var r,i=e.readVarint32();return r=e.copy(e.offset,e.offset+i),e.skip(i),new n(r.toBinary(),"binary")}return r=e.copy(e.offset,e.offset+t),e.skip(t),new n(r.toBinary(),"binary")},appendByteBuffer:function(e,r){f.required(r),"string"==typeof r&&(r=new n(r,"hex")),void 0===t&&e.writeVarint32(r.length),e.append(r.toString("binary"),"binary")},fromObject:function(t){return f.required(t),n.isBuffer(t)?t:new n(t,"hex")},toObject:function(e){if((arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===e){return new Array(t).join("00")}return f.required(e),e.toString("hex")}}},l.bool={fromByteBuffer:function(t){return 1===t.readUint8()},appendByteBuffer:function(t,e){t.writeUint8(JSON.parse(e)?1:0)},fromObject:function(t){return!!JSON.parse(t)},toObject:function(t){return(!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default||void 0!==t)&&!!JSON.parse(t)}},l.void={fromByteBuffer:function(t){throw new Error("(void) undefined type")},appendByteBuffer:function(t,e){throw new Error("(void) undefined type")},fromObject:function(t){throw new Error("(void) undefined type")},toObject:function(t){if(!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default||void 0!==t)throw new Error("(void) undefined type")}},l.array=function(t){return{fromByteBuffer:function(e){var r=e.readVarint32();d&&console.log("varint32 size = "+r.toString(16));for(var n=[],i=0;0r;i++)n.push(t.fromByteBuffer(e));return m(n,t)},appendByteBuffer:function(e,r){f.required(r),r=m(r,t),e.writeVarint32(r.length);for(var n,i=0;i1&&void 0!==arguments[1]?arguments[1]:{};if(r.use_default&&void 0===e)return[t.toObject(e,r)];f.required(e),e=m(e,t);for(var n,i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t)return new Date(0).toISOString().split(".")[0];if(f.required(t),"string"==typeof t)return t;if(t.getTime)return t.toISOString().split(".")[0];var e=parseInt(t);return f.require_range(0,4294967295,e,"uint32 "+t),new Date(1e3*e).toISOString().split(".")[0]}},l.set=function(t){return{validate:function(e){for(var r,n={},o=0;o=0){if(void 0!==n[r])throw new Error("duplicate (set)");n[r]=!0}}return m(e,t)},fromByteBuffer:function(e){var r=e.readVarint32();return d&&console.log("varint32 size = "+r.toString(16)),this.validate(function(){for(var n=[],i=0;0r;i++)n.push(t.fromByteBuffer(e));return n}())},appendByteBuffer:function(e,r){r||(r=[]),e.writeVarint32(r.length);for(var n,i=this.validate(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};return r.use_default&&void 0===e?[t.toObject(e,r)]:(e||(e=[]),this.validate(function(){for(var n,i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:{},i=h.object_type[r];return n.use_default&&void 0===t?e+"."+i+".0":(f.required(t),void 0!==t.resolve&&(t=t.resolve),/^[0-9]+\.[0-9]+\.[0-9]+$/.test(t)&&(t=f.get_instance(e,r,t)),e+"."+i+"."+t)}};var e,r},l.object_id_type={fromByteBuffer:function(t){return u.fromByteBuffer(t)},appendByteBuffer:function(t,e){f.required(e),void 0!==e.resolve&&(e=e.resolve),(e=u.fromString(e)).appendByteBuffer(t)},fromObject:function(t){return f.required(t),void 0!==t.resolve&&(t=t.resolve),u.fromString(t)},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?"0.0.0":(f.required(t),void 0!==t.resolve&&(t=t.resolve),(t=u.fromString(t)).toString())}},l.vote_id={TYPE:255,ID:4294967040,fromByteBuffer:function(t){var e=t.readUint32();return{type:e&this.TYPE,id:e&this.ID}},appendByteBuffer:function(t,e){f.required(e),"string"===e&&(e=l.vote_id.fromObject(e));var r=e.id<<8|e.type;t.writeUint32(r)},fromObject:function(t){if(f.required(t,"(type vote_id)"),"object"===(void 0===t?"undefined":i(t)))return f.required(t.type,"type"),f.required(t.id,"id"),t;f.require_test(/^[0-9]+:[0-9]+$/,t,"vote_id format "+t);var e=t.split(":"),r=o(e,2),n=r[0],a=r[1];return f.require_range(0,255,n,"vote type "+t),f.require_range(0,16777215,a,"vote id "+t),{type:n,id:a}},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?"0:0":(f.required(t),"string"==typeof t&&(t=l.vote_id.fromObject(t)),t.type+":"+t.id)},compare:function(t,e){return"object"!==(void 0===t?"undefined":i(t))&&(t=l.vote_id.fromObject(t)),"object"!==(void 0===e?"undefined":i(e))&&(e=l.vote_id.fromObject(e)),parseInt(t.id)-parseInt(e.id)}},l.optional=function(t){return f.required(t,"st_operation"),{fromByteBuffer:function(e){if(1===e.readUint8())return t.fromByteBuffer(e)},appendByteBuffer:function(e,r){null!==r&&void 0!==r?(e.writeUint8(1),t.appendByteBuffer(e,r)):e.writeUint8(0)},fromObject:function(e){if(void 0!==e)return t.fromObject(e)},toObject:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.use_default||void 0!==e?t.toObject(e,r):void 0;return r.annotate&&("object"===(void 0===n?"undefined":i(n))?n.__optional="parent is optional":n={__optional:n}),n}}},l.static_variant=function(t){return{nosort:!0,st_operations:t,opTypeId:function(t){var e=0,r=void 0;if("number"==typeof t)r=t;else{var n=!0,i=!1,o=void 0;try{for(var a,s=this.st_operations[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){if(a.value.operation_name===t){r=e;break}e++}}catch(t){i=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}}return r},fromByteBuffer:function(t){var e=t.readVarint32(),r=this.st_operations[e];return d&&console.error("static_variant id 0x"+e.toString(16)+" ("+e+")"),f.required(r,"operation "+e),[e,r.fromByteBuffer(t)]},appendByteBuffer:function(t,e){f.required(e);var r=this.opTypeId(e[0]),n=this.st_operations[r];f.required(n,"operation "+r),t.writeVarint32(r),n.appendByteBuffer(t,e[1])},fromObject:function(t){f.required(t);var e=this.opTypeId(t[0]),r=this.st_operations[e];return f.required(r,"operation "+e),[e,r.fromObject(t[1])]},toObject:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.use_default&&void 0===t)return[this.st_operations[0].operation_name,this.st_operations[0].toObject(void 0,e)];f.required(t);var r=this.opTypeId(t[0]),n=this.st_operations[r];return f.required(n,"operation "+r),[n.operation_name,n.toObject(t[1],e)]},compare:function(t,e){return v(this.opTypeId(t[0]),this.opTypeId(e[0]))}}},l.map=function(t,e){return{validate:function(e){if(!Array.isArray(e))throw new Error("expecting array");for(var r,n={},o=0;o=0){if(void 0!==n[r[0]])throw new Error("duplicate (map)");n[r[0]]=!0}}return m(e,t)},fromByteBuffer:function(r){for(var n=[],i=r.readVarint32(),o=0;0i;o++)n.push([t.fromByteBuffer(r),e.fromByteBuffer(r)]);return this.validate(n)},appendByteBuffer:function(r,n){this.validate(n),r.writeVarint32(n.length);for(var i,o=0;o1&&void 0!==arguments[1]?arguments[1]:{};if(n.use_default&&void 0===r)return[[t.toObject(void 0,n),e.toObject(void 0,n)]];f.required(r),r=this.validate(r);for(var i,o=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?a.ecc_config.get("address_prefix")+"859gxfnXyUriMgUeThh1fWv3oqcpLFyHa3TfFYC4PK2HqhToVM":(f.required(t),t.toString())},compare:function(t,e){return 1*v(t.toString(),e.toString())}},l.address={_to_address:function(t){return f.required(t),t.addy?t:a.Address.fromString(t)},fromByteBuffer:function(t){return new a.Address(c.ripemd160(t))},appendByteBuffer:function(t,e){c.ripemd160(t,l.address._to_address(e).toBuffer())},fromObject:function(t){return l.address._to_address(t)},toObject:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).use_default&&void 0===t?a.ecc_config.get("address_prefix")+"664KmHxSuQyDsfwo4WEJvWpzg1QKdg67S":l.address._to_address(t).toString()},compare:function(t,e){return-1*v(t.toString(),e.toString())}};var v=function(t,e){return t>e?1:to.length;)t.writeUint8(0)}}},{key:"public_key",value:function(e,r){if(e){if(!r)return n=t.fixed_data(e,33),i.PublicKey.fromBuffer(n);var n=r.toBuffer();e.append(n.toString("binary"),"binary")}}},{key:"ripemd160",value:function(e,r){if(e)return r?void t.fixed_data(e,20,r):t.fixed_data(e,20)}},{key:"time_point_sec",value:function(t,e){return e?(e=Math.ceil(e/1e3),void t.writeInt32(e)):(e=t.readInt32(),new Date(1e3*e))}}]),t}();t.exports=o}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e,n){var i=function(){function t(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{use_default:!1,annotate:!1},r={},n=null;try{if(!this.types)return r;for(var i=this.keys,f=0;fu?1:f=0)return!1;if(r.signum()<0||r.compareTo(o)>=0)return!1;var a=r.square().mod(o),s=e.pow(3).add(n.multiply(e)).add(i).mod(o);return a.equals(s)},a.prototype.validate=function(t){n(!this.isInfinity(t),"Point is at infinity"),n(this.isOnCurve(t),"Point is not on the curve");var e=t.multiply(this.n);return n(this.isInfinity(e),"Point is not a scalar multiple of G"),!0},t.exports=a},function(t,e,r){var n=r(8),i=r(2).Buffer,o=r(10),a=o.valueOf(3);function s(t,e,r,i){n.notStrictEqual(i,void 0,"Missing Z coordinate"),this.curve=t,this.x=e,this.y=r,this.z=i,this._zInv=null,this.compressed=!0}Object.defineProperty(s.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(s.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(s.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),s.fromAffine=function(t,e,r){return new s(t,e,r,o.ONE)},s.prototype.equals=function(t){return t===this||(this.curve.isInfinity(this)?this.curve.isInfinity(t):this.curve.isInfinity(t)?this.curve.isInfinity(this):0===t.y.multiply(this.z).subtract(this.y.multiply(t.z)).mod(this.curve.p).signum()&&0===t.x.multiply(this.z).subtract(this.x.multiply(t.z)).mod(this.curve.p).signum())},s.prototype.negate=function(){var t=this.curve.p.subtract(this.y);return new s(this.curve,this.x,t,this.z)},s.prototype.add=function(t){if(this.curve.isInfinity(this))return t;if(this.curve.isInfinity(t))return this;var e=this.x,r=this.y,n=t.x,i=t.y.multiply(this.z).subtract(r.multiply(t.z)).mod(this.curve.p),o=n.multiply(this.z).subtract(e.multiply(t.z)).mod(this.curve.p);if(0===o.signum())return 0===i.signum()?this.twice():this.curve.infinity;var f=o.square(),u=f.multiply(o),c=e.multiply(f),h=i.square().multiply(this.z),l=h.subtract(c.shiftLeft(1)).multiply(t.z).subtract(u).multiply(o).mod(this.curve.p),d=c.multiply(a).multiply(i).subtract(r.multiply(u)).subtract(h.multiply(i)).multiply(t.z).add(i.multiply(u)).mod(this.curve.p),p=u.multiply(this.z).multiply(t.z).mod(this.curve.p);return new s(this.curve,l,d,p)},s.prototype.twice=function(){if(this.curve.isInfinity(this))return this;if(0===this.y.signum())return this.curve.infinity;var t=this.x,e=this.y,r=e.multiply(this.z).mod(this.curve.p),n=r.multiply(e).mod(this.curve.p),i=this.curve.a,o=t.square().multiply(a);0!==i.signum()&&(o=o.add(this.z.square().multiply(i)));var f=(o=o.mod(this.curve.p)).square().subtract(t.shiftLeft(3).multiply(n)).shiftLeft(1).multiply(r).mod(this.curve.p),u=o.multiply(a).multiply(t).subtract(n.shiftLeft(1)).shiftLeft(2).multiply(n).subtract(o.pow(3)).mod(this.curve.p),c=r.pow(3).shiftLeft(3).mod(this.curve.p);return new s(this.curve,f,u,c)},s.prototype.multiply=function(t){if(this.curve.isInfinity(this))return this;if(0===t.signum())return this.curve.infinity;for(var e=t,r=e.multiply(a),n=this.negate(),i=this,o=r.bitLength()-2;o>0;--o){var s=r.testBit(o),f=e.testBit(o);i=i.twice(),s!==f&&(i=i.add(s?this:n))}return i},s.prototype.multiplyTwo=function(t,e,r){for(var n=Math.max(t.bitLength(),r.bitLength())-1,i=this.curve.infinity,o=this.add(e);n>=0;){var a=t.testBit(n),s=r.testBit(n);i=i.twice(),a?i=s?i.add(o):i.add(this):s&&(i=i.add(e)),--n}return i},s.prototype.getEncoded=function(t){if(null==t&&(t=this.compressed),this.curve.isInfinity(this))return i.alloc(1,0);var e,r=this.affineX,n=this.affineY,o=this.curve.pLength;return t?(e=i.allocUnsafe(1+o)).writeUInt8(n.isEven()?2:3,0):((e=i.allocUnsafe(1+o+o)).writeUInt8(4,0),n.toBuffer(o).copy(e,1+o)),r.toBuffer(o).copy(e,1),e},s.decodeFrom=function(t,e){var r,i=e.readUInt8(0),a=4!==i,f=Math.floor((t.p.bitLength()+7)/8),u=o.fromBuffer(e.slice(1,1+f));if(a){n.equal(e.length,f+1,"Invalid sequence length"),n(2===i||3===i,"Invalid sequence tag");var c=3===i;r=t.pointFromX(c,u)}else{n.equal(e.length,1+f+f,"Invalid sequence length");var h=o.fromBuffer(e.slice(1+f));r=s.fromAffine(t,u,h)}return r.compressed=a,r},s.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},t.exports=s},function(t,e,r){function n(t,e,r){if(!(this instanceof n))return new n(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))}var i=n.prototype;i.__bigi=r(275).version,n.isBigInteger=function(t,e){return t&&t.__bigi&&(!e||t.__bigi===i.__bigi)},n.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var a=e*this[t++]+r[n]+i;i=Math.floor(a/67108864),r[n++]=67108863&a}return i},n.prototype.DB=26,n.prototype.DM=67108863;var o=n.prototype.DV=1<<26;n.prototype.FV=Math.pow(2,52),n.prototype.F1=26,n.prototype.F2=0;var a,s,f="0123456789abcdefghijklmnopqrstuvwxyz",u=new Array;for(a="0".charCodeAt(0),s=0;s<=9;++s)u[a++]=s;for(a="a".charCodeAt(0),s=10;s<36;++s)u[a++]=s;for(a="A".charCodeAt(0),s=10;s<36;++s)u[a++]=s;function c(t){return f.charAt(t)}function h(t,e){var r=u[t.charCodeAt(e)];return null==r?-1:r}function l(t){var e=new 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 p(t){this.m=t}function b(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=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 E(){}function S(t){return t}function k(t){this.r2=new n,this.q3=new n,n.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}p.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},p.prototype.revert=function(t){return t},p.prototype.reduce=function(t){t.divRemTo(this.m,null,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)},b.prototype.convert=function(t){var e=new n;return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(n.ZERO)>0&&this.m.subTo(e,e),e},b.prototype.revert=function(t){var e=new n;return t.copyTo(e),this.reduce(e),e},b.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;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),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},b.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},b.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},i.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},i.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+o:this.t=0},i.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var s=8==r?255&t[i]:h(t,i);s<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<>this.DB-a):this[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},i.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},i.drShiftTo=function(t,e){for(var r=t;r=0;--r)e[r+a+1]=this[r]>>i|s,s=(this[r]&o)<=0;--r)e[r]=0;e[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},i.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;for(var a=r+1;a>n;n>0&&(e[this.t-r-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},i.multiplyTo=function(t,e){var r=this.abs(),i=t.abs(),o=r.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},i.divRemTo=function(t,e,r){var i=t.abs();if(!(i.t<=0)){var o=this.abs();if(o.t0?(i.lShiftTo(u,a),o.lShiftTo(u,r)):(i.copyTo(a),o.copyTo(r));var c=a.t,h=a[c-1];if(0!=h){var l=h*(1<1?a[c-2]>>this.F2:0),p=this.FV/l,b=(1<=0&&(r[r.t++]=1,r.subTo(g,r)),n.ONE.dlShiftTo(c,g),g.subTo(a,a);a.t=0;){var _=r[--y]==h?this.DM:Math.floor(r[y]*p+(r[y-1]+v)*b);if((r[y]+=a.am(0,_,r,m,0,c))<_)for(a.dlShiftTo(m,g),r.subTo(g,r);r[y]<--_;)r.subTo(g,r)}null!=e&&(r.drShiftTo(c,e),s!=f&&n.ZERO.subTo(e,e)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&n.ZERO.subTo(r,r)}}},i.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(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)>0?this.DV-e:-e},i.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},i.exp=function(t,e){if(t>4294967295||t<1)return n.ONE;var r=new n,i=new n,o=e.convert(this),a=d(t)-1;for(o.copyTo(r);--a>=0;)if(e.sqrTo(r,i),(t&1<0)e.mulTo(i,o,r);else{var s=r;r=i,i=s}return e.revert(r)},i.toString=function(t){var e;if(this.s<0)return"-"+this.negate().toString(t);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<0)for(s>s)>0&&(i=!0,o=c(r));a>=0;)s>(s+=this.DB-e)):(r=this[a]>>(s-=e)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=c(r));return i?o:"0"},i.negate=function(){var t=new n;return n.ZERO.subTo(this,t),t},i.abs=function(){return this.s<0?this.negate():this},i.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(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},i.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this[this.t-1]^this.s&this.DM)},i.byteLength=function(){return this.bitLength()>>3},i.mod=function(t){var e=new n;return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(n.ZERO)>0&&t.subTo(e,e),e},i.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new p(e):new b(e),this.exp(t,r)},E.prototype.convert=S,E.prototype.revert=S,E.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},E.prototype.sqrTo=function(t,e){t.squareTo(e)},k.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=new n;return t.copyTo(e),this.reduce(e),e},k.prototype.revert=function(t){return t},k.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);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},k.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},k.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var x=[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],A=(1<<26)/x[x.length-1];i.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},i.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=l(r),o=new n,a=new n,s="";for(this.divRemTo(i,o,a);o.signum()>0;)s=(r+a.intValue()).toString(t).substr(1)+s,o.divRemTo(i,o,a);return a.intValue().toString(t)+s},i.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),i=Math.pow(e,r),o=!1,a=0,s=0,f=0;f=r&&(this.dMultiply(i),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),o&&n.ZERO.subTo(this,this)},i.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(n.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(n.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},i.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},i.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]}},i.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i=0;)r[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},i.millerRabin=function(t){var e=this.subtract(n.ONE),r=e.getLowestSetBit();if(r<=0)return!1;var i=e.shiftRight(r);(t=t+1>>1)>x.length&&(t=x.length);for(var o=new n(null),a=[],s=0;s>24},i.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},i.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},i.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(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<=0;)n<8?(r=(this[t]&(1<>(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,(i>0||r!=this.s)&&(e[i++]=r);return e},i.equals=function(t){return 0==this.compareTo(t)},i.min=function(t){return this.compareTo(t)<0?this:t},i.max=function(t){return this.compareTo(t)>0?this:t},i.and=function(t){var e=new n;return this.bitwiseTo(t,v,e),e},i.or=function(t){var e=new n;return this.bitwiseTo(t,y,e),e},i.xor=function(t){var e=new n;return this.bitwiseTo(t,m,e),e},i.andNot=function(t){var e=new n;return this.bitwiseTo(t,g,e),e},i.not=function(){for(var t=new n,e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var h=new n;for(i.sqrTo(s[1],h);f<=c;)s[f]=new n,i.mulTo(h,s[f-2],s[f]),f+=2}var v,y,m=t.t-1,g=!0,_=new n;for(o=d(t[m])-1;m>=0;){for(o>=u?v=t[m]>>o-u&c:(v=(t[m]&(1<0&&(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)s[v].copyTo(a),g=!1;else{for(;f>1;)i.sqrTo(a,_),i.sqrTo(_,a),f-=2;f>0?i.sqrTo(a,_):(y=a,a=_,_=y),i.mulTo(_,s[v],a)}for(;m>=0&&0==(t[m]&1<=0?(r.subTo(i,r),e&&o.subTo(s,o),a.subTo(f,a)):(i.subTo(r,i),e&&s.subTo(o,s),f.subTo(a,f))}if(0!=i.compareTo(n.ONE))return n.ZERO;for(;f.compareTo(t)>=0;)f.subTo(t,f);for(;f.signum()<0;)f.addTo(t,f);return f},i.pow=function(t){return this.exp(t,new E)},i.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(i0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},i.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=x[x.length-1]){for(e=0;e>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function v(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0>>0?1:0}n(f,i),f.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},f.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,f=0|this._fh,m=0|this._gh,g=0|this._hh,_=0|this._al,w=0|this._bl,E=0|this._cl,S=0|this._dl,k=0|this._el,x=0|this._fl,A=0|this._gl,B=0|this._hl,M=0;M<32;M+=2)e[M]=t.readInt32BE(4*M),e[M+1]=t.readInt32BE(4*M+4);for(;M<160;M+=2){var T=e[M-30],I=e[M-30+1],j=d(T,I),C=p(I,T),O=b(T=e[M-4],I=e[M-4+1]),R=v(I,T),P=e[M-14],L=e[M-14+1],F=e[M-32],D=e[M-32+1],q=C+L|0,U=j+P+y(q,C)|0;U=(U=U+O+y(q=q+R|0,R)|0)+F+y(q=q+D|0,D)|0,e[M]=U,e[M+1]=q}for(var N=0;N<160;N+=2){U=e[N],q=e[N+1];var z=c(r,n,i),H=c(_,w,E),V=h(r,_),K=h(_,r),W=l(s,k),G=l(k,s),Y=a[N],X=a[N+1],Z=u(s,f,m),J=u(k,x,A),$=B+G|0,Q=g+W+y($,B)|0;Q=(Q=(Q=Q+Z+y($=$+J|0,J)|0)+Y+y($=$+X|0,X)|0)+U+y($=$+q|0,q)|0;var tt=K+H|0,et=V+z+y(tt,K)|0;g=m,B=A,m=f,A=x,f=s,x=k,s=o+Q+y(k=S+$|0,S)|0,o=i,S=E,i=n,E=w,n=r,w=_,r=Q+et+y(_=$+tt|0,$)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+A|0,this._hl=this._hl+B|0,this._ah=this._ah+r+y(this._al,_)|0,this._bh=this._bh+n+y(this._bl,w)|0,this._ch=this._ch+i+y(this._cl,E)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+s+y(this._el,k)|0,this._fh=this._fh+f+y(this._fl,x)|0,this._gh=this._gh+m+y(this._gl,A)|0,this._hh=this._hh+g+y(this._hl,B)|0},f.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=f},function(t,e,r){var n=r(1),i=r(22),o=r(2).Buffer,a=[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],s=new Array(64);function f(){this.init(),this._w=s,i.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function h(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(f,i),f.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},f.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,f=0|this._e,p=0|this._f,b=0|this._g,v=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+d(r[y-15])+r[y-16];for(var m=0;m<64;++m){var g=v+l(f)+u(f,p,b)+a[m]+r[m]|0,_=h(n)+c(n,i,o)|0;v=b,b=p,p=f,f=s+g|0,s=o,o=i,i=n,n=g+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=f+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=v+this._h|0},f.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=f},function(t,e,r){"use strict";t.exports=o;var n=r(16),i=r(36);function o(t){if(!(this instanceof o))return new o(t);n.call(this,t),this._transformState={afterTransform:function(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):A(t,a)):w(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=E?t=E:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i(x,t):x(t))}function x(t){d("emit readable"),t.emit("readable"),I(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i(B,t,e))}function B(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=u.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function C(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i(O,e,t))}function O(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):k(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&C(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t0?j(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&C(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var f=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?c:g;function u(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",y),t.removeListener("finish",m),t.removeListener("drain",h),t.removeListener("error",v),t.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",g),r.removeListener("data",b),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){d("onend"),t.end()}o.endEmitted?i(f):r.once("end",f),t.on("unpipe",u);var h=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,I(t))}}(r);t.on("drain",h);var l=!1;var p=!1;function b(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(e){d("onerror",e),g(),t.removeListener("error",v),0===s(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",m),g()}function m(){d("onfinish"),t.removeListener("close",y),g()}function g(){d("unpipe"),r.unpipe(t)}return r.on("data",b),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",v),t.once("close",y),t.once("finish",m),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},g.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return r.options=t,r.id=0,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.default),n(e,[{key:"setOptions",value:function(t){Object.assign(this.options,t),this.stop()}},{key:"listenTo",value:function(t,e,r){return t.addEventListener?t.addEventListener(e,r):t.on(e,r),function(){t.removeEventListener?t.removeEventListener(e,r):t.removeListener(e,r)}}},{key:"send",value:function(){}},{key:"start",value:function(){}},{key:"stop",value:function(){}}]),e}();e.default=s,i.default.promisifyAll(s.prototype)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var r=0;r-1&&t%1==0&&t<=r}},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(5))},function(t,e,r){(function(t){var n=Function.prototype.apply;function i(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new i(n.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(n.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r(350),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(5))},function(t,e,r){var n=r(18);t.exports=function(t,e){if(!n(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,r){var n=r(81)("meta"),i=r(18),o=r(42),a=r(19).f,s=0,f=Object.isExtensible||function(){return!0},u=!r(40)(function(){return f(Object.preventExtensions({}))}),c=function(t){a(t,n,{value:{i:"O"+ ++s,w:{}}})},h=t.exports={KEY:n,NEED:!1,fastKey:function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,n)){if(!f(t))return"F";if(!e)return"E";c(t)}return t[n].i},getWeak:function(t,e){if(!o(t,n)){if(!f(t))return!0;if(!e)return!1;c(t)}return t[n].w},onFreeze:function(t){return u&&h.NEED&&f(t)&&!o(t,n)&&c(t),t}}},function(t,e){t.exports=function(t,e,r,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,e,r){var n=r(20);t.exports=function(t,e,r){for(var i in e)r&&t[i]?t[i]=e[i]:n(t,i,e[i]);return t}},function(t,e,r){var n=r(76),i=r(11)("iterator"),o=r(25);t.exports=r(14).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[n(t)]}},function(t,e,r){var n=r(26),i=r(379),o=r(157),a=r(82)("IE_PROTO"),s=function(){},f=function(){var t,e=r(155)("iframe"),n=o.length;for(e.style.display="none",r(378).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write(" + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e43f4f7..b3a1762 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6589,6 +6589,11 @@ "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, + "sentiment": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sentiment/-/sentiment-4.2.0.tgz", + "integrity": "sha512-aj0/PouNqOQBklPbERcn8IoHsfmQpWXdp71SS/ixDFUN+2KoQuZ7JhtwR94Al7h8m0nhs/wiCj5QXejtoF0wNA==" + }, "serialize-javascript": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.4.0.tgz", diff --git a/package.json b/package.json index f30701d..988add2 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,10 @@ "dependencies": { "babel-loader": "^7.1.3", "babel-plugin-transform-runtime": "^6.23.0", + "chart.js": "^2.7.1", "gulp": "^3.9.1", "gulp-util": "^3.0.8", + "sentiment": "^4.2.0", "source-map-loader": "^0.2.3", "steem": "^0.7.1", "transform-runtime": "^0.0.0", diff --git a/src/steemit-stats.js b/src/steemit-stats.js index 360f89a..f05e355 100644 --- a/src/steemit-stats.js +++ b/src/steemit-stats.js @@ -1,11 +1,15 @@ // External Dependencies import * as steem from 'steem'; import WordCloud from 'wordcloud'; +var sentiment = require('sentiment'); +import Chart from 'chart.js'; // Internal Dependencies import { ignoredWords } from './ignored-words'; import { demoWordFrequencies } from './demo-word-frequencies'; +let currentChart = null; + /** * getAccountHistory * returns: @@ -16,7 +20,6 @@ import { demoWordFrequencies } from './demo-word-frequencies'; * Operation: ( typeOfOperation: string, opInfo: OperationInfo ) * OperationInfo: { body: string, title: string, json_metadata: stringified_json } */ - const extractDataFromBlocks = (account, blocks) => { const permlinkSet = new Set(); const allCommentBodies = []; @@ -33,6 +36,7 @@ const extractDataFromBlocks = (account, blocks) => { } }); + getSentiment(allCommentBodies); const wordAndCount = extractWordAndCounts(allCommentBodies.join(' ')); const words = Object.keys(wordAndCount); words.sort((word1, word2) => wordAndCount[word2] - wordAndCount[word1]); @@ -54,6 +58,74 @@ const extractDataFromBlocks = (account, blocks) => { WordCloud(document.getElementById('word-cloud-canvas'), { list: listToPrint, minSize: 4, drawOutOfBound: true, weightFactor: 5.5 } ); }; +function precisionRound(number, precision) { + var factor = Math.pow(10, precision); + return Math.round(number * factor) / factor; +} + +const getSentiment = (texts) => { + const scoreRange = 10; + const factor = 20; + const scores = texts.map(text => sentiment(text).comparative); + const buckets = Array.apply(null, Array(scoreRange * factor)).map(Number.prototype.valueOf,0); + scores.forEach(score => { + const normalizedScore = Math.min(scoreRange * factor, Math.max(0, Math.round((score + 5) * factor))); + buckets[normalizedScore]++; + }); + + const ctx = document.getElementById('sentiment-canvas').getContext("2d"); + let colors = []; + let labels = []; + Array.apply(null, Array(scoreRange * factor)).map(Number.prototype.valueOf,0).map( + (_, i) => { + const opacity = Math.max(1, scoreRange * factor / Math.max(1, Math.abs(i - scoreRange * factor / 2))); + + if (i - scoreRange * factor / 2 === 0) { + colors.push(`rgba(0, 0, 255, 1`); + } + else if (i <= scoreRange * factor / 2 - 1) { + colors.push(`rgba(255, 0, 0, ${opacity}`); + } + else { + colors.push(`rgba(0, 255, 0, ${opacity}`); + } + labels.push(precisionRound(i / factor - 5, 2)); + } + ); + // const ctx = document.getElementById('sentiment-canvas').getContext("2d"); + var chart = new Chart(ctx, { + type: 'bar', + data: { + labels: labels, + datasets: [{ + label: 'Sentiment Analysis of Posts', + data: buckets, + backgroundColor: colors + }] + }, + options: { + scales: { + yAxes: [{ + ticks: { + beginAtZero:true + }, + scaleLabel: { + display: true, + labelString: 'Number of posts and comments' + } + }], + xAxes: [{ + scaleLabel: { + display: true, + labelString: 'Positivity' + } + }] + } + } + }); + console.log(chart); +}; + const extractWordAndCounts = (text) => { const wordAndCount = { }; const words = text.split(/[ ,.\n]+/); @@ -78,17 +150,27 @@ const extractWordAndCounts = (text) => { */ $(document).ready(() => { $('.submit-button').click(function () { - var account = $('.username-input').val(); + var account = $('.username-input').val() || 'egmracer01'; steem.api.getAccountHistory(account, -1, 10000, function(err, result) { console.log(err, (result || []).length); - if (result) + if (currentChart) { + myLineChart.destroy(); + } + if (result) { extractDataFromBlocks(account, result); + } }); }); + setTimeout(() => { + $('.submit-button').click(); + }, 1000); var canvas = document.getElementById('word-cloud-canvas'); canvas.height = window.innerHeight * .75; // sizing canvas' sucks canvas.width = window.innerWidth * .6666; + var sentimentCanvas = document.getElementById('sentiment-canvas'); + sentimentCanvas.height = window.innerHeight * .75; // sizing canvas' sucks + sentimentCanvas.width = window.innerWidth * .6666; WordCloud(document.getElementById('word-cloud-canvas'), { list: demoWordFrequencies, minSize: 4, drawOutOfBound: true, weightFactor: 5.5 } ); }); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 228374b..c103d06 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,5 +23,9 @@ module.exports = { } } ] + }, + externals: { + steem: 'steem', + 'chart.js': 'Chart' } } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d9d0ca0..dc1d9f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1102,6 +1102,26 @@ chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +chart.js@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-2.7.1.tgz#ae90b4aa4ff1f02decd6b1a2a8dabfd73c9f9886" + dependencies: + chartjs-color "~2.2.0" + moment "~2.18.0" + +chartjs-color-string@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/chartjs-color-string/-/chartjs-color-string-0.5.0.tgz#8d3752d8581d86687c35bfe2cb80ac5213ceb8c1" + dependencies: + color-name "^1.0.0" + +chartjs-color@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/chartjs-color/-/chartjs-color-2.2.0.tgz#84a2fb755787ed85c39dd6dd8c7b1d88429baeae" + dependencies: + chartjs-color-string "^0.5.0" + color-convert "^0.5.3" + chokidar@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" @@ -1237,13 +1257,17 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" +color-convert@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-0.5.3.tgz#bdb6c69ce660fadffe0b0007cc447e1b9f7282bd" + color-convert@^1.9.0: version "1.9.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" dependencies: color-name "^1.1.1" -color-name@^1.1.1: +color-name@^1.0.0, color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" @@ -3321,6 +3345,10 @@ mixin-deep@^1.2.0: dependencies: minimist "0.0.8" +moment@~2.18.0: + version "2.18.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f" + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -4246,6 +4274,10 @@ semver@^4.1.0: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" +sentiment@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/sentiment/-/sentiment-4.2.0.tgz#02e3e59972d754e81d427f7a3a8c25b43ed8d4f0" + sequencify@~0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c"