1
2
3
4
5
6
7
8
|
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.bitcoin=t()}}(function(){return function t(e,r,n){function i(s,f){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!f&&u)return u(s,!0);if(o)return o(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e){function r(t,e){return l.isUndefined(e)?""+e:l.isNumber(e)&&!isFinite(e)?e.toString():l.isFunction(e)||l.isRegExp(e)?e.toString():e}function n(t,e){return l.isString(t)?t.length<e?t:t.slice(0,e):t}function i(t){return n(JSON.stringify(t.actual,r),128)+" "+t.operator+" "+n(JSON.stringify(t.expected,r),128)}function o(t,e,r,n,i){throw new g.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:i})}function s(t,e){t||o(t,!0,e,"==",g.ok)}function f(t,e){if(t===e)return!0;if(l.isBuffer(t)&&l.isBuffer(e)){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return l.isDate(t)&&l.isDate(e)?t.getTime()===e.getTime():l.isRegExp(t)&&l.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:l.isObject(t)||l.isObject(e)?a(t,e):t==e}function u(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function a(t,e){if(l.isNullOrUndefined(t)||l.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(l.isPrimitive(t)||l.isPrimitive(e))return t===e;var r=u(t),n=u(e);if(r&&!n||!r&&n)return!1;if(r)return t=p.call(t),e=p.call(e),f(t,e);var i,o,s=v(t),a=v(e);if(s.length!=a.length)return!1;for(s.sort(),a.sort(),o=s.length-1;o>=0;o--)if(s[o]!=a[o])return!1;for(o=s.length-1;o>=0;o--)if(i=s[o],!f(t[i],e[i]))return!1;return!0}function h(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function c(t,e,r,n){var i;l.isString(r)&&(n=r,r=null);try{e()}catch(s){i=s}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&o(i,r,"Missing expected exception"+n),!t&&h(i,r)&&o(i,r,"Got unwanted exception"+n),t&&i&&r&&!h(i,r)||!t&&i)throw i}var l=t("util/"),p=Array.prototype.slice,d=Object.prototype.hasOwnProperty,g=e.exports=s;g.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=i(this),this.generatedMessage=!0);var e=t.stackStartFunction||o;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,s=e.name,f=n.indexOf("\n"+s);if(f>=0){var u=n.indexOf("\n",f+1);n=n.substring(u+1)}this.stack=n}}},l.inherits(g.AssertionError,Error),g.fail=o,g.ok=s,g.equal=function(t,e,r){t!=e&&o(t,e,r,"==",g.equal)},g.notEqual=function(t,e,r){t==e&&o(t,e,r,"!=",g.notEqual)},g.deepEqual=function(t,e,r){f(t,e)||o(t,e,r,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,r){f(t,e)&&o(t,e,r,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,r){t!==e&&o(t,e,r,"===",g.strictEqual)},g.notStrictEqual=function(t,e,r){t===e&&o(t,e,r,"!==",g.notStrictEqual)},g["throws"]=function(){c.apply(this,[!0].concat(p.call(arguments)))},g.doesNotThrow=function(){c.apply(this,[!1].concat(p.call(arguments)))},g.ifError=function(t){if(t)throw t};var v=Object.keys||function(t){var e=[];for(var r in t)d.call(t,r)&&e.push(r);return e}},{"util/":31}],2:[function(){},{}],3:[function(t,e,r){(function(e){"use strict";function n(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function i(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(i()<e)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=Buffer.prototype):(null===t&&(t=new Buffer(e)),t.length=e),t}function Buffer(t,e,r){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return a(this,t)}return s(this,t,e,r)}function s(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?l(t,e,r,n):"string"==typeof e?h(t,e,r):p(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function u(t,e,r,n){return f(e),0>=e?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}function a(t,e){if(f(e),t=o(t,0>e?0:0|d(e)),!Buffer.TYPED_ARRAY_SUPPORT)for(var r=0;e>r;++r)t[r]=0;return t}function h(t,e,r){if(("string"!=typeof r||""===r)&&(r="utf8"),!Buffer.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(e,r);t=o(t,n);var i=t.write(e,r);return i!==n&&(t=t.slice(0,i)),t}function c(t,e){var r=e.length<0?0:0|d(e.length);t=o(t,r);for(var n=0;r>n;n+=1)t[n]=255&e[n];return t}function l(t,e,r,n){if(e.byteLength,0>r||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Buffer.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=Buffer.prototype):t=c(t,e),t}function p(t,e){if(Buffer.isBuffer(e)){var r=0|d(e.length);return t=o(t,r),0===t.length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||Q(e.length)?o(t,0):c(t,e);if("Buffer"===e.type&&X(e.data))return c(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),Buffer.alloc(+t)}function v(t,e){if(Buffer.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 K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(t).length;default:if(n)return K(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||0>e)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),0>=r)return"";if(r>>>=0,e>>>=0,e>=r)return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),0>r&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(0>r){if(!i)return-1;r=0}if("string"==typeof e&&(e=Buffer.from(e,n)),Buffer.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e=255&e,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,f=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,f/=2,u/=2,r/=2}var a;if(i){var h=-1;for(a=r;f>a;a++)if(o(t,a)===o(e,-1===h?0:a-h)){if(-1===h&&(h=a),a-h+1===u)return h*s}else-1!==h&&(a-=a-h),h=-1}else for(r+u>f&&(r=f-u),a=r;a>=0;a--){for(var c=!0,l=0;u>l;l++)if(o(t,a+l)!==o(e,l)){c=!1;break}if(c)return a}return-1}function _(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n),n>i&&(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 s=0;n>s;++s){var f=parseInt(e.substr(2*s,2),16);if(isNaN(f))return s;t[r+s]=f}return s}function E(t,e,r,n){return W(K(e,t.length-r),t,r,n)}function S(t,e,r,n){return W(Y(e),t,r,n)}function T(t,e,r,n){return S(t,e,r,n)}function O(t,e,r,n){return W(V(e),t,r,n)}function B(t,e,r,n){return W(G(e,t.length-r),t,r,n)}function P(t,e,r){return J.fromByteArray(0===e&&r===t.length?t:t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;r>i;){var o=t[i],s=null,f=o>239?4:o>223?3:o>191?2:1;if(r>=i+f){var u,a,h,c;switch(f){case 1:128>o&&(s=o);break;case 2:u=t[i+1],128===(192&u)&&(c=(31&o)<<6|63&u,c>127&&(s=c));break;case 3:u=t[i+1],a=t[i+2],128===(192&u)&&128===(192&a)&&(c=(15&o)<<12|(63&u)<<6|63&a,c>2047&&(55296>c||c>57343)&&(s=c));break;case 4:u=t[i+1],a=t[i+2],h=t[i+3],128===(192&u)&&128===(192&a)&&128===(192&h)&&(c=(15&o)<<18|(63&u)<<12|(63&a)<<6|63&h,c>65535&&1114112>c&&(s=c))}}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=f}return x(n)}function x(t){var e=t.length;if($>=e)return String.fromCharCode.apply(String,t);for(var r="",n=0;e>n;)r+=String.fromCharCode.apply(String,t.slice(n,n+=$));return r}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;++i)n+=String.fromCharCode(127&t[i]);return n}function R(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;r>i;++i)n+=String.fromCharCode(t[i]);return n}function k(t,e,r){var n=t.length;(!e||0>e)&&(e=0),(!r||0>r||r>n)&&(r=n);for(var i="",o=e;r>o;++o)i+=F(t[o]);return i}function L(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function D(t,e,r){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,r,n,i,o){if(!Buffer.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||o>e)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function M(t,e,r,n){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);o>i;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function j(t,e,r,n){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);o>i;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function N(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function C(t,e,r,n,i){return i||N(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,i){return i||N(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function q(t){if(t=z(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function z(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return 16>t?"0"+t.toString(16):t.toString(16)}function K(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],s=0;n>s;++s){if(r=t.charCodeAt(s),r>55295&&57344>r){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(56320>r){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,128>r){if((e-=1)<0)break;o.push(r)}else if(2048>r){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(65536>r){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(1114112>r))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 Y(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function G(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function V(t){return J.toByteArray(q(t))}function W(t,e,r,n){for(var i=0;n>i&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Q(t){return t!==t}var J=t("base64-js"),Z=t("ieee754"),X=t("isarray");r.Buffer=Buffer,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=i(),Buffer.poolSize=8192,Buffer._augment=function(t){return t.__proto__=Buffer.prototype,t},Buffer.from=function(t,e,r){return s(null,t,e,r)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(t,e,r){return u(null,t,e,r)},Buffer.allocUnsafe=function(t){return a(null,t)},Buffer.allocUnsafeSlow=function(t){return a(null,t)},Buffer.isBuffer=function(t){return!(null==t||!t._isBuffer)},Buffer.compare=function(t,e){if(!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);o>i;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return n>r?-1:r>n?1:0},Buffer.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(t,e){if(!X(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Buffer.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=Buffer.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(!Buffer.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Buffer.byteLength=v,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;t>e;e+=2)m(this,e,e+1);return this},Buffer.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;t>e;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},Buffer.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;t>e;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},Buffer.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?I(this,0,t):y.apply(this,arguments)},Buffer.prototype.equals=function(t){if(!Buffer.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:0===Buffer.compare(this,t)},Buffer.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},Buffer.prototype.compare=function(t,e,r,n,i){if(!Buffer.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),0>e||r>t.length||0>n||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,s=r-e,f=Math.min(o,s),u=this.slice(n,i),a=t.slice(e,r),h=0;f>h;++h)if(u[h]!==a[h]){o=u[h],s=a[h];break}return s>o?-1:o>s?1:0},Buffer.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},Buffer.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},Buffer.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},Buffer.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e=0|e,isFinite(r)?(r=0|r,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(0>r||0>e)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return _(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return T(this,t,e,r);case"base64":return O(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;Buffer.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),t>e&&(e=t);var n;if(Buffer.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=Buffer.prototype;else{var i=e-t;n=new Buffer(i,void 0);for(var o=0;i>o;++o)n[o]=this[o+t]}return n},Buffer.prototype.readUIntLE=function(t,e,r){t=0|t,e=0|e,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},Buffer.prototype.readUIntBE=function(t,e,r){t=0|t,e=0|e,r||D(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},Buffer.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},Buffer.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},Buffer.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},Buffer.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Buffer.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Buffer.prototype.readIntLE=function(t,e,r){t=0|t,e=0|e,r||D(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},Buffer.prototype.readIntBE=function(t,e,r){t=0|t,e=0|e,r||D(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},Buffer.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Buffer.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Buffer.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Buffer.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),Z.read(this,t,!0,23,4)},Buffer.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),Z.read(this,t,!1,23,4)},Buffer.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),Z.read(this,t,!0,52,8)},Buffer.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),Z.read(this,t,!1,52,8)},Buffer.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;U(this,t,e,r,i,0)}var o=1,s=0;for(this[e]=255&t;++s<r&&(o*=256);)this[e+s]=t/o&255;return e+r},Buffer.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e=0|e,r=0|r,!n){var i=Math.pow(2,8*r)-1;U(this,t,e,r,i,0)}var o=r-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+r},Buffer.prototype.writeUInt8=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Buffer.prototype.writeUInt16LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},Buffer.prototype.writeUInt16BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},Buffer.prototype.writeUInt32LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):j(this,t,e,!0),e+4},Buffer.prototype.writeUInt32BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},Buffer.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}var o=0,s=1,f=0;for(this[e]=255&t;++o<r&&(s*=256);)0>t&&0===f&&0!==this[e+o-1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},Buffer.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e=0|e,!n){var i=Math.pow(2,8*r-1);U(this,t,e,r,i-1,-i)}var o=r-1,s=1,f=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)0>t&&0===f&&0!==this[e+o+1]&&(f=1),this[e+o]=(t/s>>0)-f&255;return e+r},Buffer.prototype.writeInt8=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},Buffer.prototype.writeInt16LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},Buffer.prototype.writeInt16BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},Buffer.prototype.writeInt32LE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):j(this,t,e,!0),e+4},Buffer.prototype.writeInt32BE=function(t,e,r){return t=+t,e=0|e,r||U(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),Buffer.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):j(this,t,e,!1),e+4},Buffer.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},Buffer.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},Buffer.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},Buffer.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},Buffer.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&&r>n&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,o=n-r;if(this===t&&e>r&&n>e)for(i=o-1;i>=0;--i)t[i+e]=this[i+r];else if(1e3>o||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;o>i;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+o),e);return o},Buffer.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);256>i&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t=255&t);if(0>e||this.length<e||this.length<r)throw new RangeError("Out of range index");if(e>=r)return this;e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;r>o;++o)this[o]=t;else{var s=Buffer.isBuffer(t)?t:K(new Buffer(t,n).toString()),f=s.length;for(o=0;r-e>o;++o)this[o+e]=s[o%f]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":4,ieee754:5,isarray:6}],4:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function o(t){var e,r,i,o,s,f,u=t.length;s=n(t),f=new c(3*u/4-s),i=s>0?u-4:u;var a=0;for(e=0,r=0;i>e;e+=4,r+=3)o=h[t.charCodeAt(e)]<<18|h[t.charCodeAt(e+1)]<<12|h[t.charCodeAt(e+2)]<<6|h[t.charCodeAt(e+3)],f[a++]=o>>16&255,f[a++]=o>>8&255,f[a++]=255&o;return 2===s?(o=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,f[a++]=255&o):1===s&&(o=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,f[a++]=o>>8&255,f[a++]=255&o),f}function s(t){return a[t>>18&63]+a[t>>12&63]+a[t>>6&63]+a[63&t]}function f(t,e,r){for(var n,i=[],o=e;r>o;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(s(n));return i.join("")}function u(t){for(var e,r=t.length,n=r%3,i="",o=[],s=16383,u=0,h=r-n;h>u;u+=s)o.push(f(t,u,u+s>h?h:u+s));return 1===n?(e=t[r-1],i+=a[e>>2],i+=a[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=a[e>>10],i+=a[e>>4&63],i+=a[e<<2&63],i+="="),o.push(i),o.join("")}r.byteLength=i,r.toByteArray=o,r.fromByteArray=u;for(var a=[],h=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,d=l.length;d>p;++p)a[p]=l[p],h[l.charCodeAt(p)]=p;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},{}],5:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,f=8*i-n-1,u=(1<<f)-1,a=u>>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=f;h>0;o=256*o+t[e+c],c+=l,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=l,h-=8);if(0===o)o=1-a;else{if(o===u)return s?0/0:(p?-1:1)*(1/0);s+=Math.pow(2,n),o-=a}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,f,u,a=8*o-i-1,h=(1<<a)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+c>=1?l/u:l*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=h?(f=0,s=h):s+c>=1?(f=(e*u-1)*Math.pow(2,i),s+=c):(f=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&f,p+=d,f/=256,i-=8);for(s=s<<i|f,a+=i;a>0;t[r+p]=255&s,p+=d,s/=256,a-=8);t[r+p-d]|=128*g}},{}],6:[function(t,e){var r={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},{}],7:[function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,i,f,u,a;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var h=new Error('Uncaught, unspecified "error" event. ('+e+")");throw h.context=e,h}if(r=this._events[t],s(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:f=Array.prototype.slice.call(arguments,1),r.apply(this,f)}else if(o(r))for(f=Array.prototype.slice.call(arguments,1),a=r.slice(),i=a.length,u=0;i>u;u++)a[u].apply(this,f);return!0},r.prototype.addListener=function(t,e){var i;if(!n(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(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){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,s,f;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(f=s;f-->0;)if(r[f]===e||r[f].listener&&r[f].listener===e){i=f;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,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(r=this._events[t],n(r))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){var e;return e=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)}},{}],8:[function(t,e){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],9:[function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function n(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}e.exports=function(t){return null!=t&&(r(t)||n(t)||!!t._isBuffer)}},{}],10:[function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(h===setTimeout)return setTimeout(t,0);if((h===r||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function o(t){if(c===clearTimeout)return clearTimeout(t);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(t);try{return c(t)}catch(e){try{return c.call(null,t)}catch(e){return c.call(this,t)}}}function s(){g&&p&&(g=!1,p.length?d=p.concat(d):v=-1,d.length&&f())}function f(){if(!g){var t=i(s);g=!0;for(var e=d.length;e;){for(p=d,d=[];++v<e;)p&&p[v].run();v=-1,e=d.length}p=null,g=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function a(){}var h,c,l=e.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:r}catch(t){h=r}try{c="function"==typeof clearTimeout?clearTimeout:n;
}catch(t){c=n}}();var p,d=[],g=!1,v=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];d.push(new u(t,e)),1!==d.length||g||i(f)},u.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=a,l.addListener=a,l.once=a,l.off=a,l.removeListener=a,l.removeAllListeners=a,l.emit=a,l.binding=function(){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],11:[function(t,e){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":12}],12:[function(t,e){"use strict";function r(t){return this instanceof r?(u.call(this,t),a.call(this,t),t&&t.readable===!1&&(this.readable=!1),t&&t.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,t&&t.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",n)):new r(t)}function n(){this.allowHalfOpen||this._writableState.ended||s(i,this)}function i(t){t.end()}var o=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=r;var s=t("process-nextick-args"),f=t("core-util-is");f.inherits=t("inherits");var u=t("./_stream_readable"),a=t("./_stream_writable");f.inherits(r,u);for(var h=o(a.prototype),c=0;c<h.length;c++){var l=h[c];r.prototype[l]||(r.prototype[l]=a.prototype[l])}},{"./_stream_readable":14,"./_stream_writable":16,"core-util-is":19,inherits:8,"process-nextick-args":21}],13:[function(t,e){"use strict";function r(t){return this instanceof r?void n.call(this,t):new r(t)}e.exports=r;var n=t("./_stream_transform"),i=t("core-util-is");i.inherits=t("inherits"),i.inherits(r,n),r.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":15,"core-util-is":19,inherits:8}],14:[function(t,e){(function(r){"use strict";function n(t,e,r){return"function"==typeof t.prependListener?t.prependListener(e,r):void(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))}function i(e,r){C=C||t("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,r instanceof C&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new N,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(j||(j=t("string_decoder/").StringDecoder),this.decoder=new j(e.encoding),this.encoding=e.encoding)}function o(e){return C=C||t("./_stream_duplex"),this instanceof o?(this._readableState=new i(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),void R.call(this)):new o(e)}function s(t,e,r,n,i){var o=h(e,r);if(o)t.emit("error",o);else if(null===r)e.reading=!1,c(t,e);else if(e.objectMode||r&&r.length>0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var u=new Error("stream.unshift() after end event");t.emit("error",u)}else{var a;!e.decoder||i||n||(r=e.decoder.write(r),a=!e.objectMode&&0===r.length),i||(e.reading=!1),a||(e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&l(t))),d(t,e)}else i||(e.reading=!1);return f(e)}function f(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}function u(t){return t>=H?t=H:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function a(t,e){return 0>=t||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=u(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function h(t,e){var r=null;return Buffer.isBuffer(e)||"string"==typeof e||null===e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function c(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,l(t)}}function l(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?x(p,t):p(t))}function p(t){M("emit readable"),t.emit("readable"),w(t)}function d(t,e){e.readingMore||(e.readingMore=!0,x(g,t,e))}function g(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(M("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function v(t){return function(){var e=t._readableState;M("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&k(t,"data")&&(e.flowing=!0,w(t))}}function y(t){M("readable nexttick read 0"),t.read(0)}function m(t,e){e.resumeScheduled||(e.resumeScheduled=!0,x(b,t,e))}function b(t,e){e.reading||(M("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),w(t),e.flowing&&!e.reading&&t.read(0)}function w(t){var e=t._readableState;for(M("flow",e.flowing);e.flowing&&null!==t.read(););}function _(t,e){if(0===e.length)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=E(t,e.buffer,e.decoder),r}function E(t,e,r){var n;return t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?S(t,e):T(t,e),n}function S(t,e){var r=e.head,n=1,i=r.data;for(t-=i.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(i+=s===o.length?o:o.slice(0,t),t-=s,0===t){s===o.length?(++n,e.head=r.next?r.next:e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}function T(t,e){var r=L.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),t-=s,0===t){s===o.length?(++i,e.head=n.next?n.next:e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}function O(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,x(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function P(t,e){for(var r=0,n=t.length;n>r;r++)e(t[r],r)}function I(t,e){for(var r=0,n=t.length;n>r;r++)if(t[r]===e)return r;return-1}e.exports=o;var x=t("process-nextick-args"),A=t("isarray");o.ReadableState=i;var R,k=(t("events").EventEmitter,function(t,e){return t.listeners(e).length});!function(){try{R=t("stream")}catch(e){}finally{R||(R=t("events").EventEmitter)}}();var Buffer=t("buffer").Buffer,L=t("buffer-shims"),D=t("core-util-is");D.inherits=t("inherits");var U=t("util"),M=void 0;M=U&&U.debuglog?U.debuglog("stream"):function(){};var j,N=t("./internal/streams/BufferList");D.inherits(o,R);var C,C;o.prototype.push=function(t,e){var r=this._readableState;return r.objectMode||"string"!=typeof t||(e=e||r.defaultEncoding,e!==r.encoding&&(t=L.from(t,e),e="")),s(this,r,t,e,!1)},o.prototype.unshift=function(t){var e=this._readableState;return s(this,e,t,"",!0)},o.prototype.isPaused=function(){return this._readableState.flowing===!1},o.prototype.setEncoding=function(e){return j||(j=t("string_decoder/").StringDecoder),this._readableState.decoder=new j(e),this._readableState.encoding=e,this};var H=8388608;o.prototype.read=function(t){M("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return M("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?O(this):l(this),null;if(t=a(t,e),0===t&&e.ended)return 0===e.length&&O(this),null;var n=e.needReadable;M("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&(n=!0,M("length less than watermark",n)),e.ended||e.reading?(n=!1,M("reading or ended",n)):n&&(M("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=a(r,e)));var i;return i=t>0?_(t,e):null,null===i?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&O(this)),null!==i&&this.emit("data",i),i},o.prototype._read=function(){this.emit("error",new Error("not implemented"))},o.prototype.pipe=function(t,e){function i(t){M("onunpipe"),t===l&&s()}function o(){M("onend"),t.end()}function s(){M("cleanup"),t.removeListener("close",a),t.removeListener("finish",h),t.removeListener("drain",y),t.removeListener("error",u),t.removeListener("unpipe",i),l.removeListener("end",o),l.removeListener("end",s),l.removeListener("data",f),m=!0,!p.awaitDrain||t._writableState&&!t._writableState.needDrain||y()}function f(e){M("ondata"),b=!1;var r=t.write(e);!1!==r||b||((1===p.pipesCount&&p.pipes===t||p.pipesCount>1&&-1!==I(p.pipes,t))&&!m&&(M("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++,b=!0),l.pause())}function u(e){M("onerror",e),c(),t.removeListener("error",u),0===k(t,"error")&&t.emit("error",e)}function a(){t.removeListener("finish",h),c()}function h(){M("onfinish"),t.removeListener("close",a),c()}function c(){M("unpipe"),l.unpipe(t)}var l=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=t;break;case 1:p.pipes=[p.pipes,t];break;default:p.pipes.push(t)}p.pipesCount+=1,M("pipe count=%d opts=%j",p.pipesCount,e);var d=(!e||e.end!==!1)&&t!==r.stdout&&t!==r.stderr,g=d?o:s;p.endEmitted?x(g):l.once("end",g),t.on("unpipe",i);var y=v(l);t.on("drain",y);var m=!1,b=!1;return l.on("data",f),n(t,"error",u),t.once("close",a),t.once("finish",h),t.emit("pipe",l),p.flowing||(M("pipe resume"),l.resume()),t},o.prototype.unpipe=function(t){var e=this._readableState;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),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;n>i;i++)r[i].emit("unpipe",this);return this}var o=I(e.pipes,t);return-1===o?this:(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this),this)},o.prototype.on=function(t,e){var r=R.prototype.on.call(this,t,e);if("data"===t)this._readableState.flowing!==!1&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&l(this,n):x(y,this))}return r},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var t=this._readableState;return t.flowing||(M("resume"),t.flowing=!0,m(this,t)),this},o.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(t){var e=this._readableState,r=!1,n=this;t.on("end",function(){if(M("wrapped end"),e.decoder&&!e.ended){var t=e.decoder.end();t&&t.length&&n.push(t)}n.push(null)}),t.on("data",function(i){if(M("wrapped data"),e.decoder&&(i=e.decoder.write(i)),(!e.objectMode||null!==i&&void 0!==i)&&(e.objectMode||i&&i.length)){var o=n.push(i);o||(r=!0,t.pause())}});for(var i in t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return P(o,function(e){t.on(e,n.emit.bind(n,e))}),n._read=function(e){M("wrapped _read",e),r&&(r=!1,t.resume())},n},o._fromList=_}).call(this,t("_process"))},{"./_stream_duplex":12,"./internal/streams/BufferList":17,_process:10,buffer:3,"buffer-shims":18,"core-util-is":19,events:7,inherits:8,isarray:20,"process-nextick-args":21,"string_decoder/":28,util:2}],15:[function(t,e){"use strict";function r(t){this.afterTransform=function(e,r){return n(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function n(t,e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&t.push(r),i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&t._read(o.highWaterMark)}function i(t){if(!(this instanceof i))return new i(t);s.call(this,t),this._transformState=new r(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(t){o(e,t)}):o(e)})}function o(t,e){if(e)return t.emit("error",e);var r=t._writableState,n=t._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}e.exports=i;var s=t("./_stream_duplex"),f=t("core-util-is");f.inherits=t("inherits"),f.inherits(i,s),i.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},i.prototype._transform=function(){throw new Error("Not implemented")},i.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},i.prototype._read=function(){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./_stream_duplex":12,"core-util-is":19,inherits:8}],16:[function(t,e){(function(r){"use strict";function n(){}function i(t,e,r){this.chunk=t,this.encoding=e,this.callback=r,this.next=null}function o(e,r){x=x||t("./_stream_duplex"),e=e||{},this.objectMode=!!e.objectMode,r instanceof x&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var o=e.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){d(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new E(this)}function s(e){return x=x||t("./_stream_duplex"),this instanceof s||this instanceof x?(this._writableState=new o(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev)),void B.call(this)):new s(e)}function f(t,e){var r=new Error("write after end");t.emit("error",r),S(e,r)}function u(t,e,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):Buffer.isBuffer(r)||"string"==typeof r||void 0===r||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),S(n,o),i=!1),i}function a(t,e,r){return t.objectMode||t.decodeStrings===!1||"string"!=typeof e||(e=I.from(e,r)),e}function h(t,e,r,n,o){r=a(e,r,n),Buffer.isBuffer(r)&&(n="buffer");var s=e.objectMode?1:r.length;e.length+=s;var f=e.length<e.highWaterMark;if(f||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest=new i(r,n,o),u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else c(t,e,!1,s,r,n,o);return f}function c(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function l(t,e,r,n,i){--e.pendingcb,r?S(i,n):i(n),t._writableState.errorEmitted=!0,t.emit("error",n)}function p(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function d(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(p(r),e)l(t,r,n,e,i);else{var o=m(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||y(t,r),n?T(g,t,r,o,i):g(t,r,o,i)}}function g(t,e,r,n){r||v(t,e),e.pendingcb--,n(),w(t,e)}function v(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function y(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;r;)i[s]=r,r=r.next,s+=1;c(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 E(e)}else{for(;r;){var f=r.chunk,u=r.encoding,a=r.callback,h=e.objectMode?1:f.length;if(c(t,e,!1,h,f,u,a),r=r.next,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=r,e.bufferProcessing=!1}function m(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function b(t,e){e.prefinished||(e.prefinished=!0,t.emit("prefinish"))}function w(t,e){var r=m(e);return r&&(0===e.pendingcb?(b(t,e),e.finished=!0,t.emit("finish")):b(t,e)),r}function _(t,e,r){e.ending=!0,w(t,e),r&&(e.finished?S(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function E(t){var e=this;this.next=null,this.entry=null,this.finish=function(r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}}e.exports=s;var S=t("process-nextick-args"),T=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?setImmediate:S;s.WritableState=o;var O=t("core-util-is");O.inherits=t("inherits");var B,P={deprecate:t("util-deprecate")};!function(){try{B=t("stream")}catch(e){}finally{B||(B=t("events").EventEmitter)}}();var Buffer=t("buffer").Buffer,I=t("buffer-shims");O.inherits(s,B);var x;o.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(o.prototype,"buffer",{get:P.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(t){}}();var x;s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(t,e,r){var i=this._writableState,o=!1;return"function"==typeof e&&(r=e,e=null),Buffer.isBuffer(t)?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=n),i.ended?f(this,r):u(this,i,t,r)&&(i.pendingcb++,o=h(this,i,t,e,r)),o},s.prototype.cork=function(){var t=this._writableState;t.corked++},s.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||y(this,t))},s.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},s.prototype._write=function(t,e,r){r(new Error("not implemented"))},s.prototype._writev=null,s.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||_(this,n,r)}}).call(this,t("_process"))},{"./_stream_duplex":12,_process:10,buffer:3,"buffer-shims":18,"core-util-is":19,events:7,inherits:8,"process-nextick-args":21,"util-deprecate":22}],17:[function(t,e){"use strict";function r(){this.head=null,this.tail=null,this.length=0}var n=(t("buffer").Buffer,t("buffer-shims"));e.exports=r,r.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},r.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},r.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,t}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},r.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e=n.allocUnsafe(t>>>0),r=this.head,i=0;r;)r.data.copy(e,i),i+=r.data.length,r=r.next;return e}},{buffer:3,"buffer-shims":18}],18:[function(t,e,r){(function(e){"use strict";var n=t("buffer"),Buffer=n.Buffer,i=n.SlowBuffer,o=n.kMaxLength||2147483647;r.alloc=function(t,e,r){if("function"==typeof Buffer.alloc)return Buffer.alloc(t,e,r);if("number"==typeof r)throw new TypeError("encoding must not be number");if("number"!=typeof t)throw new TypeError("size must be a number");if(t>o)throw new RangeError("size is too large");var n=r,i=e;void 0===i&&(n=void 0,i=0);var s=new Buffer(t);if("string"==typeof i)for(var f=new Buffer(i,n),u=f.length,a=-1;++a<t;)s[a]=f[a%u];else s.fill(i);return s},r.allocUnsafe=function(t){if("function"==typeof Buffer.allocUnsafe)return Buffer.allocUnsafe(t);if("number"!=typeof t)throw new TypeError("size must be a number");if(t>o)throw new RangeError("size is too large");return new Buffer(t)},r.from=function(t,r,n){if("function"==typeof Buffer.from&&(!e.Uint8Array||Uint8Array.from!==Buffer.from))return Buffer.from(t,r,n);if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("string"==typeof t)return new Buffer(t,r);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer){var i=r;if(1===arguments.length)return new Buffer(t);"undefined"==typeof i&&(i=0);var o=n;if("undefined"==typeof o&&(o=t.byteLength-i),i>=t.byteLength)throw new RangeError("'offset' is out of bounds");if(o>t.byteLength-i)throw new RangeError("'length' is out of bounds");return new Buffer(t.slice(i,i+o))}if(Buffer.isBuffer(t)){var s=new Buffer(t.length);return t.copy(s,0,0,t.length),s}if(t){if(Array.isArray(t)||"undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return new Buffer(t);if("Buffer"===t.type&&Array.isArray(t.data))return new Buffer(t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},r.allocUnsafeSlow=function(t){if("function"==typeof Buffer.allocUnsafeSlow)return Buffer.allocUnsafeSlow(t);if("number"!=typeof t)throw new TypeError("size must be a number");if(t>=o)throw new RangeError("size is too large");return new i(t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:3}],19:[function(t,e,r){(function(Buffer){function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===g(t)}function e(t){return"boolean"==typeof t}function n(t){return null===t}function i(t){return null==t}function o(t){return"number"==typeof t}function s(t){return"string"==typeof t}function f(t){return"symbol"==typeof t}function u(t){return void 0===t}function a(t){return"[object RegExp]"===g(t)}function h(t){return"object"==typeof t&&null!==t}function c(t){return"[object Date]"===g(t)}function l(t){return"[object Error]"===g(t)||t instanceof Error}function p(t){return"function"==typeof t}function d(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function g(t){return Object.prototype.toString.call(t)}r.isArray=t,r.isBoolean=e,r.isNull=n,r.isNullOrUndefined=i,r.isNumber=o,r.isString=s,r.isSymbol=f,r.isUndefined=u,r.isRegExp=a,r.isObject=h,r.isDate=c,r.isError=l,r.isFunction=p,r.isPrimitive=d,r.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:t("../../../../insert-module-globals/node_modules/is-buffer/index.js")})},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":9}],20:[function(t,e,r){arguments[4][6][0].apply(r,arguments)},{dup:6}],21:[function(t,e){(function(t){"use strict";function r(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,f=arguments.length;switch(f){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(f-1),s=0;s<o.length;)o[s++]=arguments[s];return t.nextTick(function(){e.apply(null,o)})}}e.exports=!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?r:t.nextTick}).call(this,t("_process"))},{_process:10}],22:[function(t,e){(function(t){function r(t,e){function r(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}if(n("noDeprecation"))return t;var i=!1;return r}function n(e){try{if(!t.localStorage)return!1}catch(r){return!1}var n=t.localStorage[e];return null==n?!1:"true"===String(n).toLowerCase()}e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(t,e){e.exports=t("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":13}],24:[function(t,e,r){(function(n){var i=function(){try{return t("stream")}catch(e){}}();r=e.exports=t("./lib/_stream_readable.js"),r.Stream=i||r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js"),!n.browser&&"disable"===n.env.READABLE_STREAM&&i&&(e.exports=i)}).call(this,t("_process"))},{"./lib/_stream_duplex.js":12,"./lib/_stream_passthrough.js":13,"./lib/_stream_readable.js":14,"./lib/_stream_transform.js":15,"./lib/_stream_writable.js":16,_process:10}],25:[function(t,e){e.exports=t("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":15}],26:[function(t,e){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":16}],27:[function(t,e){function r(){n.call(this)}e.exports=r;var n=t("events").EventEmitter,i=t("inherits");i(r,n),r.Readable=t("readable-stream/readable.js"),r.Writable=t("readable-stream/writable.js"),r.Duplex=t("readable-stream/duplex.js"),r.Transform=t("readable-stream/transform.js"),r.PassThrough=t("readable-stream/passthrough.js"),r.Stream=r,r.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&a.pause&&a.pause()}function i(){a.readable&&a.resume&&a.resume()}function o(){h||(h=!0,t.end())}function s(){h||(h=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(u(),0===n.listenerCount(this,"error"))throw t}function u(){a.removeListener("data",r),t.removeListener("drain",i),a.removeListener("end",o),a.removeListener("close",s),a.removeListener("error",f),t.removeListener("error",f),a.removeListener("end",u),a.removeListener("close",u),t.removeListener("close",u)}var a=this;a.on("data",r),t.on("drain",i),t._isStdio||e&&e.end===!1||(a.on("end",o),a.on("close",s));var h=!1;return a.on("error",f),t.on("error",f),a.on("end",u),a.on("close",u),t.on("close",u),t.emit("pipe",a),t}},{events:7,inherits:8,"readable-stream/duplex.js":11,"readable-stream/passthrough.js":23,"readable-stream/readable.js":24,"readable-stream/transform.js":25,"readable-stream/writable.js":26}],28:[function(t,e,r){function n(t){if(t&&!f(t))throw new Error("Unknown encoding: "+t)}function i(t){return t.toString(this.encoding)}function o(t){this.charReceived=t.length%2,this.charLength=this.charReceived?2:0}function s(t){this.charReceived=t.length%3,this.charLength=this.charReceived?3:0}var Buffer=t("buffer").Buffer,f=Buffer.isEncoding||function(t){switch(t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=r.StringDecoder=function(t){switch(this.encoding=(t||"utf8").toLowerCase().replace(/[-_]/,""),n(t),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new Buffer(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(t){for(var e="";this.charLength;){var r=t.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";t=t.slice(r,t.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=e.charCodeAt(e.length-1);if(!(n>=55296&&56319>=n)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&56319>=n){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},u.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(2>=e&&r>>4==14){this.charLength=3;break}if(3>=e&&r>>3==30){this.charLength=4;break}}this.charReceived=e},u.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:3}],29:[function(t,e,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],30:[function(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],31:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function s(t){return t}function f(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function u(t,e,n){if(t.customInspect&&e&&B(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return b(i)||(i=u(t,i,n)),i}var o=a(t,e);if(o)return o;var s=Object.keys(e),g=f(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),O(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(e);if(0===s.length){if(B(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(E(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(T(e))return t.stylize(Date.prototype.toString.call(e),"date");if(O(e))return h(e)}var y="",m=!1,w=["{","}"];if(d(e)&&(m=!0,w=["[","]"]),B(e)){var _=e.name?": "+e.name:"";y=" [Function"+_+"]"}if(E(e)&&(y=" "+RegExp.prototype.toString.call(e)),T(e)&&(y=" "+Date.prototype.toUTCString.call(e)),O(e)&&(y=" "+h(e)),0===s.length&&(!m||0==e.length))return w[0]+y+w[1];if(0>n)return E(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var S;return S=m?c(t,e,n,g,s):s.map(function(r){return l(t,e,n,g,r,m)}),t.seen.pop(),p(S,y,w)}function a(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){
var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i){for(var o=[],s=0,f=e.length;f>s;++s)o.push(R(e,String(s))?l(t,e,r,n,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(l(t,e,r,n,i,!0))}),o}function l(t,e,r,n,i,o){var s,f,a;if(a=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},a.get?f=a.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):a.set&&(f=t.stylize("[Setter]","special")),R(n,i)||(s="["+i+"]"),f||(t.seen.indexOf(a.value)<0?(f=v(r)?u(t,a.value,null):u(t,a.value,r-1),f.indexOf("\n")>-1&&(f=o?f.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+f.split("\n").map(function(t){return" "+t}).join("\n"))):f=t.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return f;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+f}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function v(t){return null===t}function y(t){return null==t}function m(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return"symbol"==typeof t}function _(t){return void 0===t}function E(t){return S(t)&&"[object RegExp]"===I(t)}function S(t){return"object"==typeof t&&null!==t}function T(t){return S(t)&&"[object Date]"===I(t)}function O(t){return S(t)&&("[object Error]"===I(t)||t instanceof Error)}function B(t){return"function"==typeof t}function P(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function I(t){return Object.prototype.toString.call(t)}function x(t){return 10>t?"0"+t.toString(10):t.toString(10)}function A(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),U[t.getMonth()],e].join(" ")}function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!b(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(i(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(t).replace(k,function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}}),f=n[r];o>r;f=n[++r])s+=v(f)||!S(f)?" "+f:" "+i(f);return s},r.deprecate=function(t,i){function o(){if(!s){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),s=!0}return t.apply(this,arguments)}if(_(n.process))return function(){return r.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var s=!1;return o};var L,D={};r.debuglog=function(t){if(_(L)&&(L=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!D[t])if(new RegExp("\\b"+t+"\\b","i").test(L)){var n=e.pid;D[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else D[t]=function(){};return D[t]},r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=d,r.isBoolean=g,r.isNull=v,r.isNullOrUndefined=y,r.isNumber=m,r.isString=b,r.isSymbol=w,r.isUndefined=_,r.isRegExp=E,r.isObject=S,r.isDate=T,r.isError=O,r.isFunction=B,r.isPrimitive=P,r.isBuffer=t("./support/isBuffer");var U=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",A(),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":30,_process:10,inherits:29}],32:[function(t,e){function BigInteger(t,e,r){return this instanceof BigInteger?void(null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))):new BigInteger(t,e,r)}function r(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i}function n(t){return ne.charAt(t)}function i(t,e){var r=ie[t.charCodeAt(e)];return null==r?-1:r}function o(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function s(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+$t:this.t=0}function f(t){var e=new BigInteger;return e.fromInt(t),e}function u(t,e){var r,n=this;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 n.fromRadix(t,e);r=2}n.t=0,n.s=0;for(var o=t.length,s=!1,f=0;--o>=0;){var u=8==r?255&t[o]:i(t,o);0>u?"-"==t.charAt(o)&&(s=!0):(s=!1,0==f?n[n.t++]=u:f+r>n.DB?(n[n.t-1]|=(u&(1<<n.DB-f)-1)<<f,n[n.t++]=u>>n.DB-f):n[n.t-1]|=u<<f,f+=r,f>=n.DB&&(f-=n.DB))}8==r&&0!=(128&t[0])&&(n.s=-1,f>0&&(n[n.t-1]|=(1<<n.DB-f)-1<<f)),n.clamp(),s&&BigInteger.ZERO.subTo(n,n)}function a(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function h(t){var e=this;if(e.s<0)return"-"+e.negate().toString(t);var r;if(16==t)r=4;else if(8==t)r=3;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return e.toRadix(t);r=2}var i,o=(1<<r)-1,s=!1,f="",u=e.t,a=e.DB-u*e.DB%r;if(u-->0)for(a<e.DB&&(i=e[u]>>a)>0&&(s=!0,f=n(i));u>=0;)r>a?(i=(e[u]&(1<<a)-1)<<r-a,i|=e[--u]>>(a+=e.DB-r)):(i=e[u]>>(a-=r)&o,0>=a&&(a+=e.DB,--u)),i>0&&(s=!0),s&&(f+=n(i));return s?f:"0"}function c(){var t=new BigInteger;return BigInteger.ZERO.subTo(this,t),t}function l(){return this.s<0?this.negate():this}function p(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(e=r-t.t,0!=e)return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0}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 g(){return this.t<=0?0:this.DB*(this.t-1)+d(this[this.t-1]^this.s&this.DM)}function v(){return this.bitLength()>>3}function y(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}function m(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s}function b(t,e){var r,n=this,i=t%n.DB,o=n.DB-i,s=(1<<o)-1,f=Math.floor(t/n.DB),u=n.s<<i&n.DM;for(r=n.t-1;r>=0;--r)e[r+f+1]=n[r]>>o|u,u=(n[r]&s)<<i;for(r=f-1;r>=0;--r)e[r]=0;e[f]=u,e.t=n.t+f+1,e.s=n.s,e.clamp()}function w(t,e){var r=this;e.s=r.s;var n=Math.floor(t/r.DB);if(n>=r.t)return void(e.t=0);var i=t%r.DB,o=r.DB-i,s=(1<<i)-1;e[0]=r[n]>>i;for(var f=n+1;f<r.t;++f)e[f-n-1]|=(r[f]&s)<<o,e[f-n]=r[f]>>i;i>0&&(e[r.t-n-1]|=(r.s&s)<<o),e.t=r.t-n,e.clamp()}function _(t,e){for(var r=this,n=0,i=0,o=Math.min(t.t,r.t);o>n;)i+=r[n]-t[n],e[n++]=i&r.DM,i>>=r.DB;if(t.t<r.t){for(i-=t.s;n<r.t;)i+=r[n],e[n++]=i&r.DM,i>>=r.DB;i+=r.s}else{for(i+=r.s;n<t.t;)i-=t[n],e[n++]=i&r.DM,i>>=r.DB;i-=t.s}e.s=0>i?-1:0,-1>i?e[n++]=r.DV+i:i>0&&(e[n++]=i),e.t=n,e.clamp()}function E(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e[i]=0;for(i=0;i<n.t;++i)e[i+r.t]=r.am(0,n[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&BigInteger.ZERO.subTo(e,e)}function S(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function T(t,e,r){var n=this,i=t.abs();if(!(i.t<=0)){var o=n.abs();if(o.t<i.t)return null!=e&&e.fromInt(0),void(null!=r&&n.copyTo(r));null==r&&(r=new BigInteger);var s=new BigInteger,f=n.s,u=t.s,a=n.DB-d(i[i.t-1]);a>0?(i.lShiftTo(a,s),o.lShiftTo(a,r)):(i.copyTo(s),o.copyTo(r));var h=s.t,c=s[h-1];if(0!=c){var l=c*(1<<n.F1)+(h>1?s[h-2]>>n.F2:0),p=n.FV/l,g=(1<<n.F1)/l,v=1<<n.F2,y=r.t,m=y-h,b=null==e?new BigInteger:e;for(s.dlShiftTo(m,b),r.compareTo(b)>=0&&(r[r.t++]=1,r.subTo(b,r)),BigInteger.ONE.dlShiftTo(h,b),b.subTo(s,s);s.t<h;)s[s.t++]=0;for(;--m>=0;){var w=r[--y]==c?n.DM:Math.floor(r[y]*p+(r[y-1]+v)*g);if((r[y]+=s.am(0,w,r,m,0,h))<w)for(s.dlShiftTo(m,b),r.subTo(b,r);r[y]<--w;)r.subTo(b,r)}null!=e&&(r.drShiftTo(h,e),f!=u&&BigInteger.ZERO.subTo(e,e)),r.t=h,r.clamp(),a>0&&r.rShiftTo(a,r),0>f&&BigInteger.ZERO.subTo(r,r)}}}function O(t){var e=new BigInteger;return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(BigInteger.ZERO)>0&&t.subTo(e,e),e}function B(t){this.m=t}function P(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function I(t){return t}function x(t){t.divRemTo(this.m,null,t)}function A(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function R(t,e){t.squareTo(e),this.reduce(e)}function k(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function L(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function D(t){var e=new BigInteger;return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(BigInteger.ZERO)>0&&this.m.subTo(e,e),e}function U(t){var e=new BigInteger;return t.copyTo(e),this.reduce(e),e}function M(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=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)}function j(t,e){t.squareTo(e),this.reduce(e)}function N(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function C(){return 0==(this.t>0?1&this[0]:this.s)}function H(t,e){if(t>4294967295||1>t)return BigInteger.ONE;var r=new BigInteger,n=new BigInteger,i=e.convert(this),o=d(t)-1;for(i.copyTo(r);--o>=0;)if(e.sqrTo(r,n),(t&1<<o)>0)e.mulTo(n,i,r);else{var s=r;r=n,n=s}return e.revert(r)}function q(t,e){var r;return r=256>t||e.isEven()?new B(e):new L(e),this.exp(t,r)}function z(){var t=new BigInteger;return this.copyTo(t),t}function F(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function K(){return 0==this.t?this.s:this[0]<<24>>24}function Y(){return 0==this.t?this.s:this[0]<<16>>16}function G(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function V(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function W(t){if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=f(r),i=new BigInteger,o=new BigInteger,s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s}function Q(t,e){var r=this;r.fromInt(0),null==e&&(e=10);for(var n=r.chunkSize(e),o=Math.pow(e,n),s=!1,f=0,u=0,a=0;a<t.length;++a){var h=i(t,a);0>h?"-"==t.charAt(a)&&0==r.signum()&&(s=!0):(u=e*u+h,++f>=n&&(r.dMultiply(o),r.dAddOffset(u,0),f=0,u=0))}f>0&&(r.dMultiply(Math.pow(e,f)),r.dAddOffset(u,0)),s&&BigInteger.ZERO.subTo(r,r)}function J(t,e,r){var n=this;if("number"==typeof e)if(2>t)n.fromInt(1);else for(n.fromNumber(t,r),n.testBit(t-1)||n.bitwiseTo(BigInteger.ONE.shiftLeft(t-1),it,n),n.isEven()&&n.dAddOffset(1,0);!n.isProbablePrime(e);)n.dAddOffset(2,0),n.bitLength()>t&&n.subTo(BigInteger.ONE.shiftLeft(t-1),n);else{var i=new Array,o=7&t;i.length=(t>>3)+1,e.nextBytes(i),o>0?i[0]&=(1<<o)-1:i[0]=0,n.fromString(i,256)}}function Z(){var t=this,e=t.t,r=new Array;r[0]=t.s;var n,i=t.DB-e*t.DB%8,o=0;if(e-->0)for(i<t.DB&&(n=t[e]>>i)!=(t.s&t.DM)>>i&&(r[o++]=n|t.s<<t.DB-i);e>=0;)8>i?(n=(t[e]&(1<<i)-1)<<8-i,n|=t[--e]>>(i+=t.DB-8)):(n=t[e]>>(i-=8)&255,0>=i&&(i+=t.DB,--e)),0!=(128&n)&&(n|=-256),0===o&&(128&t.s)!=(128&n)&&++o,(o>0||n!=t.s)&&(r[o++]=n);return r}function X(t){return 0==this.compareTo(t)}function $(t){return this.compareTo(t)<0?this:t}function tt(t){return this.compareTo(t)>0?this:t}function et(t,e,r){var n,i,o=this,s=Math.min(t.t,o.t);for(n=0;s>n;++n)r[n]=e(o[n],t[n]);if(t.t<o.t){for(i=t.s&o.DM,n=s;n<o.t;++n)r[n]=e(o[n],i);r.t=o.t}else{for(i=o.s&o.DM,n=s;n<t.t;++n)r[n]=e(i,t[n]);r.t=t.t}r.s=e(o.s,t.s),r.clamp()}function rt(t,e){return t&e}function nt(t){var e=new BigInteger;return this.bitwiseTo(t,rt,e),e}function it(t,e){return t|e}function ot(t){var e=new BigInteger;return this.bitwiseTo(t,it,e),e}function st(t,e){return t^e}function ft(t){var e=new BigInteger;return this.bitwiseTo(t,st,e),e}function ut(t,e){return t&~e}function at(t){var e=new BigInteger;return this.bitwiseTo(t,ut,e),e}function ht(){for(var t=new BigInteger,e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function ct(t){var e=new BigInteger;return 0>t?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function lt(t){var e=new BigInteger;return 0>t?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function pt(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function dt(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+pt(this[t]);return this.s<0?this.t*this.DB:-1}function gt(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function vt(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=gt(this[r]^e);return t}function yt(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)}function mt(t,e){var r=BigInteger.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r}function bt(t){return this.changeBit(t,it)}function wt(t){return this.changeBit(t,ut)}function _t(t){return this.changeBit(t,st)}function Et(t,e){for(var r=this,n=0,i=0,o=Math.min(t.t,r.t);o>n;)i+=r[n]+t[n],e[n++]=i&r.DM,i>>=r.DB;if(t.t<r.t){for(i+=t.s;n<r.t;)i+=r[n],e[n++]=i&r.DM,i>>=r.DB;i+=r.s}else{for(i+=r.s;n<t.t;)i+=t[n],e[n++]=i&r.DM,i>>=r.DB;i+=t.s}e.s=0>i?-1:0,i>0?e[n++]=i:-1>i&&(e[n++]=r.DV+i),e.t=n,e.clamp()}function St(t){var e=new BigInteger;return this.addTo(t,e),e}function Tt(t){var e=new BigInteger;return this.subTo(t,e),e}function Ot(t){var e=new BigInteger;return this.multiplyTo(t,e),e}function Bt(){var t=new BigInteger;return this.squareTo(t),t}function Pt(t){var e=new BigInteger;return this.divRemTo(t,e,null),e}function It(t){var e=new BigInteger;return this.divRemTo(t,null,e),e}function xt(t){var e=new BigInteger,r=new BigInteger;return this.divRemTo(t,e,r),new Array(e,r)}function At(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function Rt(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]}}function kt(){}function Lt(t){return t}function Dt(t,e,r){t.multiplyTo(e,r)}function Ut(t,e){t.squareTo(e)}function Mt(t){return this.exp(t,new kt)}function jt(t,e,r){var n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;var i;for(i=r.t-this.t;i>n;++n)r[n+this.t]=this.am(0,t[n],r,n,0,this.t);for(i=Math.min(t.t,e);i>n;++n)this.am(0,t[n],r,n,0,e-n);r.clamp()}function Nt(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)}function Ct(t){this.r2=new BigInteger,this.q3=new BigInteger,BigInteger.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function Ht(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 BigInteger;return t.copyTo(e),this.reduce(e),e}function qt(t){return t}function zt(t){var e=this;for(t.drShiftTo(e.m.t-1,e.r2),t.t>e.m.t+1&&(t.t=e.m.t+1,t.clamp()),e.mu.multiplyUpperTo(e.r2,e.m.t+1,e.q3),e.m.multiplyLowerTo(e.q3,e.m.t+1,e.r2);t.compareTo(e.r2)<0;)t.dAddOffset(1,e.m.t+1);for(t.subTo(e.r2,t);t.compareTo(e.m)>=0;)t.subTo(e.m,t)}function Ft(t,e){t.squareTo(e),this.reduce(e)}function Kt(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function Yt(t,e){var r,n,i=t.bitLength(),o=f(1);if(0>=i)return o;r=18>i?1:48>i?3:144>i?4:768>i?5:6,n=8>i?new B(e):e.isEven()?new Ct(e):new L(e);var s=new Array,u=3,a=r-1,h=(1<<r)-1;if(s[1]=n.convert(this),r>1){var c=new BigInteger;for(n.sqrTo(s[1],c);h>=u;)s[u]=new BigInteger,n.mulTo(c,s[u-2],s[u]),u+=2}var l,p,g=t.t-1,v=!0,y=new BigInteger;for(i=d(t[g])-1;g>=0;){for(i>=a?l=t[g]>>i-a&h:(l=(t[g]&(1<<i+1)-1)<<a-i,g>0&&(l|=t[g-1]>>this.DB+i-a)),u=r;0==(1&l);)l>>=1,--u;if((i-=u)<0&&(i+=this.DB,--g),v)s[l].copyTo(o),v=!1;else{for(;u>1;)n.sqrTo(o,y),n.sqrTo(y,o),u-=2;u>0?n.sqrTo(o,y):(p=o,o=y,y=p),n.mulTo(y,s[l],o)}for(;g>=0&&0==(t[g]&1<<i);)n.sqrTo(o,y),p=o,o=y,y=p,--i<0&&(i=this.DB-1,--g)}return n.revert(o)}function Gt(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(0>o)return e;for(o>i&&(o=i),o>0&&(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}function Vt(t){if(0>=t)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)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}function Wt(t){var e=t.isEven();if(0===this.signum())throw new Error("division by zero");if(this.isEven()&&e||0==t.signum())return BigInteger.ZERO;for(var r=t.clone(),n=this.clone(),i=f(1),o=f(0),s=f(0),u=f(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(t,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),e&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(BigInteger.ONE)?BigInteger.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u}function Qt(t){var e,r=this.abs();if(1==r.t&&r[0]<=oe[oe.length-1]){for(e=0;e<oe.length;++e)if(r[0]==oe[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<oe.length;){for(var n=oe[e],i=e+1;i<oe.length&&se>n;)n*=oe[i++];for(n=r.modInt(n);i>e;)if(n%oe[e++]==0)return!1}return r.millerRabin(t)}function Jt(t){var e=this.subtract(BigInteger.ONE),r=e.getLowestSetBit();if(0>=r)return!1;var n=e.shiftRight(r);t=t+1>>1,t>oe.length&&(t=oe.length);for(var i,o=new BigInteger(null),s=[],f=0;t>f;++f){for(;i=oe[Math.floor(Math.random()*oe.length)],-1!=s.indexOf(i););s.push(i),o.fromInt(i);var u=o.modPow(n,this);if(0!=u.compareTo(BigInteger.ONE)&&0!=u.compareTo(e)){for(var i=1;i++<r&&0!=u.compareTo(e);)if(u=u.modPowInt(2,this),0==u.compareTo(BigInteger.ONE))return!1;if(0!=u.compareTo(e))return!1}}return!0}var Zt=BigInteger.prototype;Zt.__bigi=t("../package.json").version,BigInteger.isBigInteger=function(t,e){return t&&t.__bigi&&(!e||t.__bigi===Zt.__bigi)};var Xt;BigInteger.prototype.am=r,Xt=26,BigInteger.prototype.DB=Xt,BigInteger.prototype.DM=(1<<Xt)-1;var $t=BigInteger.prototype.DV=1<<Xt,te=52;BigInteger.prototype.FV=Math.pow(2,te),BigInteger.prototype.F1=te-Xt,BigInteger.prototype.F2=2*Xt-te;var ee,re,ne="0123456789abcdefghijklmnopqrstuvwxyz",ie=new Array;for(ee="0".charCodeAt(0),re=0;9>=re;++re)ie[ee++]=re;for(ee="a".charCodeAt(0),re=10;36>re;++re)ie[ee++]=re;for(ee="A".charCodeAt(0),re=10;36>re;++re)ie[ee++]=re;B.prototype.convert=P,B.prototype.revert=I,B.prototype.reduce=x,B.prototype.mulTo=A,B.prototype.sqrTo=R,L.prototype.convert=D,L.prototype.revert=U,L.prototype.reduce=M,L.prototype.mulTo=N,L.prototype.sqrTo=j,Zt.copyTo=o,Zt.fromInt=s,Zt.fromString=u,Zt.clamp=a,Zt.dlShiftTo=y,Zt.drShiftTo=m,Zt.lShiftTo=b,Zt.rShiftTo=w,Zt.subTo=_,Zt.multiplyTo=E,Zt.squareTo=S,Zt.divRemTo=T,Zt.invDigit=k,Zt.isEven=C,Zt.exp=H,Zt.toString=h,Zt.negate=c,Zt.abs=l,Zt.compareTo=p,Zt.bitLength=g,Zt.byteLength=v,Zt.mod=O,Zt.modPowInt=q,kt.prototype.convert=Lt,kt.prototype.revert=Lt,kt.prototype.mulTo=Dt,kt.prototype.sqrTo=Ut,Ct.prototype.convert=Ht,Ct.prototype.revert=qt,Ct.prototype.reduce=zt,Ct.prototype.mulTo=Kt,Ct.prototype.sqrTo=Ft;var oe=[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],se=(1<<26)/oe[oe.length-1];Zt.chunkSize=G,Zt.toRadix=W,Zt.fromRadix=Q,Zt.fromNumber=J,Zt.bitwiseTo=et,Zt.changeBit=mt,Zt.addTo=Et,Zt.dMultiply=At,Zt.dAddOffset=Rt,Zt.multiplyLowerTo=jt,Zt.multiplyUpperTo=Nt,Zt.modInt=Vt,Zt.millerRabin=Jt,Zt.clone=z,Zt.intValue=F,Zt.byteValue=K,Zt.shortValue=Y,Zt.signum=V,Zt.toByteArray=Z,Zt.equals=X,Zt.min=$,Zt.max=tt,Zt.and=nt,Zt.or=ot,Zt.xor=ft,Zt.andNot=at,Zt.not=ht,Zt.shiftLeft=ct,Zt.shiftRight=lt,Zt.getLowestSetBit=dt,Zt.bitCount=vt,Zt.testBit=yt,Zt.setBit=bt,Zt.clearBit=wt,Zt.flipBit=_t,Zt.add=St,Zt.subtract=Tt,Zt.multiply=Ot,Zt.divide=Pt,Zt.remainder=It,Zt.divideAndRemainder=xt,Zt.modPow=Yt,Zt.modInverse=Wt,Zt.pow=Mt,Zt.gcd=Gt,Zt.isProbablePrime=Qt,Zt.square=Bt,BigInteger.ZERO=f(0),BigInteger.ONE=f(1),BigInteger.valueOf=f,e.exports=BigInteger},{"../package.json":35}],33:[function(t){(function(Buffer){var e=t("assert"),BigInteger=t("./bigi");BigInteger.fromByteArrayUnsigned=function(t){return new BigInteger(128&t[0]?[0].concat(t):t)},BigInteger.prototype.toByteArrayUnsigned=function(){var t=this.toByteArray();return 0===t[0]?t.slice(1):t},BigInteger.fromDERInteger=function(t){return new BigInteger(t)},BigInteger.prototype.toDERInteger=BigInteger.prototype.toByteArray,BigInteger.fromBuffer=function(t){if(128&t[0]){var e=Array.prototype.slice.call(t);return new BigInteger([0].concat(e))}return new BigInteger(t)},BigInteger.fromHex=function(t){return""===t?BigInteger.ZERO:(e.equal(t,t.match(/^[A-Fa-f0-9]+/),"Invalid hex string"),e.equal(t.length%2,0,"Incomplete hex"),new BigInteger(t,16))},BigInteger.prototype.toBuffer=function(t){for(var e=this.toByteArrayUnsigned(),r=[],n=t-e.length;r.length<n;)r.push(0);return new Buffer(r.concat(e))},BigInteger.prototype.toHex=function(t){return this.toBuffer(t).toString("hex")}}).call(this,t("buffer").Buffer)},{"./bigi":32,assert:1,buffer:3}],34:[function(t,e){var BigInteger=t("./bigi");t("./convert"),e.exports=BigInteger},{"./bigi":32,"./convert":33}],35:[function(t,e){e.exports={name:"bigi",version:"1.4.1",description:"Big integers.",keywords:["cryptography","math","bitcoin","arbitrary","precision","arithmetic","big","integer","int","number","biginteger","bigint","bignumber","decimal","float"],devDependencies:{coveralls:"^2.11.2",istanbul:"^0.3.5",jshint:"^2.5.1",mocha:"^2.1.0",mochify:"^2.1.0"},repository:{url:"https://github.com/cryptocoinjs/bigi",type:"git"},main:"./lib/index.js",scripts:{"browser-test":"./node_modules/.bin/mochify --wd -R spec",test:"./node_modules/.bin/_mocha -- test/*.js",jshint:"./node_modules/.bin/jshint --config jshint.json lib/*.js ; true",unit:"./node_modules/.bin/mocha",coverage:"./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js",coveralls:"npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info"},dependencies:{},testling:{files:"test/*.js",harness:"mocha",browsers:["ie/9..latest","firefox/latest","chrome/latest","safari/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},readme:"bigi\n======\n\n[](http://travis-ci.org/cryptocoinjs/bigi)\n[](https://coveralls.io/r/cryptocoinjs/bigi)\n[](https://www.npmjs.org/package/bigi)\n\n[](https://ci.testling.com/cryptocoinjs/bigi)\n\nJavaScript library to manipulate big integers. Based on `jsbn` made by [Tom Wu](http://www-cs-students.stanford.edu/~tjw/jsbn/)\n\nOfficial documentation: \n\nhttp://cryptocoinjs.com/modules/misc/bigi/",readmeFilename:"README.md",bugs:{url:"https://github.com/cryptocoinjs/bigi/issues"},_id:"[email protected]",dist:{shasum:"0f989cfa5faa0769cc5c9952627e24d646c82d2c"},_from:"bigi@^1.4.0",_resolved:"https://registry.npmjs.org/bigi/-/bigi-1.4.1.tgz"}},{}],36:[function(t,e){(function(Buffer){function t(t){if(t.length<8)return!1;if(t.length>72)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-2)return!1;if(2!==t[2])return!1;var e=t[3];if(0===e)return!1;if(5+e>=t.length)return!1;if(2!==t[4+e])return!1;var r=t[5+e];return 0===r?!1:6+e+r!==t.length?!1:128&t[4]?!1:e>1&&0===t[4]&&!(128&t[5])?!1:128&t[e+6]?!1:r>1&&0===t[e+6]&&!(128&t[e+7])?!1:!0}function r(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");var e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");var r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}}function n(t,e){var r=t.length,n=e.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&t[0])throw new Error("R value is negative");if(128&e[0])throw new Error("S value is negative");if(r>1&&0===t[0]&&!(128&t[1]))throw new Error("R value excessively padded");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("S value excessively padded");var i=new Buffer(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=t.length,t.copy(i,4),i[4+r]=2,i[5+r]=e.length,e.copy(i,6+r),i}e.exports={check:t,decode:r,encode:n}}).call(this,t("buffer").Buffer)},{buffer:3}],37:[function(t,e){function r(t){if(0===t.length)return"";var e,r,n=[0];for(e=0;e<t.length;e++){for(r=0;r<n.length;r++)n[r]<<=8;n[0]+=t[e];var o=0;for(r=0;r<n.length;++r)n[r]+=o,o=n[r]/f|0,n[r]%=f;for(;o;)n.push(o%f),o=o/f|0}for(e=0;0===t[e]&&e<t.length-1;e++)n.push(0);for(var s="",e=n.length-1;e>=0;e--)s+=i[n[e]];return s}function n(t){if(0===t.length)return[];var e,r,n=[0];for(e=0;e<t.length;e++){var i=t[e];if(!(i in o))throw new Error("Non-base58 character");for(r=0;r<n.length;r++)n[r]*=f;n[0]+=o[i];var s=0;for(r=0;r<n.length;++r)n[r]+=s,s=n[r]>>8,n[r]&=255;for(;s;)n.push(255&s),s>>=8}for(e=0;"1"===t[e]&&e<t.length-1;e++)n.push(0);return n.reverse()}for(var i="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",o={},s=0;s<i.length;s++)o[i.charAt(s)]=s;var f=58;e.exports={encode:r,decode:n}},{}],38:[function(t,e){(function(Buffer){"use strict";function r(t){return t=s("sha256").update(t).digest(),s("sha256").update(t).digest()}function n(t){var e=r(t).slice(0,4);return o.encode(Buffer.concat([t,e]))}function i(t){for(var e=new Buffer(o.decode(t)),n=e.slice(0,-4),i=e.slice(-4),s=r(n).slice(0,4),f=0;f<s.length;++f)if(s[f]!==i[f])throw new Error("Invalid checksum");return n}var o=t("bs58"),s=t("create-hash");e.exports={encode:n,decode:i}}).call(this,t("buffer").Buffer)},{bs58:37,buffer:3,"create-hash":42}],39:[function(t,e){e.exports=function(t,e){if("function"==typeof t.compare)return t.compare(e);if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);o>i&&t[i]===e[i];)++i;return i!==o&&(r=t[i],n=e[i]),n>r?-1:r>n?1:0}},{}],40:[function(t,e){(function(Buffer){"use strict";e.exports=function(t,e){if(!Buffer.isBuffer(t)||!Buffer.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return!0;if("function"==typeof t.equals)return t.equals(e);if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}}).call(this,{isBuffer:t("../../../.node_modules/lib/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"../../../.node_modules/lib/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":9}],41:[function(t,e){(function(Buffer){e.exports=function(t){for(var e=t.length,r=new Buffer(e),n=0,i=e-1;e>n;++n,--i)r[n]=t[i];return r}}).call(this,t("buffer").Buffer)},{buffer:3}],42:[function(t,e){(function(Buffer){"use strict";function r(t){u.call(this,"digest"),this._hash=t,this.buffers=[]}function n(t){u.call(this,"digest"),this._hash=t}var i=t("inherits"),o=t("./md5"),s=t("ripemd160"),f=t("sha.js"),u=t("cipher-base");i(r,u),r.prototype._update=function(t){this.buffers.push(t)},r.prototype._final=function(){var t=Buffer.concat(this.buffers),e=this._hash(t);return this.buffers=null,e},i(n,u),n.prototype._update=function(t){this._hash.update(t)},n.prototype._final=function(){return this._hash.digest()},e.exports=function(t){return t=t.toLowerCase(),"md5"===t?new r(o):"rmd160"===t||"ripemd160"===t?new r(s):new n(f(t))}}).call(this,t("buffer").Buffer)},{"./md5":44,buffer:3,"cipher-base":45,inherits:46,ripemd160:47,"sha.js":49}],43:[function(t,e,r){(function(Buffer){"use strict";function t(t,e){if(t.length%i!==0){var r=t.length+(i-t.length%i);t=Buffer.concat([t,o],r)}for(var n=[],s=e?t.readInt32BE:t.readInt32LE,f=0;f<t.length;f+=i)n.push(s.call(t,f));return n}function e(t,e,r){for(var n=new Buffer(e),i=r?n.writeInt32BE:n.writeInt32LE,o=0;o<t.length;o++)i.call(n,t[o],4*o,!0);return n}function n(r,n,i,o){Buffer.isBuffer(r)||(r=new Buffer(r));var f=n(t(r,o),r.length*s);return e(f,i,o)}var i=4,o=new Buffer(i);o.fill(0);var s=8;r.hash=n}).call(this,t("buffer").Buffer)},{buffer:3}],44:[function(t,e){"use strict";function r(t,e){t[e>>5]|=128<<e%32,t[(e+64>>>9<<4)+14]=e;for(var r=1732584193,n=-271733879,a=-1732584194,h=271733878,c=0;c<t.length;c+=16){var l=r,p=n,d=a,g=h;r=i(r,n,a,h,t[c+0],7,-680876936),h=i(h,r,n,a,t[c+1],12,-389564586),a=i(a,h,r,n,t[c+2],17,606105819),n=i(n,a,h,r,t[c+3],22,-1044525330),r=i(r,n,a,h,t[c+4],7,-176418897),h=i(h,r,n,a,t[c+5],12,1200080426),a=i(a,h,r,n,t[c+6],17,-1473231341),n=i(n,a,h,r,t[c+7],22,-45705983),r=i(r,n,a,h,t[c+8],7,1770035416),h=i(h,r,n,a,t[c+9],12,-1958414417),a=i(a,h,r,n,t[c+10],17,-42063),n=i(n,a,h,r,t[c+11],22,-1990404162),r=i(r,n,a,h,t[c+12],7,1804603682),h=i(h,r,n,a,t[c+13],12,-40341101),a=i(a,h,r,n,t[c+14],17,-1502002290),n=i(n,a,h,r,t[c+15],22,1236535329),r=o(r,n,a,h,t[c+1],5,-165796510),h=o(h,r,n,a,t[c+6],9,-1069501632),a=o(a,h,r,n,t[c+11],14,643717713),n=o(n,a,h,r,t[c+0],20,-373897302),r=o(r,n,a,h,t[c+5],5,-701558691),h=o(h,r,n,a,t[c+10],9,38016083),a=o(a,h,r,n,t[c+15],14,-660478335),n=o(n,a,h,r,t[c+4],20,-405537848),r=o(r,n,a,h,t[c+9],5,568446438),
h=o(h,r,n,a,t[c+14],9,-1019803690),a=o(a,h,r,n,t[c+3],14,-187363961),n=o(n,a,h,r,t[c+8],20,1163531501),r=o(r,n,a,h,t[c+13],5,-1444681467),h=o(h,r,n,a,t[c+2],9,-51403784),a=o(a,h,r,n,t[c+7],14,1735328473),n=o(n,a,h,r,t[c+12],20,-1926607734),r=s(r,n,a,h,t[c+5],4,-378558),h=s(h,r,n,a,t[c+8],11,-2022574463),a=s(a,h,r,n,t[c+11],16,1839030562),n=s(n,a,h,r,t[c+14],23,-35309556),r=s(r,n,a,h,t[c+1],4,-1530992060),h=s(h,r,n,a,t[c+4],11,1272893353),a=s(a,h,r,n,t[c+7],16,-155497632),n=s(n,a,h,r,t[c+10],23,-1094730640),r=s(r,n,a,h,t[c+13],4,681279174),h=s(h,r,n,a,t[c+0],11,-358537222),a=s(a,h,r,n,t[c+3],16,-722521979),n=s(n,a,h,r,t[c+6],23,76029189),r=s(r,n,a,h,t[c+9],4,-640364487),h=s(h,r,n,a,t[c+12],11,-421815835),a=s(a,h,r,n,t[c+15],16,530742520),n=s(n,a,h,r,t[c+2],23,-995338651),r=f(r,n,a,h,t[c+0],6,-198630844),h=f(h,r,n,a,t[c+7],10,1126891415),a=f(a,h,r,n,t[c+14],15,-1416354905),n=f(n,a,h,r,t[c+5],21,-57434055),r=f(r,n,a,h,t[c+12],6,1700485571),h=f(h,r,n,a,t[c+3],10,-1894986606),a=f(a,h,r,n,t[c+10],15,-1051523),n=f(n,a,h,r,t[c+1],21,-2054922799),r=f(r,n,a,h,t[c+8],6,1873313359),h=f(h,r,n,a,t[c+15],10,-30611744),a=f(a,h,r,n,t[c+6],15,-1560198380),n=f(n,a,h,r,t[c+13],21,1309151649),r=f(r,n,a,h,t[c+4],6,-145523070),h=f(h,r,n,a,t[c+11],10,-1120210379),a=f(a,h,r,n,t[c+2],15,718787259),n=f(n,a,h,r,t[c+9],21,-343485551),r=u(r,l),n=u(n,p),a=u(a,d),h=u(h,g)}return Array(r,n,a,h)}function n(t,e,r,n,i,o){return u(a(u(u(e,t),u(n,o)),i),r)}function i(t,e,r,i,o,s,f){return n(e&r|~e&i,t,e,o,s,f)}function o(t,e,r,i,o,s,f){return n(e&i|r&~i,t,e,o,s,f)}function s(t,e,r,i,o,s,f){return n(e^r^i,t,e,o,s,f)}function f(t,e,r,i,o,s,f){return n(r^(e|~i),t,e,o,s,f)}function u(t,e){var r=(65535&t)+(65535&e),n=(t>>16)+(e>>16)+(r>>16);return n<<16|65535&r}function a(t,e){return t<<e|t>>>32-e}var h=t("./helpers");e.exports=function(t){return h.hash(t,r,16)}},{"./helpers":43}],45:[function(t,e){(function(Buffer){function r(t){n.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this["final"]=this._finalOrDigest,this._decoder=null,this._encoding=null}var n=t("stream").Transform,i=t("inherits"),o=t("string_decoder").StringDecoder;e.exports=r,i(r,n),r.prototype.update=function(t,e,r){"string"==typeof t&&(t=new Buffer(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){n=i}finally{r(n)}},r.prototype._flush=function(t){var e;try{this.push(this._final())}catch(r){e=r}finally{t(e)}},r.prototype._finalOrDigest=function(t){var e=this._final()||new Buffer("");return t&&(e=this._toString(e,t,!0)),e},r.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}}).call(this,t("buffer").Buffer)},{buffer:3,inherits:46,stream:27,string_decoder:28}],46:[function(t,e,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],47:[function(t,e){(function(Buffer){function t(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e}function r(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e}function n(t,e,r){for(var n=0;16>n;n++){var h=r+n,y=e[h];e[h]=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8)}var m,b,w,_,E,S,T,O,B,P;S=m=t[0],T=b=t[1],O=w=t[2],B=_=t[3],P=E=t[4];var I;for(n=0;80>n;n+=1)I=m+e[r+c[n]]|0,I+=16>n?i(b,w,_)+g[0]:32>n?o(b,w,_)+g[1]:48>n?s(b,w,_)+g[2]:64>n?f(b,w,_)+g[3]:u(b,w,_)+g[4],I=0|I,I=a(I,p[n]),I=I+E|0,m=E,E=_,_=a(w,10),w=b,b=I,I=S+e[r+l[n]]|0,I+=16>n?u(T,O,B)+v[0]:32>n?f(T,O,B)+v[1]:48>n?s(T,O,B)+v[2]:64>n?o(T,O,B)+v[3]:i(T,O,B)+v[4],I=0|I,I=a(I,d[n]),I=I+P|0,S=P,P=B,B=a(O,10),O=T,T=I;I=t[1]+w+B|0,t[1]=t[2]+_+P|0,t[2]=t[3]+E+S|0,t[3]=t[4]+m+T|0,t[4]=t[0]+b+O|0,t[0]=I}function i(t,e,r){return t^e^r}function o(t,e,r){return t&e|~t&r}function s(t,e,r){return(t|~e)^r}function f(t,e,r){return t&r|e&~r}function u(t,e,r){return t^(e|~r)}function a(t,e){return t<<e|t>>>32-e}function h(e){var i=[1732584193,4023233417,2562383102,271733878,3285377520];"string"==typeof e&&(e=new Buffer(e,"utf8"));var o=t(e),s=8*e.length,f=8*e.length;o[s>>>5]|=128<<24-s%32,o[(s+64>>>9<<4)+14]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8);for(var u=0;u<o.length;u+=16)n(i,o,u);for(u=0;5>u;u++){var a=i[u];i[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var h=r(i);return new Buffer(h)}var c=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],l=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],d=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],g=[0,1518500249,1859775393,2400959708,2840853838],v=[1352829926,1548603684,1836072691,2053994217,0];e.exports=h}).call(this,t("buffer").Buffer)},{buffer:3}],48:[function(t,e){(function(Buffer){function t(t,e){this._block=new Buffer(t),this._finalSize=e,this._blockSize=t,this._len=0,this._s=0}t.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=new Buffer(t,e));for(var r=this._len+=t.length,n=this._s||0,i=0,o=this._block;r>n;){for(var s=Math.min(t.length,i+this._blockSize-n%this._blockSize),f=s-i,u=0;f>u;u++)o[n%this._blockSize+u]=t[u+i];n+=f,i+=f,n%this._blockSize===0&&this._update(o)}return this._s=n,this},t.prototype.digest=function(t){var e=8*this._len;this._block[this._len%this._blockSize]=128,this._block.fill(0,this._len%this._blockSize+1),e%(8*this._blockSize)>=8*this._finalSize&&(this._update(this._block),this._block.fill(0)),this._block.writeInt32BE(e,this._blockSize-4);var r=this._update(this._block)||this._hash();return t?r.toString(t):r},t.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=t}).call(this,t("buffer").Buffer)},{buffer:3}],49:[function(t,e,r){var r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};r.sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":50,"./sha1":51,"./sha224":52,"./sha256":53,"./sha384":54,"./sha512":55}],50:[function(t,e){(function(Buffer){function r(){this.init(),this._w=s,o.call(this,64,56)}function n(t,e){return t<<e|t>>>32-e}var i=t("inherits"),o=t("./hash"),s=new Array(80);i(r,o),r.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},r.prototype._update=function(t){function e(){return o[c-3]^o[c-8]^o[c-14]^o[c-16]}function r(t,e){o[c]=t;var r=n(s,5)+e+h+t+i;h=a,a=u,u=n(f,30),f=s,s=r,c++}var i,o=this._w,s=this._a,f=this._b,u=this._c,a=this._d,h=this._e,c=0;for(i=1518500249;16>c;)r(t.readInt32BE(4*c),f&u|~f&a);for(;20>c;)r(e(),f&u|~f&a);for(i=1859775393;40>c;)r(e(),f^u^a);for(i=-1894007588;60>c;)r(e(),f&u|f&a|u&a);for(i=-899497514;80>c;)r(e(),f^u^a);this._a=s+this._a|0,this._b=f+this._b|0,this._c=u+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},r.prototype._hash=function(){var t=new Buffer(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=r}).call(this,t("buffer").Buffer)},{"./hash":48,buffer:3,inherits:46}],51:[function(t,e){(function(Buffer){function r(){this.init(),this._w=s,o.call(this,64,56)}function n(t,e){return t<<e|t>>>32-e}var i=t("inherits"),o=t("./hash"),s=new Array(80);i(r,o),r.prototype.init=function(){return this._a=1732584193,this._b=-271733879,this._c=-1732584194,this._d=271733878,this._e=-1009589776,this},r.prototype._update=function(t){function e(){return n(o[c-3]^o[c-8]^o[c-14]^o[c-16],1)}function r(t,e){o[c]=t;var r=n(s,5)+e+h+t+i;h=a,a=u,u=n(f,30),f=s,s=r,c++}var i,o=this._w,s=this._a,f=this._b,u=this._c,a=this._d,h=this._e,c=0;for(i=1518500249;16>c;)r(t.readInt32BE(4*c),f&u|~f&a);for(;20>c;)r(e(),f&u|~f&a);for(i=1859775393;40>c;)r(e(),f^u^a);for(i=-1894007588;60>c;)r(e(),f&u|f&a|u&a);for(i=-899497514;80>c;)r(e(),f^u^a);this._a=s+this._a|0,this._b=f+this._b|0,this._c=u+this._c|0,this._d=a+this._d|0,this._e=h+this._e|0},r.prototype._hash=function(){var t=new Buffer(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=r}).call(this,t("buffer").Buffer)},{"./hash":48,buffer:3,inherits:46}],52:[function(t,e){(function(Buffer){function r(){this.init(),this._w=s,o.call(this,64,56)}var n=t("inherits"),i=t("./sha256"),o=t("./hash"),s=new Array(64);n(r,i),r.prototype.init=function(){return this._a=-1056596264,this._b=914150663,this._c=812702999,this._d=-150054599,this._e=-4191439,this._f=1750603025,this._g=1694076839,this._h=-1090891868,this},r.prototype._hash=function(){var t=new Buffer(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=r}).call(this,t("buffer").Buffer)},{"./hash":48,"./sha256":53,buffer:3,inherits:46}],53:[function(t,e){(function(Buffer){function r(){this.init(),this._w=l,h.call(this,64,56)}function n(t,e,r){return r^t&(e^r)}function i(t,e,r){return t&e|r&(t|e)}function o(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function s(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function f(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function u(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}var a=t("inherits"),h=t("./hash"),c=[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],l=new Array(64);a(r,h),r.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this},r.prototype._update=function(t){function e(){return u(a[b-2])+a[b-7]+f(a[b-15])+a[b-16]}function r(t){a[b]=t;var e=m+s(g)+n(g,v,y)+c[b]+t,r=o(h)+i(h,l,p);m=y,y=v,v=g,g=d+e,d=p,p=l,l=h,h=e+r,b++}for(var a=this._w,h=0|this._a,l=0|this._b,p=0|this._c,d=0|this._d,g=0|this._e,v=0|this._f,y=0|this._g,m=0|this._h,b=0;16>b;)r(t.readInt32BE(4*b));for(;64>b;)r(e());this._a=h+this._a|0,this._b=l+this._b|0,this._c=p+this._c|0,this._d=d+this._d|0,this._e=g+this._e|0,this._f=v+this._f|0,this._g=y+this._g|0,this._h=m+this._h|0},r.prototype._hash=function(){var t=new Buffer(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=r}).call(this,t("buffer").Buffer)},{"./hash":48,buffer:3,inherits:46}],54:[function(t,e){(function(Buffer){function r(){this.init(),this._w=s,o.call(this,128,112)}var n=t("inherits"),i=t("./sha512"),o=t("./hash"),s=new Array(160);n(r,i),r.prototype.init=function(){return this._a=-876896931,this._b=1654270250,this._c=-1856437926,this._d=355462360,this._e=1731405415,this._f=-1900787065,this._g=-619958771,this._h=1203062813,this._al=-1056596264,this._bl=914150663,this._cl=812702999,this._dl=-150054599,this._el=-4191439,this._fl=1750603025,this._gl=1694076839,this._hl=-1090891868,this},r.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new Buffer(48);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),e},e.exports=r}).call(this,t("buffer").Buffer)},{"./hash":48,"./sha512":55,buffer:3,inherits:46}],55:[function(t,e){(function(Buffer){function r(){this.init(),this._w=d,l.call(this,128,112)}function n(t,e,r){return r^t&(e^r)}function i(t,e,r){return t&e|r&(t|e)}function o(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function s(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function f(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function u(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function a(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function h(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}var c=t("inherits"),l=t("./hash"),p=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],d=new Array(160);c(r,l),r.prototype.init=function(){return this._a=1779033703,this._b=-1150833019,this._c=1013904242,this._d=-1521486534,this._e=1359893119,this._f=-1694144372,this._g=528734635,this._h=1541459225,this._al=-205731576,this._bl=-2067093701,this._cl=-23791573,this._dl=1595750129,this._el=-1377402159,this._fl=725511199,this._gl=-79577749,this._hl=327033209,this},r.prototype._update=function(t){function e(){var t=d[k-30],e=d[k-30+1],r=f(t,e),n=u(e,t);t=d[k-4],e=d[k-4+1];var i=a(t,e),o=h(e,t),s=d[k-14],p=d[k-14+1],g=d[k-32],v=d[k-32+1];l=n+p,c=r+s+(n>>>0>l>>>0?1:0),l+=o,c=c+i+(o>>>0>l>>>0?1:0),l+=v,c=c+g+(v>>>0>l>>>0?1:0)}function r(){d[k]=c,d[k+1]=l;var t=i(g,v,y),e=i(S,T,O),r=o(g,S),f=o(S,g),u=s(b,P),a=s(P,b),h=p[k],L=p[k+1],D=n(b,w,_),U=n(P,I,x),M=A+a,j=E+u+(A>>>0>M>>>0?1:0);M+=U,j=j+D+(U>>>0>M>>>0?1:0),M+=L,j=j+h+(L>>>0>M>>>0?1:0),M+=l,j=j+c+(l>>>0>M>>>0?1:0);var N=f+e,C=r+t+(f>>>0>N>>>0?1:0);E=_,A=x,_=w,x=I,w=b,I=P,P=B+M|0,b=m+j+(B>>>0>P>>>0?1:0)|0,m=y,B=O,y=v,O=T,v=g,T=S,S=M+N|0,g=j+C+(M>>>0>S>>>0?1:0)|0,R++,k+=2}for(var c,l,d=this._w,g=0|this._a,v=0|this._b,y=0|this._c,m=0|this._d,b=0|this._e,w=0|this._f,_=0|this._g,E=0|this._h,S=0|this._al,T=0|this._bl,O=0|this._cl,B=0|this._dl,P=0|this._el,I=0|this._fl,x=0|this._gl,A=0|this._hl,R=0,k=0;16>R;)c=t.readInt32BE(4*k),l=t.readInt32BE(4*k+4),r();for(;80>R;)e(),r();this._al=this._al+S|0,this._bl=this._bl+T|0,this._cl=this._cl+O|0,this._dl=this._dl+B|0,this._el=this._el+P|0,this._fl=this._fl+I|0,this._gl=this._gl+x|0,this._hl=this._hl+A|0,this._a=this._a+g+(this._al>>>0<S>>>0?1:0)|0,this._b=this._b+v+(this._bl>>>0<T>>>0?1:0)|0,this._c=this._c+y+(this._cl>>>0<O>>>0?1:0)|0,this._d=this._d+m+(this._dl>>>0<B>>>0?1:0)|0,this._e=this._e+b+(this._el>>>0<P>>>0?1:0)|0,this._f=this._f+w+(this._fl>>>0<I>>>0?1:0)|0,this._g=this._g+_+(this._gl>>>0<x>>>0?1:0)|0,this._h=this._h+E+(this._hl>>>0<A>>>0?1:0)|0},r.prototype._hash=function(){function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}var e=new Buffer(64);return t(this._a,this._al,0),t(this._b,this._bl,8),t(this._c,this._cl,16),t(this._d,this._dl,24),t(this._e,this._el,32),t(this._f,this._fl,40),t(this._g,this._gl,48),t(this._h,this._hl,56),e},e.exports=r}).call(this,t("buffer").Buffer)},{"./hash":48,buffer:3,inherits:46}],56:[function(t,e){(function(Buffer){"use strict";function r(t,e){o.call(this),t=t.toLowerCase(),"string"==typeof e&&(e=new Buffer(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=n(t).update(e).digest():e.length<r&&(e=Buffer.concat([e,s],r));for(var i=this._ipad=new Buffer(r),f=this._opad=new Buffer(r),u=0;r>u;u++)i[u]=54^e[u],f[u]=92^e[u];this._hash=n(t).update(i)}var n=t("create-hash/browser"),i=t("inherits"),o=t("stream").Transform,s=new Buffer(128);s.fill(0),i(r,o),r.prototype.update=function(t,e){return this._hash.update(t,e),this},r.prototype._transform=function(t,e,r){this._hash.update(t),r()},r.prototype._flush=function(t){this.push(this.digest()),t()},r.prototype.digest=function(t){var e=this._hash.digest();return n(this._alg).update(this._opad).update(e).digest(t)},e.exports=function(t,e){return new r(t,e)}}).call(this,t("buffer").Buffer)},{buffer:3,"create-hash/browser":42,inherits:57,stream:27}],57:[function(t,e,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],58:[function(t,e){function r(t,e,r,n,i,o,s){this.p=t,this.a=e,this.b=r,this.G=Point.fromAffine(this,n,i),this.n=o,this.h=s,this.infinity=new Point(this,null,null,BigInteger.ZERO),this.pOverFour=t.add(BigInteger.ONE).shiftRight(2)}var n=t("assert"),BigInteger=t("bigi"),Point=t("./point");r.prototype.pointFromX=function(t,e){var r=e.pow(3).add(this.a.multiply(e)).add(this.b).mod(this.p),n=r.modPow(this.pOverFour,this.p),i=n;return n.isEven()^!t&&(i=this.p.subtract(i)),Point.fromAffine(this,e,i)},r.prototype.isInfinity=function(t){return t===this.infinity?!0:0===t.z.signum()&&0!==t.y.signum()},r.prototype.isOnCurve=function(t){if(this.isInfinity(t))return!0;var e=t.affineX,r=t.affineY,n=this.a,i=this.b,o=this.p;if(e.signum()<0||e.compareTo(o)>=0)return!1;if(r.signum()<0||r.compareTo(o)>=0)return!1;var s=r.square().mod(o),f=e.pow(3).add(n.multiply(e)).add(i).mod(o);return s.equals(f)},r.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},e.exports=r},{"./point":62,assert:1,bigi:34}],59:[function(t,e){e.exports={secp128r1:{p:"fffffffdffffffffffffffffffffffff",a:"fffffffdfffffffffffffffffffffffc",b:"e87579c11079f43dd824993c2cee5ed3",n:"fffffffe0000000075a30d1b9038a115",h:"01",Gx:"161ff7528b899b2d0c28607ca52c5b86",Gy:"cf5ac8395bafeb13c02da292dded7a83"},secp160k1:{p:"fffffffffffffffffffffffffffffffeffffac73",a:"00",b:"07",n:"0100000000000000000001b8fa16dfab9aca16b6b3",h:"01",Gx:"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",Gy:"938cf935318fdced6bc28286531733c3f03c4fee"},secp160r1:{p:"ffffffffffffffffffffffffffffffff7fffffff",a:"ffffffffffffffffffffffffffffffff7ffffffc",b:"1c97befc54bd7a8b65acf89f81d4d4adc565fa45",n:"0100000000000000000001f4c8f927aed3ca752257",h:"01",Gx:"4a96b5688ef573284664698968c38bb913cbfc82",Gy:"23a628553168947d59dcc912042351377ac5fb32"},secp192k1:{p:"fffffffffffffffffffffffffffffffffffffffeffffee37",a:"00",b:"03",n:"fffffffffffffffffffffffe26f2fc170f69466a74defd8d",h:"01",Gx:"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",Gy:"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},secp192r1:{p:"fffffffffffffffffffffffffffffffeffffffffffffffff",a:"fffffffffffffffffffffffffffffffefffffffffffffffc",b:"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",n:"ffffffffffffffffffffffff99def836146bc9b1b4d22831",h:"01",Gx:"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",Gy:"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},secp256k1:{p:"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",a:"00",b:"07",n:"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",h:"01",Gx:"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",Gy:"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},secp256r1:{p:"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",a:"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",b:"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",n:"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",h:"01",Gx:"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",Gy:"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}}},{}],60:[function(t,e){var Point=t("./point"),r=t("./curve"),n=t("./names");e.exports={Curve:r,Point:Point,getCurveByName:n}},{"./curve":58,"./names":61,"./point":62}],61:[function(t,e){function r(t){var e=n[t];if(!e)return null;var r=new BigInteger(e.p,16),o=new BigInteger(e.a,16),s=new BigInteger(e.b,16),f=new BigInteger(e.n,16),u=new BigInteger(e.h,16),a=new BigInteger(e.Gx,16),h=new BigInteger(e.Gy,16);return new i(r,o,s,a,h,f,u)}var BigInteger=t("bigi"),n=t("./curves"),i=t("./curve");e.exports=r},{"./curve":58,"./curves":59,bigi:34}],62:[function(t,e){(function(Buffer){function Point(t,e,n,i){r.notStrictEqual(i,void 0,"Missing Z coordinate"),this.curve=t,this.x=e,this.y=n,this.z=i,this._zInv=null,this.compressed=!0}var r=t("assert"),BigInteger=t("bigi"),n=BigInteger.valueOf(3);Object.defineProperty(Point.prototype,"zInv",{get:function(){return null===this._zInv&&(this._zInv=this.z.modInverse(this.curve.p)),this._zInv}}),Object.defineProperty(Point.prototype,"affineX",{get:function(){return this.x.multiply(this.zInv).mod(this.curve.p)}}),Object.defineProperty(Point.prototype,"affineY",{get:function(){return this.y.multiply(this.zInv).mod(this.curve.p)}}),Point.fromAffine=function(t,e,r){return new Point(t,e,r,BigInteger.ONE)},Point.prototype.equals=function(t){if(t===this)return!0;if(this.curve.isInfinity(this))return this.curve.isInfinity(t);if(this.curve.isInfinity(t))return this.curve.isInfinity(this);var e=t.y.multiply(this.z).subtract(this.y.multiply(t.z)).mod(this.curve.p);if(0!==e.signum())return!1;var r=t.x.multiply(this.z).subtract(this.x.multiply(t.z)).mod(this.curve.p);return 0===r.signum()},Point.prototype.negate=function(){var t=this.curve.p.subtract(this.y);return new Point(this.curve,this.x,t,this.z)},Point.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,i=t.x,o=t.y,s=o.multiply(this.z).subtract(r.multiply(t.z)).mod(this.curve.p),f=i.multiply(this.z).subtract(e.multiply(t.z)).mod(this.curve.p);if(0===f.signum())return 0===s.signum()?this.twice():this.curve.infinity;var u=f.square(),a=u.multiply(f),h=e.multiply(u),c=s.square().multiply(this.z),l=c.subtract(h.shiftLeft(1)).multiply(t.z).subtract(a).multiply(f).mod(this.curve.p),p=h.multiply(n).multiply(s).subtract(r.multiply(a)).subtract(c.multiply(s)).multiply(t.z).add(s.multiply(a)).mod(this.curve.p),d=a.multiply(this.z).multiply(t.z).mod(this.curve.p);return new Point(this.curve,l,p,d)},Point.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),i=r.multiply(e).mod(this.curve.p),o=this.curve.a,s=t.square().multiply(n);0!==o.signum()&&(s=s.add(this.z.square().multiply(o))),s=s.mod(this.curve.p);var f=s.square().subtract(t.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.p),u=s.multiply(n).multiply(t).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(s.pow(3)).mod(this.curve.p),a=r.pow(3).shiftLeft(3).mod(this.curve.p);return new Point(this.curve,f,u,a)},Point.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(n),i=this.negate(),o=this,s=r.bitLength()-2;s>0;--s){o=o.twice();var f=r.testBit(s),u=e.testBit(s);f!=u&&(o=o.add(f?this:i))}return o},Point.prototype.multiplyTwo=function(t,e,r){var n;n=t.bitLength()>r.bitLength()?t.bitLength()-1:r.bitLength()-1;for(var i=this.curve.infinity,o=this.add(e);n>=0;){i=i.twice();var s=t.testBit(n),f=r.testBit(n);s?i=i.add(f?o:this):f&&(i=i.add(e)),--n}return i},Point.prototype.getEncoded=function(t){if(void 0==t&&(t=this.compressed),this.curve.isInfinity(this))return new Buffer("00","hex");var e,r=this.affineX,n=this.affineY,i=Math.floor((this.curve.p.bitLength()+7)/8);return t?(e=new Buffer(1+i),e.writeUInt8(n.isEven()?2:3,0)):(e=new Buffer(1+i+i),e.writeUInt8(4,0),n.toBuffer(i).copy(e,1+i)),r.toBuffer(i).copy(e,1),e},Point.decodeFrom=function(t,e){var n,i=e.readUInt8(0),o=4!==i,s=BigInteger.fromBuffer(e.slice(1,33)),f=Math.floor((t.p.bitLength()+7)/8);if(o){r.equal(e.length,f+1,"Invalid sequence length"),r(2===i||3===i,"Invalid sequence tag");var u=3===i;n=t.pointFromX(u,s)}else{r.equal(e.length,1+f+f,"Invalid sequence length");var a=BigInteger.fromBuffer(e.slice(1+f));n=Point.fromAffine(t,s,a)}return n.compressed=o,n},Point.prototype.toString=function(){return this.curve.isInfinity(this)?"(INFINITY)":"("+this.affineX.toString()+","+this.affineY.toString()+")"},e.exports=Point}).call(this,t("buffer").Buffer)},{assert:1,bigi:34,buffer:3}],63:[function(t,e,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],64:[function(t,e){(function(t,r,Buffer){"use strict";function n(e,r){var n=new Buffer(e);return o.getRandomValues(n),"function"==typeof r?t.nextTick(function(){r(null,n)}):n}function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r.crypto||r.msCrypto;e.exports=o&&o.getRandomValues?n:i}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{_process:10,buffer:3}],65:[function(t,e){(function(Buffer){function r(t,e){if(this.tfError=Error.call(this),1===arguments.length&&"string"==typeof t)this.message=t;else{this.tfType=t,this.tfValue=e;var r;Object.defineProperty(this,"message",{get:function(){return r?r:r=a(t,e)}})}}function n(t,e,r,n){this.tfError=n||Error.call(this),this.tfProperty=e,this.tfType=t,this.tfValue=r;var i;Object.defineProperty(this,"message",{get:function(){return i?i:i=t?h(t,e,r):'Unexpected property "'+e+'"'}})}function i(t){return t.name||t.toString().match(/function (.*?)\s*\(/)[1]}function o(t){return g.Null(t)?"":i(t.constructor)}function s(t){return g.Function(t)?"":g.String(t)?JSON.stringify(t):t&&g.Object(t)?"":t}function f(t){return g.Function(t)?t.toJSON?t.toJSON():i(t):g.Array(t)?"Array":t&&g.Object(t)?"Object":t||""}function u(t){return t=f(t),g.Object(t)?JSON.stringify(t):t}function a(t,e){var r=o(e),n=s(e);return"Expected "+u(t)+", got"+(""!==r?" "+r:"")+(""!==n?" "+n:"")}function h(t,e,r){return a('property "'+u(e)+'" of type '+u(t),r)}function c(t){if(g.String(t))return"?"===t[0]?v.maybe(c(t.slice(1))):g[t]||v.quacksLike(t);if(t&&g.Object(t)){if(g.Array(t))return v.arrayOf(c(t[0]));var e={};for(var r in t)e[r]=c(t[r]);return v.object(e)}return g.Function(t)?t:v.value(t)}function l(t,e,n,i){if(g.Function(t)){if(t(e,n))return!0;throw new r(i||t,e)}return l(c(t),e,n)}var p=t("inherits");p(r,Error),Object.defineProperty(r,"stack",{get:function(){return this.tfError.stack}}),p(n,Error),Object.defineProperty(n,"stack",{get:function(){return this.tfError.stack}}),n.prototype.asChildOf=function(t){return new n(this.tfType,t+"."+this.tfProperty,this.tfValue,this.tfError)};var d,g={Array:function(t){return null!==t&&void 0!==t&&t.constructor===Array},Boolean:function(t){return"boolean"==typeof t},Buffer:function(t){return Buffer.isBuffer(t)},Function:function(t){return"function"==typeof t},Null:function(t){return void 0===t||null===t},Number:function(t){return"number"==typeof t},Object:function(t){return"object"==typeof t},String:function(t){return"string"==typeof t},"":function(){return!0}},v={arrayOf:function y(t){function y(e,r){return g.Array(e)?e.every(function(e){return l(t,e,r,y)}):!1}return y.toJSON=function(){return[f(t)]},y},maybe:function m(t){function m(e,r){return g.Null(e)||l(t,e,r,m)}return m.toJSON=function(){return"?"+u(t)},m},object:function b(t){function b(e,i){if(!g.Object(e))return!1;if(g.Null(e))return!1;var o;try{for(o in t){var s=t[o],f=e[o];l(s,f,i)}}catch(u){if(u instanceof n)throw u.asChildOf(o);if(u instanceof r)throw new n(u.tfType,o,u.tfValue,u.tfError);throw u}if(i)for(o in e)if(!t[o])throw new n(void 0,o);return!0}return b.toJSON=function(){return f(t)},b},map:function w(t,e){function w(i,o){if(l(g.Object,i,o),g.Null(i))return!1;var s;try{for(s in i){e&&l(e,s,o);var f=i[s];l(t,f,o)}}catch(u){if(u instanceof n)throw u.asChildOf(s);if(u instanceof r)throw new n(u.tfType,e||s,u.tfValue);throw u}return!0}return w.toJSON=e?function(){return"{"+u(e)+": "+u(t)+"}"}:function(){return"{"+u(t)+"}"},w},oneOf:function _(){function _(e,i){return t.some(function(t){try{return l(t,e,i)}catch(o){if(o instanceof r||o instanceof n)return!1;throw o}})}var t=[].slice.call(arguments);return _.toJSON=function(){return t.map(u).join("|")},_},quacksLike:function E(t){function E(e){return t===o(e)}return E.toJSON=function(){return t},E},tuple:function S(){function S(e,r){return t.every(function(t,n){return l(t,e[n],r)})}var t=[].slice.call(arguments);return S.toJSON=function(){return"("+t.map(u).join(", ")+")"},S},value:function T(t){function T(e){return e===t}return T.toJSON=function(){return t},T}};Object.keys(g).forEach(function(t){var e=g[t];e.toJSON=function(){return t},l[t]=e});for(d in v)l[d]=v[d];e.exports=l,e.exports.compile=c,e.exports.TfTypeError=r,e.exports.TfPropertyTypeError=n}).call(this,{isBuffer:t("../../../.node_modules/lib/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js")})},{"../../../.node_modules/lib/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js":9,inherits:63}],66:[function(t,e){(function(Buffer){function r(t,e){if(void 0!==e&&t[0]!==e)throw new Error("Invalid network version");if(33===t.length)return{version:t[0],privateKey:t.slice(1,33),compressed:!1};if(34!==t.length)throw new Error("Invalid WIF length");if(1!==t[33])throw new Error("Invalid compression flag");return{version:t[0],privateKey:t.slice(1,33),compressed:!0}}function n(t,e,r){var n=new Buffer(r?34:33);return n.writeUInt8(t,0),e.copy(n,1),r&&(n[33]=1),n}function i(t,e){return r(s.decode(t),e)}function o(t,e,r){return s.encode("number"==typeof t?n(t,e,r):n(t.version,t.privateKey,t.compressed))}var s=t("bs58check");
e.exports={decode:i,decodeRaw:r,encode:o,encodeRaw:n}}).call(this,t("buffer").Buffer)},{bs58check:38,buffer:3}],67:[function(t,e){(function(Buffer){function r(t){var e=s.decode(t);if(e.length<21)throw new TypeError(t+" is too short");if(e.length>21)throw new TypeError(t+" is too long");var r=e[0],n=e.slice(1);return{hash:n,version:r}}function n(t,e){if(e=e||u.bitcoin,f.isPubKeyHashOutput(t))return i(f.compile(t).slice(3,23),e.pubKeyHash);if(f.isScriptHashOutput(t))return i(f.compile(t).slice(2,22),e.scriptHash);throw new Error(f.toASM(t)+" has no matching Address")}function i(t,e){a(h.tuple(h.Hash160bit,h.UInt8),arguments);var r=new Buffer(21);return r.writeUInt8(e,0),t.copy(r,1),s.encode(r)}function o(t,e){e=e||u.bitcoin;var n=r(t);if(n.version===e.pubKeyHash)return f.pubKeyHashOutput(n.hash);if(n.version===e.scriptHash)return f.scriptHashOutput(n.hash);throw new Error(t+" has no matching Script")}var s=t("bs58check"),f=t("./script"),u=t("./networks"),a=t("typeforce"),h=t("./types");e.exports={fromBase58Check:r,fromOutputScript:n,toBase58Check:i,toOutputScript:o}}).call(this,t("buffer").Buffer)},{"./networks":77,"./script":79,"./types":83,bs58check:38,buffer:3,typeforce:65}],68:[function(t,e){(function(Buffer){function r(){this.version=1,this.prevHash=null,this.merkleRoot=null,this.timestamp=0,this.bits=0,this.nonce=0}var n=t("create-hash"),i=t("./bufferutils"),o=t("./crypto"),s=t("buffer-compare"),f=t("buffer-reverse"),u=t("./transaction");r.fromBuffer=function(t){function e(e){return f+=e,t.slice(f-e,f)}function n(){var e=t.readUInt32LE(f);return f+=4,e}function o(){var e=i.readVarInt(t,f);return f+=e.size,e.number}function s(){var e=u.fromBuffer(t.slice(f),!0);return f+=e.byteLength(),e}if(t.length<80)throw new Error("Buffer too small (< 80 bytes)");var f=0,a=new r;if(a.version=n(),a.prevHash=e(32),a.merkleRoot=e(32),a.timestamp=n(),a.bits=n(),a.nonce=n(),80===t.length)return a;var h=o();a.transactions=[];for(var c=0;h>c;++c){var l=s();a.transactions.push(l)}return a},r.fromHex=function(t){return r.fromBuffer(new Buffer(t,"hex"))},r.prototype.getHash=function(){return o.hash256(this.toBuffer(!0))},r.prototype.getId=function(){return f(this.getHash()).toString("hex")},r.prototype.getUTCDate=function(){var t=new Date(0);return t.setUTCSeconds(this.timestamp),t},r.prototype.toBuffer=function(t){function e(t){t.copy(n,o),o+=t.length}function r(t){n.writeUInt32LE(t,o),o+=4}var n=new Buffer(80),o=0;if(r(this.version),e(this.prevHash),e(this.merkleRoot),r(this.timestamp),r(this.bits),r(this.nonce),t||!this.transactions)return n;var s=i.varIntBuffer(this.transactions.length),f=this.transactions.map(function(t){return t.toBuffer()});return Buffer.concat([n,s].concat(f))},r.prototype.toHex=function(t){return this.toBuffer(t).toString("hex")},r.calculateTarget=function(t){var e=((4278190080&t)>>24)-3,r=8388607&t,n=31-e,i=new Buffer(32);return i.fill(0),i[n]=255&r,i[n-1]=r>>8,i[n-2]=r>>16,i[n-3]=r>>24,i},r.calculateMerkleRoot=function(t){var e=t.length;if(0===e)throw TypeError("Cannot compute merkle root for zero transactions");for(var r=t.map(function(t){return t.getHash()});e>1;){for(var i=0,s=0;e>s;s+=2,++i){var f=n("sha256");f.update(r[s]),f.update(s+1!==e?r[s+1]:r[s]),r[i]=o.sha256(f.digest())}e=i}return r[0]},r.prototype.checkMerkleRoot=function(){if(!this.transactions)return!1;var t=r.calculateMerkleRoot(this.transactions);return 0===s(this.merkleRoot,t)},r.prototype.checkProofOfWork=function(){var t=f(this.getHash()),e=r.calculateTarget(this.bits);return s(t,e)<=0},e.exports=r}).call(this,t("buffer").Buffer)},{"./bufferutils":69,"./crypto":70,"./transaction":81,buffer:3,"buffer-compare":39,"buffer-reverse":41,"create-hash":42}],69:[function(t,e){(function(Buffer){function r(t,e){if("number"!=typeof t)throw new Error("cannot write a non-number as a number");if(0>t)throw new Error("specified a negative value for writing an unsigned value");if(t>e)throw new Error("value is larger than maximum value for type");if(Math.floor(t)!==t)throw new Error("value has a fractional component")}function n(t){return t<l.OP_PUSHDATA1?1:255>=t?2:65535>=t?3:5}function i(t,e){var r,n,i=t.readUInt8(e);if(i<l.OP_PUSHDATA1)r=i,n=1;else if(i===l.OP_PUSHDATA1){if(e+2>t.length)return null;r=t.readUInt8(e+1),n=2}else if(i===l.OP_PUSHDATA2){if(e+3>t.length)return null;r=t.readUInt16LE(e+1),n=3}else{if(e+5>t.length)return null;if(i!==l.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=t.readUInt32LE(e+1),n=5}return{opcode:i,number:r,size:n}}function o(t,e){var n=t.readUInt32LE(e),i=t.readUInt32LE(e+4);return i*=4294967296,r(i+n,9007199254740991),i+n}function s(t,e){var r,n,i=t.readUInt8(e);return 253>i?(r=i,n=1):254>i?(r=t.readUInt16LE(e+1),n=3):255>i?(r=t.readUInt32LE(e+1),n=5):(r=o(t,e+1),n=9),{number:r,size:n}}function f(t,e,r){var i=n(e);return 1===i?t.writeUInt8(e,r):2===i?(t.writeUInt8(l.OP_PUSHDATA1,r),t.writeUInt8(e,r+1)):3===i?(t.writeUInt8(l.OP_PUSHDATA2,r),t.writeUInt16LE(e,r+1)):(t.writeUInt8(l.OP_PUSHDATA4,r),t.writeUInt32LE(e,r+1)),i}function u(t,e,n){r(e,9007199254740991),t.writeInt32LE(-1&e,n),t.writeUInt32LE(Math.floor(e/4294967296),n+4)}function a(t){return 253>t?1:65536>t?3:4294967296>t?5:9}function h(t,e,r){var n=a(e);return 1===n?t.writeUInt8(e,r):3===n?(t.writeUInt8(253,r),t.writeUInt16LE(e,r+1)):5===n?(t.writeUInt8(254,r),t.writeUInt32LE(e,r+1)):(t.writeUInt8(255,r),u(t,e,r+1)),n}function c(t){var e=a(t),r=new Buffer(e);return h(r,t,0),r}var l=t("./opcodes.json");e.exports={equal:t("buffer-equals"),pushDataSize:n,readPushDataInt:i,readUInt64LE:o,readVarInt:s,reverse:t("buffer-reverse"),varIntBuffer:c,varIntSize:a,writePushDataInt:f,writeUInt64LE:u,writeVarInt:h}}).call(this,t("buffer").Buffer)},{"./opcodes.json":78,buffer:3,"buffer-equals":40,"buffer-reverse":41}],70:[function(t,e){function r(t){return i(s(t))}function n(t){return s(s(t))}function i(t){return f("rmd160").update(t).digest()}function o(t){return f("sha1").update(t).digest()}function s(t){return f("sha256").update(t).digest()}var f=t("create-hash");e.exports={hash160:r,hash256:n,ripemd160:i,sha1:o,sha256:s}},{"create-hash":42}],71:[function(t,e){(function(Buffer){function r(t,e,r){u(a.tuple(a.Hash256bit,a.Buffer256bit,a.Function),arguments);var n=new Buffer(32),i=new Buffer(32);i.fill(1),n.fill(0),n=f("sha256",n).update(i).update(c).update(e).update(t).digest(),i=f("sha256",n).update(i).digest(),n=f("sha256",n).update(i).update(l).update(e).update(t).digest(),i=f("sha256",n).update(i).digest(),i=f("sha256",n).update(i).digest();for(var o=BigInteger.fromBuffer(i);o.signum()<=0||o.compareTo(d.n)>=0||!r(o);)n=f("sha256",n).update(i).update(c).digest(),i=f("sha256",n).update(i).digest(),i=f("sha256",n).update(i).digest(),o=BigInteger.fromBuffer(i);return o}function n(t,e){u(a.tuple(a.Hash256bit,a.BigInt),arguments);var n,i,o=e.toBuffer(32),s=BigInteger.fromBuffer(t),f=d.n,c=d.G;return r(t,o,function(t){var r=c.multiply(t);return d.isInfinity(r)?!1:(n=r.affineX.mod(f),0===n.signum()?!1:(i=t.modInverse(f).multiply(s.add(e.multiply(n))).mod(f),0===i.signum()?!1:!0))}),i.compareTo(g)>0&&(i=f.subtract(i)),new h(n,i)}function i(t,e,r){u(a.tuple(a.Hash256bit,a.ECSignature,a.ECPoint),arguments);var n=d.n,i=d.G,o=e.r,s=e.s;if(o.signum()<=0||o.compareTo(n)>=0)return!1;if(s.signum()<=0||s.compareTo(n)>=0)return!1;var f=BigInteger.fromBuffer(t),h=s.modInverse(n),c=f.multiply(h).mod(n),l=o.multiply(h).mod(n),p=i.multiplyTwo(c,r,l);if(d.isInfinity(p))return!1;var g=p.affineX,v=g.mod(n);return v.equals(o)}function o(t,e,r){u(a.tuple(a.BigInt,a.ECSignature,a.UInt2),arguments);var n=d.n,i=d.G,o=e.r,s=e.s;if(o.signum()<=0||o.compareTo(n)>=0)throw new Error("Invalid r value");if(s.signum()<=0||s.compareTo(n)>=0)throw new Error("Invalid s value");var f=1&r,h=r>>1,c=h?o.add(n):o,l=d.pointFromX(f,c),p=l.multiply(n);if(!d.isInfinity(p))throw new Error("nR is not a valid curve point");var g=o.modInverse(n),v=t.negate().mod(n),y=l.multiplyTwo(s,i,v).multiply(g);return d.validate(y),y}function s(t,e,r){u(a.tuple(a.BigInt,a.ECSignature,a.ECPoint),arguments);for(var n=0;4>n;n++){var i=o(t,e,n);if(i.equals(r))return n}throw new Error("Unable to find valid recovery factor")}var f=t("create-hmac"),u=t("typeforce"),a=t("./types"),BigInteger=t("bigi"),h=t("./ecsignature"),c=new Buffer([0]),l=new Buffer([1]),p=t("ecurve"),d=p.getCurveByName("secp256k1"),g=d.n.shiftRight(1);e.exports={calcPubKeyRecoveryParam:s,deterministicGenerateK:r,recoverPubKey:o,sign:n,verify:i,__curve:d}}).call(this,t("buffer").Buffer)},{"./ecsignature":73,"./types":83,bigi:34,buffer:3,"create-hmac":56,ecurve:60,typeforce:65}],72:[function(t,e){function ECPair(t,e,r){if(r&&s({compressed:f.maybe(f.Boolean),network:f.maybe(f.Network)},r),r=r||{},t){if(t.signum()<=0)throw new Error("Private key must be greater than 0");if(t.compareTo(c.n)>=0)throw new Error("Private key must be less than the curve order");if(e)throw new TypeError("Unexpected publicKey parameter");this.d=t}else s(f.ECPoint,e),this.__Q=e;this.compressed=void 0===r.compressed?!0:r.compressed,this.network=r.network||a.bitcoin}var r=t("./address"),n=t("./crypto"),i=t("./ecdsa"),o=t("randombytes"),s=t("typeforce"),f=t("./types"),u=t("wif"),a=t("./networks"),BigInteger=t("bigi"),h=t("ecurve"),c=i.__curve;Object.defineProperty(ECPair.prototype,"Q",{get:function(){return!this.__Q&&this.d&&(this.__Q=c.G.multiply(this.d)),this.__Q}}),ECPair.fromPublicKeyBuffer=function(t,e){var r=h.Point.decodeFrom(c,t);return new ECPair(null,r,{compressed:r.compressed,network:e})},ECPair.fromWIF=function(t,e){var r=u.decode(t),n=r.version;if(f.Array(e)){if(e=e.filter(function(t){return n===t.wif}).pop(),!e)throw new Error("Unknown network version")}else if(e=e||a.bitcoin,n!==e.wif)throw new Error("Invalid network version");var i=BigInteger.fromBuffer(r.privateKey);return new ECPair(i,null,{compressed:r.compressed,network:e})},ECPair.makeRandom=function(t){t=t||{};var e,r=t.rng||o;do{var n=r(32);s(f.Buffer256bit,n),e=BigInteger.fromBuffer(n)}while(e.signum()<=0||e.compareTo(c.n)>=0);return new ECPair(e,null,t)},ECPair.prototype.getAddress=function(){return r.toBase58Check(n.hash160(this.getPublicKeyBuffer()),this.getNetwork().pubKeyHash)},ECPair.prototype.getNetwork=function(){return this.network},ECPair.prototype.getPublicKeyBuffer=function(){return this.Q.getEncoded(this.compressed)},ECPair.prototype.sign=function(t){if(!this.d)throw new Error("Missing private key");return i.sign(t,this.d)},ECPair.prototype.toWIF=function(){if(!this.d)throw new Error("Missing private key");return u.encode(this.network.wif,this.d.toBuffer(32),this.compressed)},ECPair.prototype.verify=function(t,e){return i.verify(t,e,this.Q)},e.exports=ECPair},{"./address":67,"./crypto":70,"./ecdsa":71,"./networks":77,"./types":83,bigi:34,ecurve:60,randombytes:64,typeforce:65,wif:66}],73:[function(t,e){(function(Buffer){function r(t,e){i(o.tuple(o.BigInt,o.BigInt),arguments),this.r=t,this.s=e}var n=t("bip66"),i=t("typeforce"),o=t("./types"),BigInteger=t("bigi");r.parseCompact=function(t){if(65!==t.length)throw new Error("Invalid signature length");var e=t.readUInt8(0)-27;if(e!==(7&e))throw new Error("Invalid signature parameter");var n=!!(4&e),i=3&e,o=BigInteger.fromBuffer(t.slice(1,33)),s=BigInteger.fromBuffer(t.slice(33));return{compressed:n,i:i,signature:new r(o,s)}},r.fromDER=function(t){var e=n.decode(t),i=BigInteger.fromDERInteger(e.r),o=BigInteger.fromDERInteger(e.s);return new r(i,o)},r.parseScriptSignature=function(t){var e=t.readUInt8(t.length-1),n=-129&e;if(0>=n||n>=4)throw new Error("Invalid hashType "+e);return{signature:r.fromDER(t.slice(0,-1)),hashType:e}},r.prototype.toCompact=function(t,e){e&&(t+=4),t+=27;var r=new Buffer(65);return r.writeUInt8(t,0),this.r.toBuffer(32).copy(r,1),this.s.toBuffer(32).copy(r,33),r},r.prototype.toDER=function(){var t=new Buffer(this.r.toDERInteger()),e=new Buffer(this.s.toDERInteger());return n.encode(t,e)},r.prototype.toScriptSignature=function(t){var e=-129&t;if(0>=e||e>=4)throw new Error("Invalid hashType "+t);var r=new Buffer(1);return r.writeUInt8(t,0),Buffer.concat([this.toDER(),r])},e.exports=r}).call(this,t("buffer").Buffer)},{"./types":83,bigi:34,bip66:36,buffer:3,typeforce:65}],74:[function(t,e){(function(Buffer){function r(t,e){if(s(f.tuple("ECPair",f.Buffer256bit),arguments),!t.compressed)throw new TypeError("BIP32 only allows compressed keyPairs");this.keyPair=t,this.chainCode=e,this.depth=0,this.index=0,this.parentFingerprint=0}var n=t("bs58check"),i=t("./crypto"),o=t("create-hmac"),s=t("typeforce"),f=t("./types"),u=t("./networks"),BigInteger=t("bigi"),ECPair=t("./ecpair"),a=t("ecurve"),h=a.getCurveByName("secp256k1");r.HIGHEST_BIT=2147483648,r.LENGTH=78,r.MASTER_SECRET=new Buffer("Bitcoin seed"),r.fromSeedBuffer=function(t,e){if(s(f.tuple(f.Buffer,f.maybe(f.Network)),arguments),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");var n=o("sha512",r.MASTER_SECRET).update(t).digest(),i=n.slice(0,32),u=n.slice(32),a=BigInteger.fromBuffer(i),h=new ECPair(a,null,{network:e});return new r(h,u)},r.fromSeedHex=function(t,e){return r.fromSeedBuffer(new Buffer(t,"hex"),e)},r.fromBase58=function(t,e){var i=n.decode(t);if(78!==i.length)throw new Error("Invalid buffer length");var o,s=i.readUInt32BE(0);if(Array.isArray(e)){if(o=e.filter(function(t){return s===t.bip32["private"]||s===t.bip32["public"]}).pop(),!o)throw new Error("Unknown network version")}else o=e||u.bitcoin;if(s!==o.bip32["private"]&&s!==o.bip32["public"])throw new Error("Invalid network version");var f=i[4],c=i.readUInt32BE(5);if(0===f&&0!==c)throw new Error("Invalid parent fingerprint");var l=i.readUInt32BE(9);if(0===f&&0!==l)throw new Error("Invalid index");var p,d=i.slice(13,45);if(s===o.bip32["private"]){if(0!==i.readUInt8(45))throw new Error("Invalid private key");var g=BigInteger.fromBuffer(i.slice(46,78));p=new ECPair(g,null,{network:o})}else{var v=a.Point.decodeFrom(h,i.slice(45,78));if(!v.compressed)throw new Error("Invalid public key");h.validate(v),p=new ECPair(null,v,{network:o})}var y=new r(p,d);return y.depth=f,y.index=l,y.parentFingerprint=c,y},r.prototype.getAddress=function(){return this.keyPair.getAddress()},r.prototype.getIdentifier=function(){return i.hash160(this.keyPair.getPublicKeyBuffer())},r.prototype.getFingerprint=function(){return this.getIdentifier().slice(0,4)},r.prototype.getNetwork=function(){return this.keyPair.getNetwork()},r.prototype.getPublicKeyBuffer=function(){return this.keyPair.getPublicKeyBuffer()},r.prototype.neutered=function(){var t=new ECPair(null,this.keyPair.Q,{network:this.keyPair.network}),e=new r(t,this.chainCode);return e.depth=this.depth,e.index=this.index,e.parentFingerprint=this.parentFingerprint,e},r.prototype.sign=function(t){return this.keyPair.sign(t)},r.prototype.verify=function(t,e){return this.keyPair.verify(t,e)},r.prototype.toBase58=function(t){if(void 0!==t)throw new TypeError("Unsupported argument in 2.0.0");var e=this.keyPair.network,r=this.isNeutered()?e.bip32["public"]:e.bip32["private"],i=new Buffer(78);return i.writeUInt32BE(r,0),i.writeUInt8(this.depth,4),i.writeUInt32BE(this.parentFingerprint,5),i.writeUInt32BE(this.index,9),this.chainCode.copy(i,13),this.isNeutered()?this.keyPair.getPublicKeyBuffer().copy(i,45):(i.writeUInt8(0,45),this.keyPair.d.toBuffer(32).copy(i,46)),n.encode(i)},r.prototype.derive=function(t){s(f.UInt32,t);var e=t>=r.HIGHEST_BIT,n=new Buffer(37);if(e){if(this.isNeutered())throw new TypeError("Could not derive hardened child key");n[0]=0,this.keyPair.d.toBuffer(32).copy(n,1),n.writeUInt32BE(t,33)}else this.keyPair.getPublicKeyBuffer().copy(n,0),n.writeUInt32BE(t,33);var i=o("sha512",this.chainCode).update(n).digest(),u=i.slice(0,32),a=i.slice(32),c=BigInteger.fromBuffer(u);if(c.compareTo(h.n)>=0)return this.derive(t+1);var l;if(this.isNeutered()){var p=h.G.multiply(c).add(this.keyPair.Q);if(h.isInfinity(p))return this.derive(t+1);l=new ECPair(null,p,{network:this.keyPair.network})}else{var d=c.add(this.keyPair.d).mod(h.n);if(0===d.signum())return this.derive(t+1);l=new ECPair(d,null,{network:this.keyPair.network})}var g=new r(l,a);return g.depth=this.depth+1,g.index=t,g.parentFingerprint=this.getFingerprint().readUInt32BE(0),g},r.prototype.deriveHardened=function(t){return s(f.UInt31,t),this.derive(t+r.HIGHEST_BIT)},r.prototype.isNeutered=function(){return!this.keyPair.d},r.prototype.derivePath=function(t){s(f.Bip32Path,t);var e=t.split("/");if("m"===e[0]){if(this.parentFingerprint)throw new Error("Not a master node");e=e.slice(1)}return e.reduce(function(t,e){var r;return"'"===e.slice(-1)?(r=parseInt(e.slice(0,-1),10),t.deriveHardened(r)):(r=parseInt(e,10),t.derive(r))},this)},r.prototype.toString=r.prototype.toBase58,e.exports=r}).call(this,t("buffer").Buffer)},{"./crypto":70,"./ecpair":72,"./networks":77,"./types":83,bigi:34,bs58check:38,buffer:3,"create-hmac":56,ecurve:60,typeforce:65}],75:[function(t,e){e.exports={Block:t("./block"),ECPair:t("./ecpair"),ECSignature:t("./ecsignature"),HDNode:t("./hdnode"),Transaction:t("./transaction"),TransactionBuilder:t("./transaction_builder"),address:t("./address"),bufferutils:t("./bufferutils"),crypto:t("./crypto"),message:t("./message"),networks:t("./networks"),opcodes:t("./opcodes.json"),script:t("./script")}},{"./address":67,"./block":68,"./bufferutils":69,"./crypto":70,"./ecpair":72,"./ecsignature":73,"./hdnode":74,"./message":76,"./networks":77,"./opcodes.json":78,"./script":79,"./transaction":81,"./transaction_builder":82}],76:[function(t,e){(function(Buffer){function r(t,e){var r=new Buffer(e.messagePrefix),n=new Buffer(t),i=o.varIntBuffer(n.length),f=Buffer.concat([r,i,n]);return s.hash256(f)}function n(t,e,n){n=n||u.bitcoin;var i=r(e,n),o=t.sign(i),s=BigInteger.fromBuffer(i),a=f.calcPubKeyRecoveryParam(s,o,t.Q);return o.toCompact(a,t.compressed)}function i(t,e,n,i){Buffer.isBuffer(e)||(e=new Buffer(e,"base64")),i=i||u.bitcoin;var o=r(n,i),s=a.parseCompact(e),h=BigInteger.fromBuffer(o),c=f.recoverPubKey(h,s.signature,s.i),l=new ECPair(null,c,{compressed:s.compressed,network:i});return l.getAddress()===t}var o=t("./bufferutils"),s=t("./crypto"),f=t("./ecdsa"),u=t("./networks"),BigInteger=t("bigi"),ECPair=t("./ecpair"),a=t("./ecsignature");e.exports={magicHash:r,sign:n,verify:i}}).call(this,t("buffer").Buffer)},{"./bufferutils":69,"./crypto":70,"./ecdsa":71,"./ecpair":72,"./ecsignature":73,"./networks":77,bigi:34,buffer:3}],77:[function(t,e){e.exports={bitcoin:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{"public":76067358,"private":76066276},pubKeyHash:0,scriptHash:5,wif:128,dustThreshold:546},testnet:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{"public":70617039,"private":70615956},pubKeyHash:111,scriptHash:196,wif:239,dustThreshold:546},litecoin:{messagePrefix:"Litecoin Signed Message:\n",bip32:{"public":27108450,"private":27106558},pubKeyHash:48,scriptHash:5,wif:176,dustThreshold:0},dogecoin:{messagePrefix:"Dogecoin Signed Message:\n",bip32:{"public":49990397,"private":49988504},pubKeyHash:30,scriptHash:22,wif:158,dustThreshold:0}}},{}],78:[function(t,e){e.exports={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}},{}],79:[function(t,e){(function(Buffer){function r(t){return Buffer.isBuffer(t)&&(t=o(t)),t.map(function(t){return Buffer.isBuffer(t)?t.toString("hex"):C[t]}).join(" ")}function n(t){return M(j.String,t),i(t.split(" ").map(function(t){return void 0!==N[t]?N[t]:new Buffer(t,"hex")}))}function i(t){if(Buffer.isBuffer(t))return t;M(j.Array,t);var e=t.reduce(function(t,e){return Buffer.isBuffer(e)?t+U.pushDataSize(e.length)+e.length:t+1},0),r=new Buffer(e),n=0;if(t.forEach(function(t){Buffer.isBuffer(t)?(n+=U.writePushDataInt(r,t.length,n),t.copy(r,n),n+=t.length):(r.writeUInt8(t,n),n+=1)}),n!==r.length)throw new Error("Could not decode chunks");return r}function o(t){if(j.Array(t))return t;M(j.Buffer,t);for(var e=[],r=0;r<t.length;){var n=t[r];if(n>N.OP_0&&n<=N.OP_PUSHDATA4){var i=U.readPushDataInt(t,r);if(null===i)return[];if(r+=i.size,r+i.number>t.length)return[];var o=t.slice(r,r+i.number);r+=i.number,e.push(o)}else e.push(n),r+=1}return e}function s(t){if(!Buffer.isBuffer(t))return!1;if(t.length<33)return!1;switch(t[0]){case 2:case 3:return 33===t.length;case 4:return 65===t.length}return!1}function f(t){return Buffer.isBuffer(t)&&u(t[t.length-1])?D.check(t.slice(0,-1)):!1}function u(t){var e=-129&t;return e>0&&4>e}function a(t){var e=o(t);return 2===e.length&&f(e[0])&&s(e[1])}function h(t){var e=i(t);return 25===e.length&&e[0]===N.OP_DUP&&e[1]===N.OP_HASH160&&20===e[2]&&e[23]===N.OP_EQUALVERIFY&&e[24]===N.OP_CHECKSIG}function c(t){var e=o(t);return 1===e.length&&f(e[0])}function l(t){var e=o(t);return 2===e.length&&s(e[0])&&e[1]===N.OP_CHECKSIG}function p(t,e){var r=o(t);if(r.length<2)return!1;var n=r[r.length-1];if(!Buffer.isBuffer(n))return!1;var i=r.slice(0,-1),s=o(n);return 0===s.length?!1:_(i,e)===w(s)}function d(t){var e=i(t);return 23===e.length&&e[0]===N.OP_HASH160&&20===e[1]&&e[22]===N.OP_EQUAL}function g(t){var e=i(t);return 22===e.length&&e[0]===N.OP_0&&20===e[1]}function v(t){var e=i(t);return 34===e.length&&e[0]===N.OP_0&&32===e[1]}function y(t,e){var r=o(t);return r.length<2?!1:r[0]!==N.OP_0?!1:r.slice(1).every(e?function(t){return t===N.OP_0||f(t)}:f)}function m(t){var e=o(t);if(e.length<4)return!1;if(e[e.length-1]!==N.OP_CHECKMULTISIG)return!1;var r=e[0],n=e[e.length-2];if(!j.Number(r))return!1;if(!j.Number(n))return!1;var i=r-H,f=n-H;return 0>=i?!1:i>f?!1:f>16?!1:f!==e.length-3?!1:e.slice(1,-2).every(s)}function b(t){var e=o(t);return e[0]===N.OP_RETURN}function w(t){var e=o(t);return g(e)?"witnesspubkeyhash":v(e)?"witnessscripthash":h(e)?"pubkeyhash":d(e)?"scripthash":m(e)?"multisig":l(e)?"pubkey":b(e)?"nulldata":"nonstandard"}function _(t,e){var r=o(t);return a(r)?"pubkeyhash":y(r,e)?"multisig":p(r,e)?"scripthash":c(r)?"pubkey":"nonstandard"}function E(t){return i([t,N.OP_CHECKSIG])}function S(t){return M(j.Hash160bit,t),i([N.OP_DUP,N.OP_HASH160,t,N.OP_EQUALVERIFY,N.OP_CHECKSIG])}function T(t){return M(j.Hash160bit,t),i([N.OP_HASH160,t,N.OP_EQUAL])}function O(t,e){M(j.tuple(j.Number,[j.Buffer]),arguments);var r=e.length;if(t>r)throw new Error("Not enough pubKeys provided");return i([].concat(H+t,e,H+r,N.OP_CHECKMULTISIG))}function B(t){return M(j.Hash160bit,t),i([N.OP_0,t])}function P(t){return M(j.Hash256bit,t),i([N.OP_0,t])}function I(t){return M(j.Buffer,t),i([t])}function x(t,e){return M(j.tuple(j.Buffer,j.Buffer),arguments),i([t,e])}function A(t,e){var r=o(t),n=i(e);return i([].concat(r,n))}function R(t,e){return A(t,e)}function k(t,e){if(e){var r=o(e);if(!m(r))throw new Error("Expected multisig scriptPubKey");var n=r[0],s=r[r.length-2],f=n-H,u=s-H;if(t.length<f)throw new Error("Not enough signatures provided");if(t.length>u)throw new Error("Too many signatures provided")}return i([].concat(N.OP_0,t))}function L(t){return i([N.OP_RETURN,t])}var D=t("bip66"),U=t("./bufferutils"),M=t("typeforce"),j=t("./types"),N=t("./opcodes.json"),C=function(){var t={};for(var e in N){var r=N[e];t[r]=e}return t}(),H=N.OP_RESERVED;e.exports={compile:i,decompile:o,fromASM:n,toASM:r,number:t("./script_number"),isCanonicalPubKey:s,isCanonicalSignature:f,isDefinedHashType:u,isPubKeyHashInput:a,isPubKeyHashOutput:h,isPubKeyInput:c,isPubKeyOutput:l,isScriptHashInput:p,isScriptHashOutput:d,isWitnessPubKeyHashOutput:g,isWitnessScriptHashOutput:v,isMultisigInput:y,isMultisigOutput:m,isNullDataOutput:b,classifyOutput:w,classifyInput:_,pubKeyOutput:E,pubKeyHashOutput:S,scriptHashOutput:T,witnessPubKeyHashOutput:B,witnessScriptHashInput:R,witnessScriptHashOutput:P,multisigOutput:O,pubKeyInput:I,pubKeyHashInput:x,scriptHashInput:A,multisigInput:k,nullDataOutput:L}}).call(this,t("buffer").Buffer)},{"./bufferutils":69,"./opcodes.json":78,"./script_number":80,"./types":83,bip66:36,buffer:3,typeforce:65}],80:[function(t,e){(function(Buffer){function t(t,e,r){e=e||4,r=void 0===r?!0:r;var n=t.length;if(0===n)return 0;if(n>e)throw new TypeError("Script number overflow");if(r&&0===(127&t[n-1])&&(1>=n||0===(128&t[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){var i=t.readUInt32LE(0),o=t.readUInt8(4);return 128&o?-(4294967296*(-129&o)+i):4294967296*o+i}for(var s=0,f=0;n>f;++f)s|=t[f]<<8*f;return 128&t[n-1]?-(s&~(128<<8*(n-1))):s}function r(t){return t>2147483647?5:t>8388607?4:t>32767?3:t>127?2:t>0?1:0}function n(t){for(var e=Math.abs(t),n=r(e),i=new Buffer(n),o=0>t,s=0;n>s;++s)i.writeUInt8(255&e,s),e>>=8;return 128&i[n-1]?i.writeUInt8(o?128:0,n-1):o&&(i[n-1]|=128),i}e.exports={decode:t,encode:n}}).call(this,t("buffer").Buffer)},{buffer:3}],81:[function(t,e){(function(Buffer){function r(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}var n=t("./crypto"),i=t("./script"),o=t("./bufferutils"),s=t("buffer-reverse"),f=t("./opcodes.json"),u=t("typeforce"),a=t("./types");r.DEFAULT_SEQUENCE=4294967295,r.SIGHASH_ALL=1,r.SIGHASH_NONE=2,r.SIGHASH_SINGLE=3,r.SIGHASH_ANYONECANPAY=128,r.fromBuffer=function(t,e){function n(e){return a+=e,t.slice(a-e,a)}function i(){var e=t.readUInt32LE(a);return a+=4,e}function s(){var e=o.readUInt64LE(t,a);return a+=8,e}function f(){var e=o.readVarInt(t,a);return a+=e.size,e.number}function u(){return n(f())}var a=0,h=new r;h.version=i();for(var c=f(),l=0;c>l;++l)h.ins.push({hash:n(32),index:i(),script:u(),sequence:i()});var p=f();for(l=0;p>l;++l)h.outs.push({value:s(),script:u()});if(h.locktime=i(),e)return h;if(a!==t.length)throw new Error("Transaction has unexpected data");return h},r.fromHex=function(t){return r.fromBuffer(new Buffer(t,"hex"))},r.isCoinbaseHash=function(t){u(a.Hash256bit,t);for(var e=0;32>e;++e)if(0!==t[e])return!1;return!0},r.prototype.isCoinbase=function(){return 1===this.ins.length&&r.isCoinbaseHash(this.ins[0].hash)};var h=new Buffer(0);r.prototype.addInput=function(t,e,n,i){return u(a.tuple(a.Hash256bit,a.UInt32,a.maybe(a.UInt32),a.maybe(a.Buffer)),arguments),a.Null(n)&&(n=r.DEFAULT_SEQUENCE),this.ins.push({hash:t,index:e,script:i||h,sequence:n})-1},r.prototype.addOutput=function(t,e){return u(a.tuple(a.Buffer,a.UInt53),arguments),this.outs.push({script:t,value:e})-1},r.prototype.byteLength=function(){function t(t){var e=t.length;return o.varIntSize(e)+e}return 8+o.varIntSize(this.ins.length)+o.varIntSize(this.outs.length)+this.ins.reduce(function(e,r){return e+40+t(r.script)},0)+this.outs.reduce(function(e,r){return e+8+t(r.script)},0)},r.prototype.clone=function(){var t=new r;return t.version=this.version,t.locktime=this.locktime,t.ins=this.ins.map(function(t){return{hash:t.hash,index:t.index,script:t.script,sequence:t.sequence}}),t.outs=this.outs.map(function(t){return{script:t.script,value:t.value}}),t};var c=new Buffer("0000000000000000000000000000000000000000000000000000000000000001","hex"),l=new Buffer("ffffffffffffffff","hex"),p={script:h,valueBuffer:l};r.prototype.hashForSignature=function(t,e,o){if(u(a.tuple(a.UInt32,a.Buffer,a.Number),arguments),t>=this.ins.length)return c;var s=i.compile(i.decompile(e).filter(function(t){return t!==f.OP_CODESEPARATOR})),l=this.clone();if((31&o)===r.SIGHASH_NONE)l.outs=[],l.ins.forEach(function(e,r){r!==t&&(e.sequence=0)});else if((31&o)===r.SIGHASH_SINGLE){if(t>=this.outs.length)return c;l.outs.length=t+1;for(var d=0;t>d;d++)l.outs[d]=p;l.ins.forEach(function(e,r){r!==t&&(e.sequence=0)})}o&r.SIGHASH_ANYONECANPAY?(l.ins=[l.ins[t]],l.ins[0].script=s):(l.ins.forEach(function(t){t.script=h}),l.ins[t].script=s);var g=new Buffer(l.byteLength()+4);return g.writeInt32LE(o,g.length-4),l.toBuffer(g,0),n.hash256(g)},r.prototype.getHash=function(){return n.hash256(this.toBuffer())},r.prototype.getId=function(){return s(this.getHash()).toString("hex")},r.prototype.toBuffer=function(t,e){function r(e){e.copy(t,f),f+=e.length}function n(e){t.writeUInt32LE(e,f),f+=4}function i(e){o.writeUInt64LE(t,e,f),f+=8}function s(e){var r=o.writeVarInt(t,e,f);f+=r}t||(t=new Buffer(this.byteLength()));var f=e||0;return n(this.version),s(this.ins.length),this.ins.forEach(function(t){r(t.hash),n(t.index),s(t.script.length),r(t.script),n(t.sequence)}),s(this.outs.length),this.outs.forEach(function(t){t.valueBuffer?r(t.valueBuffer):i(t.value),s(t.script.length),r(t.script)}),n(this.locktime),void 0!==e?t.slice(e,f):t},r.prototype.toHex=function(){return this.toBuffer().toString("hex")},r.prototype.setInputScript=function(t,e){u(a.tuple(a.Number,a.Buffer),arguments),this.ins[t].script=e},e.exports=r}).call(this,t("buffer").Buffer)},{"./bufferutils":69,"./crypto":70,"./opcodes.json":78,"./script":79,"./types":83,buffer:3,"buffer-reverse":41,typeforce:65}],82:[function(t,e){(function(Buffer){function r(t,e,r,n,i,o,s){var f=n.slice(),u={};return r.map(function(r){if(s&&h(s,r))return void 0;var n,a=ECPair.fromPublicKeyBuffer(r);return f.some(function(r,s){if(!r)return!1;var h=u[o]=u[o]||t.hashForSignature(e,i,o);return a.verify(h,r)?(f[s]=void 0,n=r,!0):!1}),n||void 0})}function n(t,e,n){function i(e,o,s){o=a.decompile(o),s=s?a.decompile(s):void 0;var f,h,c,l,d,g,y,m;switch(e){case"scripthash":return d=o.slice(-1)[0],o=a.compile(o.slice(0,-1)),g=a.classifyInput(o,!0),l=a.scriptHashOutput(u.hash160(d)),y=i(g,o,a.decompile(d)),y.prevOutScript=l,y.redeemScript=d,y.redeemScriptType=g,y;case"pubkeyhash":m=v.parseScriptSignature(o[0]),f=m.hashType,h=o.slice(1),c=[m.signature],l=a.pubKeyHashOutput(u.hash160(h[0]));break;case"pubkey":m=v.parseScriptSignature(o[0]),f=m.hashType,c=[m.signature],s&&(h=s.slice(0,1));break;case"multisig":c=o.slice(1).map(function(t){return t===p.OP_0?void 0:(m=v.parseScriptSignature(t),f=m.hashType,m.signature)}),s&&(h=s.slice(1,-2),h.length!==c.length&&(c=r(t,n,h,c,a.compile(s),f,d)))}return{hashType:f,pubKeys:h,signatures:c,prevOutScript:l,redeemScript:d,redeemScriptType:g}}if(0===e.script.length)return{};var o=a.decompile(e.script),s=a.classifyInput(o,!0),f=i(s,o);return{hashType:f.hashType,prevOutScript:f.prevOutScript,prevOutType:s,pubKeys:f.pubKeys,redeemScript:f.redeemScript,redeemScriptType:f.redeemScriptType,signatures:f.signatures}}function i(t){this.prevTxMap={},this.prevOutScripts={},this.prevOutTypes={},this.network=t||l.bitcoin,this.inputs=[],this.tx=new y}function o(t,e,r,n,i){var o;switch(e){case"pubkeyhash":var s=t.signatures[0].toScriptSignature(t.hashType);o=a.pubKeyHashInput(s,t.pubKeys[0]);break;case"pubkey":var f=t.signatures[0].toScriptSignature(t.hashType);o=a.pubKeyInput(f);break;case"multisig":var u=t.signatures.map(function(e){return e&&e.toScriptSignature(t.hashType)});if(i)for(var h=0;h<u.length;++h)u[h]=u[h]||p.OP_0;else u=u.filter(function(t){
return t});o=a.multisigInput(u,i?void 0:n)}return"scripthash"===r&&(o=a.scriptHashInput(o,n)),o}function s(t,e,r){var n=a.classifyOutput(t),i=a.decompile(t);switch(n){case"pubkeyhash":var o=i[2],s=u.hash160(e.getPublicKeyBuffer());if(!h(o,s))throw new Error("privateKey cannot sign for this input");return{pubKeys:[r],scriptType:n};case"pubkey":return{pubKeys:i.slice(0,1),scriptType:n};case"multisig":return{pubKeys:i.slice(1,-2),scriptType:n}}}var f=t("./address"),u=t("./crypto"),a=t("./script"),h=t("buffer-equals"),c=t("buffer-reverse"),l=t("./networks"),p=t("./opcodes.json"),d=t("typeforce"),g=t("./types"),ECPair=t("./ecpair"),v=t("./ecsignature"),y=t("./transaction");i.prototype.setLockTime=function(t){if(d(g.UInt32,t),this.inputs.some(function(t){return t.signatures?t.signatures.some(function(t){return t}):!1}))throw new Error("No, this would invalidate signatures");this.tx.locktime=t},i.prototype.setVersion=function(t){d(g.UInt32,t),this.tx.version=t},i.fromTransaction=function(t,e){var r=new i(e);return r.tx.version=t.version,r.tx.locktime=t.locktime,t.ins.forEach(function(t){r.addInput(t.hash,t.index,t.sequence)}),t.outs.forEach(function(t){r.addOutput(t.script,t.value)}),r.inputs=t.ins.map(function(e,r){if(y.isCoinbaseHash(e.hash))throw new Error("coinbase inputs not supported");return n(t,e,r)}),r},i.prototype.addInput=function(t,e,r,n){"string"==typeof t?t=c(new Buffer(t,"hex")):t instanceof y&&(n=t.outs[e].script,t=t.getHash());var i={};if(n){var o=a.decompile(n),s=a.classifyOutput(o);switch(s){case"multisig":i.pubKeys=o.slice(1,-2),i.signatures=i.pubKeys.map(function(){return void 0});break;case"pubkey":i.pubKeys=o.slice(0,1),i.signatures=[void 0]}"scripthash"!==s&&(i.scriptType=s),i.prevOutScript=n,i.prevOutType=s}if(!this.inputs.every(function(t){return void 0===t.hashType?!0:t.hashType&y.SIGHASH_ANYONECANPAY}))throw new Error("No, this would invalidate signatures");var f=t.toString("hex")+":"+e;if(this.prevTxMap[f])throw new Error("Transaction is already an input");var u=this.tx.addInput(t,e,r);return this.inputs[u]=i,this.prevTxMap[f]=u,u},i.prototype.addOutput=function(t,e){var r=this.tx.outs.length;if(!this.inputs.every(function(t,e){if(void 0===t.hashType)return!0;var n=31&t.hashType;return n===y.SIGHASH_NONE?!0:n===y.SIGHASH_SINGLE?r>e:!1}))throw new Error("No, this would invalidate signatures");return"string"==typeof t&&(t=f.toOutputScript(t,this.network)),this.tx.addOutput(t,e)},i.prototype.build=function(){return this.__build(!1)},i.prototype.buildIncomplete=function(){return this.__build(!0)};var m={multisig:!0,pubkey:!0,pubkeyhash:!0};i.prototype.__build=function(t){if(!t){if(!this.tx.ins.length)throw new Error("Transaction has no inputs");if(!this.tx.outs.length)throw new Error("Transaction has no outputs")}var e=this.tx.clone();return this.inputs.forEach(function(r,n){var i,s=r.redeemScriptType||r.prevOutType;if(!t){if(!s)throw new Error("Transaction is not complete");if(!m[s])throw new Error(s+" not supported");if(!r.signatures)throw new Error("Transaction is missing signatures")}r.signatures&&(i=o(r,s,r.prevOutType,r.redeemScript,t)),i&&e.setInputScript(n,i)}),e},i.prototype.sign=function(t,e,r,n){if(e.network!==this.network)throw new Error("Inconsistent network");if(!this.inputs[t])throw new Error("No input at index: "+t);n=n||y.SIGHASH_ALL;var i,o=this.inputs[t],f=o.hashType&&o.prevOutScript&&o.prevOutType&&o.pubKeys&&o.redeemScriptType&&o.signatures&&o.signatures.length===o.pubKeys.length,c=e.getPublicKeyBuffer();if(f){if(r&&!h(o.redeemScript,r))throw new Error("Inconsistent redeemScript");if(o.hashType!==n)throw new Error("Inconsistent hashType")}else{if(r){if(o.prevOutScript){if("scripthash"!==o.prevOutType)throw new Error("PrevOutScript must be P2SH");var l=a.decompile(o.prevOutScript)[1];if(!h(l,u.hash160(r)))throw new Error("RedeemScript does not match "+l.toString("hex"))}var p=s(r,e,c);if(!p)throw new Error('RedeemScript not supported "'+a.toASM(r)+'"');o.prevOutScript||(o.prevOutScript=a.scriptHashOutput(u.hash160(r)),o.prevOutType="scripthash"),o.pubKeys=p.pubKeys,o.redeemScript=r,o.redeemScriptType=p.scriptType,o.signatures=p.pubKeys.map(function(){return void 0})}else{if("scripthash"===o.prevOutType)throw new Error("PrevOutScript is P2SH, missing redeemScript");if(o.scriptType){if(!o.pubKeys||!o.signatures)throw new Error(o.scriptType+" not supported")}else o.prevOutScript=a.pubKeyHashOutput(u.hash160(e.getPublicKeyBuffer())),o.prevOutType="pubkeyhash",o.pubKeys=[c],o.scriptType=o.prevOutType,o.signatures=[void 0]}o.hashType=n}i=i||o.redeemScript||o.prevOutScript;var d=this.tx.hashForSignature(t,i,n),g=o.pubKeys.some(function(t,r){if(!h(c,t))return!1;if(o.signatures[r])throw new Error("Signature already exists");return o.signatures[r]=e.sign(d),!0});if(!g)throw new Error("Key pair cannot sign for this input")},e.exports=i}).call(this,t("buffer").Buffer)},{"./address":67,"./crypto":70,"./ecpair":72,"./ecsignature":73,"./networks":77,"./opcodes.json":78,"./script":79,"./transaction":81,"./types":83,buffer:3,"buffer-equals":40,"buffer-reverse":41,typeforce:65}],83:[function(t,e){function r(t,e){if(l(b.Buffer,t),t.length!==e)throw new l.TfTypeError("Expected "+8*e+"-bit Buffer, got "+8*t.length+"-bit Buffer");return!0}function n(t){return r(t,20)}function i(t){return r(t,32)}function o(t){return r(t,32)}function s(t){return(3&t)===t}function f(t){return(255&t)===t}function u(t){return t>>>0===t}function a(t){return u(t)&&d>=t}function h(t){return l.Number(t)&&t>=0&&p>=t&&Math.floor(t)===t}function c(t){return l.String(t)&&t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}var l=t("typeforce"),p=Math.pow(2,53)-1,d=Math.pow(2,31)-1,g=l.quacksLike("BigInteger"),v=l.quacksLike("Point"),y=l.compile({r:g,s:g}),m=l.compile({messagePrefix:l.oneOf(l.Buffer,l.String),bip32:{"public":u,"private":u},pubKeyHash:f,scriptHash:f,wif:f,dustThreshold:h}),b={BigInt:g,Buffer256bit:o,ECPoint:v,ECSignature:y,Hash160bit:n,Hash256bit:i,Network:m,UInt2:s,UInt8:f,UInt31:a,UInt32:u,UInt53:h,Bip32Path:c};for(var w in l)b[w]=l[w];e.exports=b},{typeforce:65}]},{},[75])(75)});
|