!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.webpackAntcloud=t():e.webpackAntcloud=t()}(this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=127)}([function(e,t,r){var n=r(2),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=r(130),i=r(131),o=r(64);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(n)return D(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-c),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(f=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(f=c)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),f=e.slice(t,r),l=0;li)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function M(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function N(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function O(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return o||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,o){return o||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||C(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);C(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);C(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):M(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):M(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(7))},function(e,t,r){var n;e.exports=(n=n||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=4*o,c=i/s,u=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*o,f=e.min(4*u,i);if(u){for(var l=0;l=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&c,h=Math.min(u,t.length-1),d=Math.max(0,u-e.length+1);d<=h;d++){var p=u-d|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}r.words[u]=0|l,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var h=f[e],d=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?b+r:u[h-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,b=d>>>13,m=0|a[2],g=8191&m,y=m>>>13,_=0|a[3],v=8191&_,w=_>>>13,E=0|a[4],S=8191&E,T=E>>>13,A=0|a[5],I=8191&A,k=A>>>13,R=0|a[6],x=8191&R,B=R>>>13,P=0|a[7],C=8191&P,M=P>>>13,N=0|a[8],O=8191&N,L=N>>>13,U=0|a[9],q=8191&U,j=U>>>13,D=0|s[0],z=8191&D,Y=D>>>13,K=0|s[1],F=8191&K,G=K>>>13,H=0|s[2],Q=8191&H,V=H>>>13,X=0|s[3],W=8191&X,Z=X>>>13,$=0|s[4],J=8191&$,ee=$>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],le=8191&fe,he=fe>>>13,de=0|s[9],pe=8191&de,be=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(u+(n=Math.imul(l,z))|0)+((8191&(i=(i=Math.imul(l,Y))+Math.imul(h,z)|0))<<13)|0;u=((o=Math.imul(h,Y))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,Y))+Math.imul(b,z)|0,o=Math.imul(b,Y);var ge=(u+(n=n+Math.imul(l,F)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(h,F)|0))<<13)|0;u=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,z),i=(i=Math.imul(g,Y))+Math.imul(y,z)|0,o=Math.imul(y,Y),n=n+Math.imul(p,F)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,F)|0,o=o+Math.imul(b,G)|0;var ye=(u+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(h,Q)|0))<<13)|0;u=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(v,z),i=(i=Math.imul(v,Y))+Math.imul(w,z)|0,o=Math.imul(w,Y),n=n+Math.imul(g,F)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,F)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,V)|0;var _e=(u+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(h,W)|0))<<13)|0;u=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(S,z),i=(i=Math.imul(S,Y))+Math.imul(T,z)|0,o=Math.imul(T,Y),n=n+Math.imul(v,F)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(w,F)|0,o=o+Math.imul(w,G)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,V)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,Z)|0;var ve=(u+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(h,J)|0))<<13)|0;u=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(I,z),i=(i=Math.imul(I,Y))+Math.imul(k,z)|0,o=Math.imul(k,Y),n=n+Math.imul(S,F)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(T,F)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,V)|0,n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,Z)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Z)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,ee)|0;var we=(u+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(h,re)|0))<<13)|0;u=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,z),i=(i=Math.imul(x,Y))+Math.imul(B,z)|0,o=Math.imul(B,Y),n=n+Math.imul(I,F)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(k,F)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,V)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Z)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Ee=(u+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;u=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(C,z),i=(i=Math.imul(C,Y))+Math.imul(M,z)|0,o=Math.imul(M,Y),n=n+Math.imul(x,F)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(B,F)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,Z)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Se=(u+(n=n+Math.imul(l,ce)|0)|0)+((8191&(i=(i=i+Math.imul(l,ue)|0)+Math.imul(h,ce)|0))<<13)|0;u=((o=o+Math.imul(h,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(O,z),i=(i=Math.imul(O,Y))+Math.imul(L,z)|0,o=Math.imul(L,Y),n=n+Math.imul(C,F)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(M,F)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,V)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Z)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0;var Te=(u+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;u=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(q,z),i=(i=Math.imul(q,Y))+Math.imul(j,z)|0,o=Math.imul(j,Y),n=n+Math.imul(O,F)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(L,F)|0,o=o+Math.imul(L,G)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,Z)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(g,ce)|0,i=(i=i+Math.imul(g,ue)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,ue)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,le)|0,o=o+Math.imul(b,he)|0;var Ae=(u+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,be)|0)+Math.imul(h,pe)|0))<<13)|0;u=((o=o+Math.imul(h,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(q,F),i=(i=Math.imul(q,G))+Math.imul(j,F)|0,o=Math.imul(j,G),n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,Z)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(v,ce)|0,i=(i=i+Math.imul(v,ue)|0)+Math.imul(w,ce)|0,o=o+Math.imul(w,ue)|0,n=n+Math.imul(g,le)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,he)|0;var Ie=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(q,Q),i=(i=Math.imul(q,V))+Math.imul(j,Q)|0,o=Math.imul(j,V),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,Z)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,Z)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(v,le)|0,i=(i=i+Math.imul(v,he)|0)+Math.imul(w,le)|0,o=o+Math.imul(w,he)|0;var ke=(u+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(y,pe)|0))<<13)|0;u=((o=o+Math.imul(y,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(q,W),i=(i=Math.imul(q,Z))+Math.imul(j,W)|0,o=Math.imul(j,Z),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(I,ce)|0,i=(i=i+Math.imul(I,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(S,le)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(T,le)|0,o=o+Math.imul(T,he)|0;var Re=(u+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,be)|0)+Math.imul(w,pe)|0))<<13)|0;u=((o=o+Math.imul(w,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(q,J),i=(i=Math.imul(q,ee))+Math.imul(j,J)|0,o=Math.imul(j,ee),n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(B,ce)|0,o=o+Math.imul(B,ue)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,he)|0;var xe=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(q,re),i=(i=Math.imul(q,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(M,ce)|0,o=o+Math.imul(M,ue)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,he)|0;var Be=(u+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,be)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(q,oe),i=(i=Math.imul(q,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),n=n+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(M,le)|0,o=o+Math.imul(M,he)|0;var Pe=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,be)|0)+Math.imul(B,pe)|0))<<13)|0;u=((o=o+Math.imul(B,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(q,ce),i=(i=Math.imul(q,ue))+Math.imul(j,ce)|0,o=Math.imul(j,ue),n=n+Math.imul(O,le)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(L,le)|0,o=o+Math.imul(L,he)|0;var Ce=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,be)|0)+Math.imul(M,pe)|0))<<13)|0;u=((o=o+Math.imul(M,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(q,le),i=(i=Math.imul(q,he))+Math.imul(j,le)|0,o=Math.imul(j,he);var Me=(u+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Ne=(u+(n=Math.imul(q,pe))|0)+((8191&(i=(i=Math.imul(q,be))+Math.imul(j,pe)|0))<<13)|0;return u=((o=Math.imul(j,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=me,c[1]=ge,c[2]=ye,c[3]=_e,c[4]=ve,c[5]=we,c[6]=Ee,c[7]=Se,c[8]=Te,c[9]=Ae,c[10]=Ie,c[11]=ke,c[12]=Re,c[13]=xe,c[14]=Be,c[15]=Pe,c[16]=Ce,c[17]=Me,c[18]=Ne,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(d=h),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==t){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(l)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(c)):(r.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(y,g),y.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new _;else if("p192"===e)t=new v;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return m[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var l=this.pow(f,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var b=d,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var l=u>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}c=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new S(e)},i(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(65)(e))},function(e,t,r){var n;e.exports=(n=r(3),void(n.lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,o=r.WordArray,a=r.BufferedBlockAlgorithm,s=t.enc,c=(s.Utf8,s.Base64),u=t.algo,f=u.EvpKDF,l=r.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){e&&this._append(e);var t=this._doFinalize();return t},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?S:v}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()}),h=(r.StreamCipher=l.extend({_doFinalize:function(){var e=this._process(!0);return e},blockSize:1}),t.mode={}),d=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=h.CBC=function(){var t=d.extend();function r(t,r,n){var i=this._iv;if(i){var o=i;this._iv=e}else var o=this._prevBlock;for(var a=0;a>>2];e.sigBytes-=t}},g=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:p,padding:m}),reset:function(){l.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode=n.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=t.format={},_=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=o.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(c)},parse:function(e){var t=c.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=o.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return g.create({ciphertext:t,salt:n})}},v=r.SerializableCipher=i.extend({cfg:i.extend({format:_}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return g.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),w=t.kdf={},E=w.OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=f.create({keySize:t+r}).compute(e,n),a=o.create(i.words.slice(t),4*r);return i.sigBytes=4*t,g.create({key:i,iv:a,salt:n})}},S=r.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:E}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=v.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var o=v.decrypt.call(this,e,t,i.key,n);return o}})}()))},function(e,t,r){"use strict";var n=t;n.version=r(178).version,n.utils=r(179),n.rand=r(80),n.curve=r(40),n.curves=r(185),n.ec=r(193),n.eddsa=r(197)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=r(1),i=r(38),o=r(51),a=r(52),s=r(15);function c(e){s.call(this,"digest"),this._hash=e}n(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new c(a(e))}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,u=[],f=!1,l=-1;function h(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length&&d())}function d(){if(!f){var e=s(h);f=!0;for(var t=u.length;t;){for(c=u,u=[];++l1)for(var r=1;r=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,u){var f=0,l=t;return f+=(l=l+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){var n=r(11),i=r(118),o=function(e){this._inputFormatter=e.inputFormatter,this._outputFormatter=e.outputFormatter};o.prototype.isType=function(e){throw"this method should be overrwritten for type "+e},o.prototype.staticPartLength=function(e){return(this.nestedTypes(e)||["[1]"]).map(function(e){return parseInt(e.slice(1,-1),10)||1}).reduce(function(e,t){return e*t},32)},o.prototype.isDynamicArray=function(e){var t=this.nestedTypes(e);return!!t&&!t[t.length-1].match(/[0-9]{1,}/g)},o.prototype.isStaticArray=function(e){var t=this.nestedTypes(e);return!!t&&!!t[t.length-1].match(/[0-9]{1,}/g)},o.prototype.staticArrayLength=function(e){var t=this.nestedTypes(e);return t?parseInt(t[t.length-1].match(/[0-9]{1,}/g)||1):1},o.prototype.nestedName=function(e){var t=this.nestedTypes(e);return t?e.substr(0,e.length-t[t.length-1].length):e},o.prototype.isDynamicType=function(){return!1},o.prototype.nestedTypes=function(e){return e.match(/(\[[0-9]*\])/g)},o.prototype.encode=function(e,t){var r,i,o,a=this;return this.isDynamicArray(t)?(r=e.length,i=a.nestedName(t),(o=[]).push(n.formatInputInt(r).encode()),e.forEach(function(e){o.push(a.encode(e,i))}),o):this.isStaticArray(t)?function(){for(var r=a.staticArrayLength(t),n=a.nestedName(t),i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var i=0;i>>6-a%4*2;n[i>>>2]|=(s|c)<<24-i%4*8,i++}return o.create(n,i)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)},function(e,t,r){var n;e.exports=(n=r(3),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],d=e[t+2],p=e[t+3],b=e[t+4],m=e[t+5],g=e[t+6],y=e[t+7],_=e[t+8],v=e[t+9],w=e[t+10],E=e[t+11],S=e[t+12],T=e[t+13],A=e[t+14],I=e[t+15],k=o[0],R=o[1],x=o[2],B=o[3];k=u(k,R,x,B,a,7,s[0]),B=u(B,k,R,x,c,12,s[1]),x=u(x,B,k,R,d,17,s[2]),R=u(R,x,B,k,p,22,s[3]),k=u(k,R,x,B,b,7,s[4]),B=u(B,k,R,x,m,12,s[5]),x=u(x,B,k,R,g,17,s[6]),R=u(R,x,B,k,y,22,s[7]),k=u(k,R,x,B,_,7,s[8]),B=u(B,k,R,x,v,12,s[9]),x=u(x,B,k,R,w,17,s[10]),R=u(R,x,B,k,E,22,s[11]),k=u(k,R,x,B,S,7,s[12]),B=u(B,k,R,x,T,12,s[13]),x=u(x,B,k,R,A,17,s[14]),k=f(k,R=u(R,x,B,k,I,22,s[15]),x,B,c,5,s[16]),B=f(B,k,R,x,g,9,s[17]),x=f(x,B,k,R,E,14,s[18]),R=f(R,x,B,k,a,20,s[19]),k=f(k,R,x,B,m,5,s[20]),B=f(B,k,R,x,w,9,s[21]),x=f(x,B,k,R,I,14,s[22]),R=f(R,x,B,k,b,20,s[23]),k=f(k,R,x,B,v,5,s[24]),B=f(B,k,R,x,A,9,s[25]),x=f(x,B,k,R,p,14,s[26]),R=f(R,x,B,k,_,20,s[27]),k=f(k,R,x,B,T,5,s[28]),B=f(B,k,R,x,d,9,s[29]),x=f(x,B,k,R,y,14,s[30]),k=l(k,R=f(R,x,B,k,S,20,s[31]),x,B,m,4,s[32]),B=l(B,k,R,x,_,11,s[33]),x=l(x,B,k,R,E,16,s[34]),R=l(R,x,B,k,A,23,s[35]),k=l(k,R,x,B,c,4,s[36]),B=l(B,k,R,x,b,11,s[37]),x=l(x,B,k,R,y,16,s[38]),R=l(R,x,B,k,w,23,s[39]),k=l(k,R,x,B,T,4,s[40]),B=l(B,k,R,x,a,11,s[41]),x=l(x,B,k,R,p,16,s[42]),R=l(R,x,B,k,g,23,s[43]),k=l(k,R,x,B,v,4,s[44]),B=l(B,k,R,x,S,11,s[45]),x=l(x,B,k,R,I,16,s[46]),k=h(k,R=l(R,x,B,k,d,23,s[47]),x,B,a,6,s[48]),B=h(B,k,R,x,y,10,s[49]),x=h(x,B,k,R,A,15,s[50]),R=h(R,x,B,k,m,21,s[51]),k=h(k,R,x,B,S,6,s[52]),B=h(B,k,R,x,p,10,s[53]),x=h(x,B,k,R,w,15,s[54]),R=h(R,x,B,k,c,21,s[55]),k=h(k,R,x,B,_,6,s[56]),B=h(B,k,R,x,I,10,s[57]),x=h(x,B,k,R,g,15,s[58]),R=h(R,x,B,k,T,21,s[59]),k=h(k,R,x,B,b,6,s[60]),B=h(B,k,R,x,E,10,s[61]),x=h(x,B,k,R,d,15,s[62]),R=h(R,x,B,k,v,21,s[63]),o[0]=o[0]+k|0,o[1]=o[1]+R|0,o[2]=o[2]+x|0,o[3]=o[3]+B|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function f(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function l(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function h(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(c),t.HmacMD5=o._createHmacHelper(c)}(Math),n.MD5)},function(e,t,r){var n,i,o,a,s,c,u,f;e.exports=(n=r(3),r(45),r(46),o=(i=n).lib,a=o.Base,s=o.WordArray,c=i.algo,u=c.MD5,f=c.EvpKDF=a.extend({cfg:a.extend({keySize:4,hasher:u,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),i=s.create(),o=i.words,a=r.keySize,c=r.iterations;o.length=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";const n=t;n.bignum=r(4),n.define=r(202).define,n.base=r(28),n.constants=r(86),n.decoders=r(207),n.encoders=r(209)},function(e,t,r){var n=r(215),i=r(223),o=r(92);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){"use strict";(function(t,n){var i=65536,o=4294967295;var a=r(0).Buffer,s=t.crypto||t.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>i)for(var c=0;c("hex"===t&&(e.length>2&&"0x"===e.substr(0,2)&&(e=e.substr(2)),e=o.enc.Hex.parse(e)),a(e,{outputLength:256}).toString()),getHash(e,t){let r="0x";t&&(r="");let n=e.toString("hex");if(c.isString(e)){if("0x"!==e.substr(0,2))return r+o.SHA256(e).toString();n=e.substr(2)}const i=o.enc.Hex.parse(n);return r+o.SHA256(i).toString(o.enc.Hex)},isBuffer:e=>s.isBuffer(e),isBigNumber:e=>e&&(e instanceof i||e.constructor&&"BigNumber"===e.constructor.name),isString:e=>"string"==typeof e||e&&e.constructor&&"String"===e.constructor.name,isBoolean:e=>"boolean"==typeof e,isObject:e=>null!==e&&!Array.isArray(e)&&"object"==typeof e,isArray:e=>Array.isArray(e),isFunction:e=>"function"==typeof e,toBuffer(e,t){if(c.isBuffer(e))return e;"number"==typeof e&&(e=e.toString(16)),c.isString(e)&&0===e.indexOf("0x")&&(e=e.slice(2)),t||(t=Math.ceil(e.length/2));const r=s.alloc(t);for(let n=0;ne.lengthc.padStart(e,t,r),padEnd:(e,t,r)=>e.lengthc.padEnd(e,t,r),toBigNumber:(e,t)=>(e=e||0,c.isBigNumber(e)?e:c.isString(e)?0===e.indexOf("0x")||0===e.indexOf("-0x")?new i(e.replace("0x",""),16):new i(e,t||16):new i(e.toString(10),10)),toDecimal:(e,t)=>c.toBigNumber(e,t).toNumber(),decimalToHex(e,t){let r="0x";t&&(r="");const n=c.toBigNumber(e),i=n.toString(16);return n.lessThan(0)?"-"+r+i.substr(1):r+i},stringToHex:(e,t)=>c.decimalToHex(e,t),asciiToHex(e,t){let r="";for(let t=0;tc.utf8ToHex(e,t),toAscii(e,t){let r="",n=0;for("0x"===e.substring(0,2)&&(n=2);nn.decode(c.toAscii(e)),toHex:(e,t)=>c.isBoolean(e)?c.decimalToHex(+e,t):c.isBigNumber(e)?c.decimalToHex(e,t):"object"==typeof e?c.utf8ToHex(JSON.stringify(e),!1,t):c.isString(e)?0===e.indexOf("-0x")?c.stringToHex(e,t):0===e.indexOf("0x")?e:c.utf8ToHex(e,1,t):c.decimalToHex(e,t),toTwosComplement(e){const t=c.toBigNumber(e).round();return t.lessThan(0)?new i("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16).plus(t).plus(1):t},getUInt32BE(e){const t=new s(4);return t.writeUInt32BE(e),t.toString("hex")},hexToBuffer:e=>c.isString(e)?("0x"===e.substr(0,2)&&(e=e.substr(2)),s.from(e,"hex")):e,stringToBase64:e=>s.from(e).toString("base64")};e.exports=c},function(e,t,r){(t=e.exports=r(73)).Stream=t,t.Readable=t,t.Writable=r(49),t.Duplex=r(16),t.Transform=r(76),t.PassThrough=r(169)},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=r(13),i=r(10);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o0||o>0;){var f=new i;f.update(u),f.update(e),t&&f.update(t),u=f.digest();var l=0;if(a>0){var h=s.length-a;l=Math.min(a,u.length),u.copy(s,h,0,l),a-=l}if(l0){var d=c.length-o,p=Math.min(o,u.length-l);u.copy(c,d,l,l+p),o-=p}}return u.fill(0),{key:s,iv:c}}},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;oo)throw new Error("requested too many random bytes");var a=n.allocUnsafe(e);return e>0&&(i.getRandomValues?i.getRandomValues(a):s(a)),"function"==typeof r?t.nextTick(function(){r(null,a)}):a}),e.exports=i.randomBytes}).call(this,r(9))},function(e,t,r){var n=t;n.bignum=r(4),n.define=r(242).define,n.base=r(34),n.constants=r(104),n.decoders=r(246),n.encoders=r(248)},function(e,t,r){var n=t;n.Reporter=r(243).Reporter,n.DecoderBuffer=r(103).DecoderBuffer,n.EncoderBuffer=r(103).EncoderBuffer,n.Node=r(244)},function(e,t){e.exports={InvalidNumberOfSolidityArgs:function(){return new Error("Invalid number of arguments to Solidity function")},connection(e){const t=new Error("CONNECTION ERROR: Could not connect "+e+".");return t.type="connection",t},response(){const e=new Error("Response ERROR: Response is not JSON");return e.type="responseNotJSON",e},timeout:()=>new Error("CONNECTION TIMEOUT"),unauthorized:()=>new Error("CONNECTION UNAUTHORIZED"),api:e=>new Error("API ERROR: "+e+" is not API"),param:e=>new Error("PARAMETER ERROR: The value of "+e+" is error"),contractDeploy:e=>new Error("CONTRACT ERROR: The contract of "+e+" is not deploy"),returnCode(e){const t=new Error("ERROR: The return_code is "+e);return t.type="returnCode",t.code=e,t.returnCode=e,t},receiptResult(e,t,r){const n=new Error("ERROR: The Receipt result is "+e);return n.type="receiptResult",n.code=e,n.receiptCode=e,t&&(n.hash=t),r&&(n.output=r),n},codeResult(e,t){const r=new Error("ERROR: The return_code is "+e+". The Receipt result is "+t);return r.type="returnCode",r.code=e+" - "+t,r.returnCode=e,r.receiptCode=t,r}}},function(e,t){const r={name:"hash",type:"hash"},n=new Array(r);n.value=[],n.name="hashes",n.type="array";const i=[{name:"key",type:"bytes"},{name:"value",type:"bytes"}];i.name="configs",i.type="array";const o={name:"msg_type",type:"decimal"},a={name:"sequence",type:"decimal"},s={name:"group_id",type:"bytes"},c={name:"return_code",type:"decimal"},u=[o],f=[u,a,s],l=[u,a,c,s];e.exports={handshake:[[{name:"session_id"}]],hash:r,timestamp:{name:"timestamp",type:"decimal"},_from:{name:"from",type:"hash"},to:{name:"to",type:"hash"},gas_used:{name:"gas_used",type:"decimal"},identity:{name:"identity",type:"hash"},transaction_index:{name:"transaction_index",type:"decimal"},level:{name:"level",type:"decimal"},topic:{name:"topic",type:"string"},msg_type:o,sequence:a,group_id:s,version:{name:"version",type:"decimal"},return_code:c,encrypted_tx:{name:"encrypted_tx",type:"bytes"},Message:u,Request:f,Response:l,hashes:n,configs:i}},function(e,t,r){var n,i,o,a,s,c;e.exports=(n=r(3),o=(i=n).lib,a=o.Base,s=o.WordArray,(c=i.x64={}).Word=a.extend({init:function(e,t){this.high=e,this.low=t}}),c.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n>>32-t}function u(e,t,r,n,i,o,a){return c(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return c(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return c(e+(t^r^n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return c(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,e[0],3614090360,7),o=u(o,r,n,i,e[1],3905402710,12),i=u(i,o,r,n,e[2],606105819,17),n=u(n,i,o,r,e[3],3250441966,22),r=u(r,n,i,o,e[4],4118548399,7),o=u(o,r,n,i,e[5],1200080426,12),i=u(i,o,r,n,e[6],2821735955,17),n=u(n,i,o,r,e[7],4249261313,22),r=u(r,n,i,o,e[8],1770035416,7),o=u(o,r,n,i,e[9],2336552879,12),i=u(i,o,r,n,e[10],4294925233,17),n=u(n,i,o,r,e[11],2304563134,22),r=u(r,n,i,o,e[12],1804603682,7),o=u(o,r,n,i,e[13],4254626195,12),i=u(i,o,r,n,e[14],2792965006,17),r=f(r,n=u(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=l(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=h(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,r,n,i,e[7],1126891415,10),i=h(i,o,r,n,e[14],2878612391,15),n=h(n,i,o,r,e[5],4237533241,21),r=h(r,n,i,o,e[12],1700485571,6),o=h(o,r,n,i,e[3],2399980690,10),i=h(i,o,r,n,e[10],4293915773,15),n=h(n,i,o,r,e[1],2240044497,21),r=h(r,n,i,o,e[8],1873313359,6),o=h(o,r,n,i,e[15],4264355552,10),i=h(i,o,r,n,e[6],2734768916,15),n=h(n,i,o,r,e[13],1309151649,21),r=h(r,n,i,o,e[4],4149444226,6),o=h(o,r,n,i,e[11],3174756917,10),i=h(i,o,r,n,e[2],718787259,15),n=h(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){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(s-1),a=0;a>>24]^f[p>>>16&255]^l[b>>>8&255]^h[255&m]^t[g++],a=u[p>>>24]^f[b>>>16&255]^l[m>>>8&255]^h[255&d]^t[g++],s=u[b>>>24]^f[m>>>16&255]^l[d>>>8&255]^h[255&p]^t[g++],c=u[m>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&b]^t[g++],d=o,p=a,b=s,m=c;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[255&m])^t[g++],a=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[m>>>8&255]<<8|n[255&d])^t[g++],s=(n[b>>>24]<<24|n[m>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^t[g++],c=(n[m>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&b])^t[g++],[o>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[a]=u,n[u]=a;var f=e[a],l=e[f],h=e[l],d=257*e[u]^16843008*u;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][u]=d<<24|d>>>8,o[1][u]=d<<16|d>>>16,o[2][u]=d<<8|d>>>24,o[3][u]=d,0===a?a=s=1:(a=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(e){this._key=i(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),i[o]=i[o-t]^a}for(var u=[],f=0;f>>24]]^c.INV_SUB_MIX[1][c.SBOX[h>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[h>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},u.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=u},function(e,t,r){"use strict";var n=r(1),i=r(225),o=r(15),a=r(0).Buffer,s=r(95),c=r(51),u=r(52),f=a.alloc(128);function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.length>>31}var l=(n<<5|n>>>27)+s+u[c];l+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),i.SHA1=s._createHelper(f),i.HmacSHA1=s._createHmacHelper(f),n.SHA1)},function(e,t,r){var n,i,o,a,s,c,u;e.exports=(n=r(3),o=(i=n).lib,a=o.Base,s=i.enc,c=s.Utf8,u=i.algo,void(u.HMAC=a.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=c.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,s=o.words,u=0;u0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){for(var e=[],t=0;t0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var u=c.length,f=p(c,u);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){"use strict";(function(t,n,i){var o=r(39);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var u=r(26);u.inherits=r(1);var f={deprecate:r(168)},l=r(74),h=r(0).Buffer,d=i.Uint8Array||function(){};var p,b=r(75);function m(){}function g(e,t){s=s||r(16),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),T(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?c(v,e,r,a,i):v(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||r(16),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function _(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function v(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,c=!0;r;)i[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;i.allBuffers=c,_(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(_(e,t,!1,t.objectMode?1:u.length,u,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,l),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(166).setImmediate,r(7))},function(e,t,r){"use strict";var n=r(0).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(2).Buffer,i=r(1),o=r(72),a=new Array(16),s=[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],c=[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],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function _(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,v=0|this._a,w=0|this._b,E=0|this._c,S=0|this._d,T=0|this._e,A=0;A<80;A+=1){var I,k;A<16?(I=b(r,n,i,o,d,e[s[A]],l[0],u[A]),k=_(v,w,E,S,T,e[c[A]],h[0],f[A])):A<32?(I=m(r,n,i,o,d,e[s[A]],l[1],u[A]),k=y(v,w,E,S,T,e[c[A]],h[1],f[A])):A<48?(I=g(r,n,i,o,d,e[s[A]],l[2],u[A]),k=g(v,w,E,S,T,e[c[A]],h[2],f[A])):A<64?(I=y(r,n,i,o,d,e[s[A]],l[3],u[A]),k=m(v,w,E,S,T,e[c[A]],h[3],f[A])):(I=_(r,n,i,o,d,e[s[A]],l[4],u[A]),k=b(v,w,E,S,T,e[c[A]],h[4],f[A])),r=d,d=o,o=p(i,10),i=n,n=I,v=T,T=S,S=p(E,10),E=w,w=k}var R=this._b+i+S|0;this._b=this._c+o+T|0,this._c=this._d+d+v|0,this._d=this._e+r+w|0,this._e=this._a+n+E|0,this._a=R},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(174),t.sha1=r(175),t.sha224=r(176),t.sha256=r(77),t.sha384=r(177),t.sha512=r(78)},function(e,t,r){var n=t;n.utils=r(13),n.common=r(27),n.sha=r(186),n.ripemd=r(190),n.hmac=r(191),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){var n={ECB:r(216),CBC:r(217),CFB:r(218),CFB8:r(219),CFB1:r(220),OFB:r(221),CTR:r(90),GCM:r(90)},i=r(92);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){let n={};"undefined"==typeof dd&&"undefined"==typeof my&&(n=r(224),"undefined"!=typeof window&&(n=window.crypto)),"function"!=typeof n.publicEncrypt&&(n.publicEncrypt=r(29).publicEncryp),"function"!=typeof n.privateDecrypt&&(n.privateDecrypt=r(29).privateDecrypt),"function"!=typeof n.privateEncrypt&&(n.privateEncrypt=r(29).privateEncrypt),"function"!=typeof n.publicDecrypt&&(n.publicDecrypt=r(29).publicDecrypt),"function"!=typeof n.createHash&&(n.createHash=r(8)),"function"!=typeof n.createHmac&&(n.createHmac=r(42)),e.exports=n},function(e,t,r){"use strict";t.utils=r(230),t.Cipher=r(231),t.DES=r(232),t.CBC=r(233),t.EDE=r(234)},function(e,t,r){(function(t){var n=r(4),i=r(23);function o(e,r){var i=function(e){var t=a(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),o=r.modulus.byteLength(),s=(n.mont(r.modulus),new n(e).mul(i.blinder).umod(r.modulus)),c=s.toRed(n.mont(r.prime1)),u=s.toRed(n.mont(r.prime2)),f=r.coefficient,l=r.prime1,h=r.prime2,d=c.redPow(r.exponent1),p=u.redPow(r.exponent2);d=d.fromRed(),p=p.fromRed();var b=d.isub(p).imul(f).umod(l);return b.imul(h),p.iadd(b),new t(p.imul(i.unblinder).umod(r.modulus).toArray(!1,o))}function a(e){for(var t=e.modulus.byteLength(),r=new n(i(t));r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=o,o.getr=a}).call(this,r(2).Buffer)},function(e,t){e.exports={CreateAccount:"CreateAccount",QueryTransactionReceipt:"QueryTransactionReceipt",TransferBalance:"TransferBalance",SetRecoverkey:"SetRecoverkey",PreResetPubKey:"PreResetPubKey",ResetPubKey:"ResetPubKey",UpdateAuthMap:"UpdateAuthMap",FreezeAccount:"FreezeAccount",FreezeContract:"FreezeContract",NativeDepositData:"NativeDepositData",QueryLastBlock:"QueryLastBlock",QueryBlockHeader:"QueryBlockHeader",QueryLastBlockHeader:"QueryLastBlockHeader",QueryBlock:"QueryBlock",QueryTransaction:"QueryTransaction",QueryTransactionList:"QueryTransactionList",QueryTransactionAndReceipt:"QueryTransactionAndReceipt",QueryAccount:"QueryAccount",QueryContract:"QueryContract",QueryTimestamp:"QueryTimestamp",QueryP2PStatus:"QueryP2PStatus",QueryConsensusStatus:"QueryConsensusStatus",QueryCommonConsensusStatus:"QueryCommonConsensusStatus",QuerySyncStatus:"QuerySyncStatus",QueryTransactionCacheStatus:"QueryTransactionCacheStatus",QueryBlockCacheStatus:"QueryBlockCacheStatus",QueryContractNodesStatus:"QueryContractNodesStatus",QueryContractConfigStatus:"QueryContractConfigStatus",QueryLogLevel:"QueryLogLevel",QueryBlockProof:"QueryBlockProof",QueryLatestStateProof:"QueryLatestStateProof",QueryStateProof:"QueryStateProof",QueryTransactionProof:"QueryTransactionProof",QueryReceiptProof:"QueryReceiptProof",QueryBlockHeaderInfos:"QueryBlockHeaderInfos",QueryBlockReceiptInfos:"QueryBlockReceiptInfos",QueryBlockBodyInfos:"QueryBlockBodyInfos",DeployContract:"DeployContract",UpdateContract:"UpdateContract",CallContract:"CallContract",LocalTransaction:"LocalTransaction",EncryptedTransaction:"EncryptedTransaction",EventAccount:"EventAccount",EventContract:"EventContract",EventTopics:"EventTopics",EventBlock:"EventBlock",EventFetch:"EventFetch",EventCancel:"EventCancel",UpdateBlackList:"UpdateBlackList"}},function(e,t){e.exports={EVM:"01",WASM:"02"}},function(e,t,r){var n,i,o; /** * @license bytebuffer.js (c) 2015 Daniel Wirtz * Backing buffer: ArrayBuffer, Accessor: Uint8Array * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/bytebuffer.js for details */i=[r(305)],void 0===(o="function"==typeof(n=function(e){"use strict";var t=function(e,r,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,i=!!i}this.buffer=0===e?n:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=i};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var n=new ArrayBuffer(0),i=String.fromCharCode;function o(e){var t=0;return function(){return t1024&&(t.push(i.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function s(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=h,f-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)}function c(e,t,r,n,i,o){var a,s,c,u=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*c-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*b}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,n){return new t(e,r,n)},t.concat=function(e,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var o,a=0,s=0,c=e.length;s0&&(a+=o);if(0===a)return new t(0,n,i);var u,f=new t(a,n,i);for(s=0;s0&&(a.buffer=e.buffer,a.offset=e.byteOffset,a.limit=e.byteOffset+e.byteLength,a.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)a=new t(0,i,o),e.byteLength>0&&(a.buffer=e,a.offset=0,a.limit=e.byteLength,a.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(a=new t(e.length,i,o)).limit=e.length;for(var s=0;s>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n,i=t,o=e.length,a=o>>3,s=0;for(t+=this.writeVarint32(o,t);a--;)n=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(n,t++);if(s>3,a=0,s=[];for(e+=n.length;o--;)r=this.readByte(e++),s[a++]=!!(1&r),s[a++]=!!(2&r),s[a++]=!!(4&r),s[a++]=!!(8&r),s[a++]=!!(16&r),s[a++]=!!(32&r),s[a++]=!!(64&r),s[a++]=!!(128&r);if(a>c++&1)}return t&&(this.offset=e),s},r.readBytes=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var n=this.slice(t,t+e);return r&&(this.offset+=e),n},r.writeBytes=r.append,r.writeInt8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return 128==(128&r)&&(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768==(32768&r)&&(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a):(this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),n&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var o=new e(n,i,!1);return r&&(this.offset+=8),o},r.readLong=r.readInt64,r.writeUint64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;r>i&&this.resize((i*=2)>r?i:r),r-=8;var o=t.low,a=t.high;return this.littleEndian?(this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o,r+=4,this.view[r+3]=a>>>24&255,this.view[r+2]=a>>>16&255,this.view[r+1]=a>>>8&255,this.view[r]=255&a):(this.view[r]=a>>>24&255,this.view[r+1]=a>>>16&255,this.view[r+2]=a>>>8&255,this.view[r+3]=255&a,r+=4,this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o),n&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=0,i=0;this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0);var o=new e(n,i,!0);return r&&(this.offset+=8),o},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,c(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=s(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=8,c(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=s(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},r.writeVarint32=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,o=t.calculateVarint32(e);r+=o;var a=this.buffer.byteLength;for(r>a&&this.resize((a*=2)>r?a:r),r-=o,e>>>=0;e>=128;)i=127&e|128,this.view[r++]=i,e>>>=7;return this.view[r++]=e,n?(this.offset=r,this):o},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=0,i=0;do{if(!this.noAssert&&e>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}r=this.view[e++],n<5&&(i|=(127&r)<<7*n),++n}while(0!=(128&r));return i|=0,t?(this.offset=e,i):{value:i,length:n}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:r<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:i<128?9:10},t.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},t.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,n){var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var o=t.calculateVarint64(r),a=r.toInt()>>>0,s=r.shiftRightUnsigned(28).toInt()>>>0,c=r.shiftRightUnsigned(56).toInt()>>>0;n+=o;var u=this.buffer.byteLength;switch(n>u&&this.resize((u*=2)>n?u:n),n-=o,o){case 10:this.view[n+9]=c>>>7&1;case 9:this.view[n+8]=9!==o?128|c:127&c;case 8:this.view[n+7]=8!==o?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==o?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==o?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==o?128|s:127&s;case 4:this.view[n+3]=4!==o?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==o?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==o?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==o?128|a:127&a}return i?(this.offset+=o,this):o},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,i=0,o=0,a=0,s=0;if(s=this.view[t++],i=127&s,128&s&&(s=this.view[t++],i|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],i|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],i|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o|=(127&s)<<7,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o|=(127&s)<<14,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],o|=(127&s)<<21,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],a=127&s,(128&s||this.noAssert&&void 0===s)&&(s=this.view[t++],a|=(127&s)<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var c=e.fromBits(i|o<<28,o>>>4|a<<24,!1);return r?(this.offset=t,c):{value:c,length:t-n}},r.readVarint64ZigZag=function(r){var n=this.readVarint64(r);return n&&n.value instanceof e?n.value=t.zigZagDecode64(n.value):n=t.zigZagDecode64(n),n}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var n,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;n>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}i=f.calculateUTF16asUTF8(o(e))[1],t+=i+1;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=i+1,f.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):i},r.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=e,i=-1;return f.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=a(),!0),t?(this.offset=e,r()):{string:r(),length:e-n}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n,i=t;n=f.calculateUTF16asUTF8(o(e),this.noAssert)[1],t+=4+n;var a=this.buffer.byteLength;if(t>a&&this.resize((a*=2)>t?a:t),t-=4+n,this.littleEndian?(this.view[t+3]=n>>>24&255,this.view[t+2]=n>>>16&255,this.view[t+1]=n>>>8&255,this.view[t]=255&n):(this.view[t]=n>>>24&255,this.view[t+1]=n>>>16&255,this.view[t+2]=n>>>8&255,this.view[t+3]=255&n),t+=4,f.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),t!==i+4+n)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+n));return r?(this.offset=t,this):t-i},r.readIString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var n=e,i=this.readUint32(e),o=this.readUTF8String(i,t.METRICS_BYTES,e+=4);return e+=o.length,r?(this.offset=e,o.string):{string:o.string,length:e-n}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,n=void 0===t;if(n&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;r=f.calculateUTF16asUTF8(o(e))[1],t+=r;var a=this.buffer.byteLength;return t>a&&this.resize((a*=2)>t?a:t),t-=r,f.encodeUTF16toUTF8(o(e),function(e){this.view[t++]=e}.bind(this)),n?(this.offset=t,this):t-i},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return f.calculateUTF16asUTF8(o(e))[0]},t.calculateUTF8Bytes=function(e){return f.calculateUTF16asUTF8(o(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,n){"number"==typeof r&&(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var o,s=0,c=n;if(r===t.METRICS_CHARS){if(o=a(),f.decodeUTF8(function(){return s>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}var u=n+e;if(f.decodeUTF8toUTF16(function(){return n>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,a,s=r;i=f.calculateUTF16asUTF8(o(e),this.noAssert)[1],a=t.calculateVarint32(i),r+=a+i;var c=this.buffer.byteLength;if(r>c&&this.resize((c*=2)>r?c:r),r-=a+i,r+=this.writeVarint32(i,r),f.encodeUTF16toUTF8(o(e),function(e){this.view[r++]=e}.bind(this)),r!==s+i+a)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+a));return n?(this.offset=r,this):r-s},r.readVString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,i=this.readVarint32(e),o=this.readUTF8String(i.value,t.METRICS_BYTES,e+=i.length);return e+=o.length,r?(this.offset=e,o.string):{string:o.string,length:e-n}},r.append=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var o=e.limit-e.offset;if(o<=0)return this;n+=o;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=o,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=o,i&&(this.offset+=o),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=n,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(r),o=new Uint8Array(i);return o.set(this.view.subarray(e,t)),this.buffer=i,this.view=o,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var n=r-e,i=new t(n,this.littleEndian,this.noAssert);return i.offset=0,i.limit=n,i.markedOffset>=0&&(i.markedOffset-=e),this.copyTo(i,0,e,r),i},r.copyTo=function(e,r,n,i){var o,a;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(a=void 0===r)?e.offset:0|r,n=(o=void 0===n)?this.offset:0|n,i=void 0===i?this.limit:0|i,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(n<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=i-n;return 0===s?e:(e.ensureCapacity(r+s),e.view.set(this.view.subarray(n,i),r),o&&(this.offset+=s),a&&(e.offset+=s),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return te?t:e):this},r.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var o=e.limit-e.offset;if(o<=0)return this;var a=o-n;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),c=new Uint8Array(s);c.set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=s,this.view=c,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),n-o),e.offset=e.limit,i&&(this.offset-=o),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(this.view.subarray(e,t)),this)},r.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},r.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return n;var i=new ArrayBuffer(r-t);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(t,r),0),i},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var u=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],n=0,i=t.length;n>2&63]),i=(3&n)<<4,null!==(n=e())?(r(t[63&((i|=n>>4&15)|n>>4&15)]),i=(15&n)<<2,null!==(n=e())?(r(t[63&(i|n>>6&3)]),r(t[63&n])):(r(t[63&i]),r(61))):(r(t[63&i]),r(61),r(61))},e.decode=function(e,t){var n,i,o;function a(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(void 0===(i=r[n])&&a(n),null!==(n=e())&&(void 0===(o=r[n])&&a(n),t(i<<2>>>0|(48&o)>>4),null!==(n=e()))){if(void 0===(i=r[n])){if(61===n)break;a(n)}if(t((15&o)<<4>>>0|(60&i)>>2),null!==(n=e())){if(void 0===(o=r[n])){if(61===n)break;a(n)}t((3&i)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();r.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return u.encode(function(){return ethis.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],n=[];e=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var n,i=0,o=e.length,a=new t(o,r);i255)throw RangeError("illegal char code: "+n);a.view[i++]=n}return a.limit=o,a},r.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",a="";r32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";a+=i+o+"\n",i=o=""}r===this.offset&&r===this.limit?i+=r===this.markedOffset?"!":"|":r===this.offset?i+=r===this.markedOffset?"[":"<":r===this.limit?i+=r===this.markedOffset?"]":">":i+=r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+o+"\n"}return e?a:i},t.fromDebug=function(e,r,n){for(var i,o,a=e.length,s=new t((a+1)/3|0,r,n),c=0,u=0,f=!1,l=!1,h=!1,d=!1,p=!1;c":if(!n){if(d){p=!0;break}d=!0}s.limit=u,f=!1;break;case"'":if(!n){if(h){p=!0;break}h=!0}s.markedOffset=u,f=!1;break;case" ":f=!1;break;default:if(!n&&f){p=!0;break}if(o=parseInt(i+e.charAt(c++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=o,f=!0}if(p)throw TypeError("Illegal str: Invalid symbol at "+c)}if(!n){if(!l||!d)throw TypeError("Illegal str: Missing offset or limit");if(u>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,n=new Array(t-e);e255))throw TypeError("Illegal str: Contains non-hex characters");a.view[c++]=i}return a.limit=c,a};var f=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,n,i,o,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(0==(128&r))t(r);else if(192==(224&r))null===(n=e())&&a([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&a([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(o=e()))&&a([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,r)})},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,r)})},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,function(e){++r,n+=e<128?1:e<2048?2:e<65536?3:4}),[r,n]}};return e}();return r.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{f.decodeUTF8toUTF16(function(){return e",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),l=["%","/","?",";","#"].concat(f),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(337);function _(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o127?M+="x":M+=C[N];if(!M.match(d)){var L=B.slice(0,k),U=B.slice(k+1),q=C.match(p);q&&(L.push(q[1]),U.unshift(q[2])),U.length&&(_="/"+U.join(".")+_),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=n.toASCII(this.hostname));var j=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+j,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!b[E])for(k=0,P=f.length;k0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=S.slice(-1)[0],I=(r.host||e.host||S.length>1)&&("."===A||".."===A)||""===A,k=0,R=S.length;R>=0;R--)"."===(A=S[R])?S.splice(R,1):".."===A?(S.splice(R,1),k++):k&&(S.splice(R,1),k--);if(!w&&!E)for(;k--;k)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),I&&"/"!==S.join("/").substr(-1)&&S.push("");var x,B=""===S[0]||S[0]&&"/"===S[0].charAt(0);T&&(r.hostname=r.host=B?"":S.length?S.shift():"",(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift()));return(w=w||r.host&&S.length)&&!B&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){var n;/*! bignumber.js v2.4.0 https://github.com/MikeMcl/bignumber.js/LICENCE */!function(i){"use strict";var o,a,s,c=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,u=Math.ceil,f=Math.floor,l=" not a boolean or binary digit",h="rounding mode",d="number type has more than 15 significant digits",p="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",b=1e14,m=14,g=9007199254740991,y=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],_=1e7,v=1e9;function w(e){var t=0|e;return e>0||e===t?t:t-1}function E(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nu^r?1:-1;for(s=(c=i.length)<(u=o.length)?c:u,a=0;ao[a]^r?1:-1;return c==u?0:c>u^r?1:-1}function T(e,t,r){return(e=x(e))>=t&&e<=r}function A(e){return"[object Array]"==Object.prototype.toString.call(e)}function I(e,t,r){for(var n,i,o=[0],a=0,s=e.length;ar-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}function k(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function R(e,t){var r,n;if(t<0){for(n="0.";++t;n+="0");e=n+e}else if(++t>(r=e.length)){for(n="0",t-=r;--t;n+="0");e+=n}else t15&&ee(M,d,e),o=!1):l.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=X(u,10,t,l.s)}else{if(e instanceof V)return l.s=e.s,l.e=e.e,l.c=(e=e.c)?e.slice():e,void(M=0);if((o="number"==typeof e)&&0*e==0){if(l.s=1/e<0?(e=-e,-1):1,e===~~e){for(n=0,i=e;i>=10;i/=10,n++);return l.e=n,l.c=[e],void(M=0)}u=e+""}else{if(!c.test(u=e+""))return s(l,u,o);l.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for((n=u.indexOf("."))>-1&&(u=u.replace(".","")),(i=u.search(/e/i))>0?(n<0&&(n=i),n+=+u.slice(i+1),u=u.substring(0,i)):n<0&&(n=u.length),i=0;48===u.charCodeAt(i);i++);for(a=u.length;48===u.charCodeAt(--a););if(u=u.slice(i,a+1))if(a=u.length,o&&Y&&a>15&&(e>g||e!==f(e))&&ee(M,d,l.s*e),(n=n-i-1)>z)l.c=l.e=null;else if(n=0&&(s=H,H=0,e=e.replace(".",""),u=(l=new V(n)).pow(e.length-h),H=s,l.c=I(R(E(u.c),u.e),10,t),l.e=l.c.length),a=s=(f=I(e,n,t)).length;0==f[--s];f.pop());if(!f[0])return"0";if(h<0?--a:(u.c=f,u.e=a,u.s=i,f=(u=r(u,l,d,b,t)).c,c=u.r,a=u.e),h=f[o=a+d+1],s=t/2,c=c||o<0||null!=f[o+1],c=b<4?(null!=h||c)&&(0==b||b==(u.s<0?3:2)):h>s||h==s&&(4==b||c||6==b&&1&f[o-1]||b==(u.s<0?8:7)),o<1||!f[0])e=c?R("1",-d):"0";else{if(f.length=o,c)for(--t;++f[--o]>t;)f[o]=0,o||(++a,f.unshift(1));for(s=f.length;!f[--s];);for(h=0,e="";h<=s;e+=p.charAt(f[h++]));e=R(e,a)}return e}function W(e,t,r,n){var i,o,a,s,c;if(r=null!=r&&K(r,0,8,n,h)?0|r:U,!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)c=E(e.c),c=19==n||24==n&&a<=q?k(c,a):R(c,a);else if(o=(e=te(new V(e),t,r)).e,s=(c=E(e.c)).length,19==n||24==n&&(t<=o||o<=q)){for(;ss){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function Z(e,t){var r,n,i=0;for(A(e[0])&&(e=e[0]),r=new V(e[0]);++ir||e!=x(e))&&ee(n,(i||"decimal places")+(er?" out of range":" not an integer"),e),!0}function J(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*m-1)>z?e.c=e.e=null:r=10;s/=10,i++);if((o=t-i)<0)o+=m,a=t,h=(c=d[l=0])/p[i-a-1]%10|0;else if((l=u((o+1)/m))>=d.length){if(!n)break e;for(;d.length<=l;d.push(0));c=h=0,i=1,a=(o%=m)-m+1}else{for(c=s=d[l],i=1;s>=10;s/=10,i++);h=(a=(o%=m)-m+i)<0?0:c/p[i-a-1]%10|0}if(n=n||t<0||null!=d[l+1]||(a<0?c:c%p[i-a-1]),n=r<4?(h||n)&&(0==r||r==(e.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(o>0?a>0?c/p[i-a]:0:d[l-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,n?(t-=e.e+1,d[0]=p[(m-t%m)%m],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=l,s=1,l--):(d.length=l+1,s=p[m-o],d[l]=a>0?f(c/p[i-a]%p[a])*s:0),n)for(;;){if(0==l){for(o=1,a=d[0];a>=10;a/=10,o++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,d[0]==b&&(d[0]=1));break}if(d[l]+=s,d[l]!=b)break;d[l--]=0,s=1}for(o=d.length;0===d[--o];d.pop());}e.e>z?e.c=e.e=null:e.er)return null!=(e=i[r++])};return s(t="DECIMAL_PLACES")&&K(e,0,v,2,t)&&(L=0|e),n[t]=L,s(t="ROUNDING_MODE")&&K(e,0,8,2,t)&&(U=0|e),n[t]=U,s(t="EXPONENTIAL_AT")&&(A(e)?K(e[0],-v,0,2,t)&&K(e[1],0,v,2,t)&&(q=0|e[0],j=0|e[1]):K(e,-v,v,2,t)&&(q=-(j=0|(e<0?-e:e)))),n[t]=[q,j],s(t="RANGE")&&(A(e)?K(e[0],-v,-1,2,t)&&K(e[1],1,v,2,t)&&(D=0|e[0],z=0|e[1]):K(e,-v,v,2,t)&&(0|e?D=-(z=0|(e<0?-e:e)):Y&&ee(2,t+" cannot be zero",e))),n[t]=[D,z],s(t="ERRORS")&&(e===!!e||1===e||0===e?(M=0,K=(Y=!!e)?$:T):Y&&ee(2,t+l,e)),n[t]=Y,s(t="CRYPTO")&&(e===!!e||1===e||0===e?(F=!(!e||!a),e&&!F&&Y&&ee(2,"crypto unavailable",a)):Y&&ee(2,t+l,e)),n[t]=F,s(t="MODULO_MODE")&&K(e,0,9,2,t)&&(G=0|e),n[t]=G,s(t="POW_PRECISION")&&K(e,0,v,2,t)&&(H=0|e),n[t]=H,s(t="FORMAT")&&("object"==typeof e?Q=e:Y&&ee(2,t+" not an object",e)),n[t]=Q,n},V.max=function(){return Z(arguments,N.lt)},V.min=function(){return Z(arguments,N.gt)},V.random=(n=9007199254740992*Math.random()&2097151?function(){return f(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,o,s,c=0,l=[],h=new V(O);if(e=null!=e&&K(e,0,v,14)?0|e:L,o=u(e/m),F)if(a&&a.getRandomValues){for(t=a.getRandomValues(new Uint32Array(o*=2));c>>11))>=9e15?(r=a.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(l.push(s%1e14),c+=2);c=o/2}else if(a&&a.randomBytes){for(t=a.randomBytes(o*=7);c=9e15?a.randomBytes(7).copy(t,c):(l.push(s%1e14),c+=7);c=o/7}else Y&&ee(14,"crypto unavailable",a);if(!c)for(;c=10;s/=10,c++);cn?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.shift());}return function(n,i,o,a,s){var c,u,l,h,d,p,g,y,_,v,E,S,T,A,I,k,R,x=n.s==i.s?1:-1,B=n.c,P=i.c;if(!(B&&B[0]&&P&&P[0]))return new V(n.s&&i.s&&(B?!P||B[0]!=P[0]:P)?B&&0==B[0]||!P?0*x:x/0:NaN);for(_=(y=new V(x)).c=[],x=o+(u=n.e-i.e)+1,s||(s=b,u=w(n.e/m)-w(i.e/m),x=x/m|0),l=0;P[l]==(B[l]||0);l++);if(P[l]>(B[l]||0)&&u--,x<0)_.push(1),h=!0;else{for(A=B.length,k=P.length,l=0,x+=2,(d=f(s/(P[0]+1)))>1&&(P=e(P,d,s),B=e(B,d,s),k=P.length,A=B.length),T=k,E=(v=B.slice(0,k)).length;E=s/2&&I++;do{if(d=0,(c=t(P,v,k,E))<0){if(S=v[0],k!=E&&(S=S*s+(v[1]||0)),(d=f(S/I))>1)for(d>=s&&(d=s-1),g=(p=e(P,d,s)).length,E=v.length;1==t(p,v,g,E);)d--,r(p,k=10;x/=10,l++);te(y,o+(y.e=l+u*m-1)+1,a,h)}else y.e=u,y.r=+h;return y}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,o=/^([^.]+)\.$/,B=/^\.([^.]+)$/,P=/^-?(Infinity|NaN)$/,C=/^\s*\+(?=[\w.])|^\s+|\s+$/g,s=function(e,t,r,n){var a,s=r?t:t.replace(C,"");if(P.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(i,function(e,t,r){return a="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=a?e:t}),n&&(a=n,s=s.replace(o,"$1").replace(B,"0.$1")),t!=s))return new V(s,a);Y&&ee(M,"not a"+(n?" base "+n:"")+" number",t),e.s=null}e.c=e.e=null,M=0},N.absoluteValue=N.abs=function(){var e=new V(this);return e.s<0&&(e.s=1),e},N.ceil=function(){return te(new V(this),this.e+1,2)},N.comparedTo=N.cmp=function(e,t){return M=1,S(this,new V(e,t))},N.decimalPlaces=N.dp=function(){var e,t,r=this.c;if(!r)return null;if(e=((t=r.length-1)-w(this.e/m))*m,t=r[t])for(;t%10==0;t/=10,e--);return e<0&&(e=0),e},N.dividedBy=N.div=function(e,t){return M=3,r(this,new V(e,t),L,U)},N.dividedToIntegerBy=N.divToInt=function(e,t){return M=4,r(this,new V(e,t),0,1)},N.equals=N.eq=function(e,t){return M=5,0===S(this,new V(e,t))},N.floor=function(){return te(new V(this),this.e+1,3)},N.greaterThan=N.gt=function(e,t){return M=6,S(this,new V(e,t))>0},N.greaterThanOrEqualTo=N.gte=function(e,t){return M=7,1===(t=S(this,new V(e,t)))||0===t},N.isFinite=function(){return!!this.c},N.isInteger=N.isInt=function(){return!!this.c&&w(this.e/m)>this.c.length-2},N.isNaN=function(){return!this.s},N.isNegative=N.isNeg=function(){return this.s<0},N.isZero=function(){return!!this.c&&0==this.c[0]},N.lessThan=N.lt=function(e,t){return M=8,S(this,new V(e,t))<0},N.lessThanOrEqualTo=N.lte=function(e,t){return M=9,-1===(t=S(this,new V(e,t)))||0===t},N.minus=N.sub=function(e,t){var r,n,i,o,a=this,s=a.s;if(M=10,t=(e=new V(e,t)).s,!s||!t)return new V(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/m,u=e.e/m,f=a.c,l=e.c;if(!c||!u){if(!f||!l)return f?(e.s=-t,e):new V(l?a:NaN);if(!f[0]||!l[0])return l[0]?(e.s=-t,e):new V(f[0]?a:3==U?-0:0)}if(c=w(c),u=w(u),f=f.slice(),s=c-u){for((o=s<0)?(s=-s,i=f):(u=c,i=l),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=f.length)<(t=l.length))?s:t,s=t=0;t0)for(;t--;f[r++]=0);for(t=b-1;n>s;){if(f[--n]0?(a=o,r=c):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/b|0,s[t]%=b;return i&&(s.unshift(i),++a),J(e,s,a)},N.precision=N.sd=function(e){var t,r,n=this,i=n.c;if(null!=e&&e!==!!e&&1!==e&&0!==e&&(Y&&ee(13,"argument"+l,e),e!=!!e&&(e=null)),!i)return null;if(t=(r=i.length-1)*m+1,r=i[r]){for(;r%10==0;r/=10,t--);for(r=i[0];r>=10;r/=10,t++);}return e&&n.e+1>t&&(t=n.e+1),t},N.round=function(e,t){var r=new V(this);return(null==e||K(e,0,v,15))&&te(r,~~e+this.e+1,null!=t&&K(t,0,8,15,h)?0|t:U),r},N.shift=function(e){var t=this;return K(e,-g,g,16,"argument")?t.times("1e"+x(e)):new V(t.c&&t.c[0]&&(e<-g||e>g)?t.s*(e<0?0:1/0):t)},N.squareRoot=N.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,c=a.s,u=a.e,f=L+4,l=new V("0.5");if(1!==c||!s||!s[0])return new V(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+a))||c==1/0?(((t=E(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=w((u+1)/2)-(u<0||u%2),n=new V(t=c==1/0?"1e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new V(c+""),n.c[0])for((c=(u=n.e)+f)<3&&(c=0);;)if(o=n,n=l.times(o.plus(r(a,o,f,1))),E(o.c).slice(0,c)===(t=E(n.c)).slice(0,c)){if(n.e=0;){for(r=0,h=S[i]%y,d=S[i]/y|0,o=i+(a=c);o>i;)r=((u=h*(u=E[--a]%y)+(s=d*u+(f=E[a]/y|0)*h)%y*y+p[o]+r)/g|0)+(s/y|0)+d*f,p[o--]=u%g;p[o]=r}return r?++n:p.shift(),J(e,p,n)},N.toDigits=function(e,t){var r=new V(this);return e=null!=e&&K(e,1,v,18,"precision")?0|e:null,t=null!=t&&K(t,0,8,18,h)?0|t:U,e?te(r,e,t):r},N.toExponential=function(e,t){return W(this,null!=e&&K(e,0,v,19)?1+~~e:null,t,19)},N.toFixed=function(e,t){return W(this,null!=e&&K(e,0,v,20)?~~e+this.e+1:null,t,20)},N.toFormat=function(e,t){var r=W(this,null!=e&&K(e,0,v,21)?~~e+this.e+1:null,t,21);if(this.c){var n,i=r.split("."),o=+Q.groupSize,a=+Q.secondaryGroupSize,s=Q.groupSeparator,c=i[0],u=i[1],f=this.s<0,l=f?c.slice(1):c,h=l.length;if(a&&(n=o,o=a,a=n,h-=n),o>0&&h>0){for(n=h%o||o,c=l.substr(0,n);n0&&(c+=s+l.slice(n)),f&&(c="-"+c)}r=u?c+Q.decimalSeparator+((a=+Q.fractionGroupSize)?u.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+Q.fractionGroupSeparator):u):c}return r},N.toFraction=function(e){var t,n,i,o,a,s,c,u,f,l=Y,h=this,d=h.c,p=new V(O),b=n=new V(O),g=c=new V(O);if(null!=e&&(Y=!1,s=new V(e),Y=l,(l=s.isInt())&&!s.lt(O)||(Y&&ee(22,"max denominator "+(l?"out of range":"not an integer"),e),e=!l&&s.c&&te(s,s.e+1,1).gte(O)?s:null)),!d)return h.toString();for(f=E(d),o=p.e=f.length-h.e-1,p.c[0]=y[(a=o%m)<0?m+a:a],e=!e||s.cmp(p)>0?o>0?p:b:s,a=z,z=1/0,s=new V(f),c.c[0]=0;u=r(s,p,0,1),1!=(i=n.plus(u.times(g))).cmp(e);)n=g,g=i,b=c.plus(u.times(i=b)),c=i,p=s.minus(u.times(i=p)),s=i;return i=r(e.minus(n),g,0,1),c=c.plus(i.times(b)),n=n.plus(i.times(g)),c.s=b.s=h.s,t=r(b,g,o*=2,U).minus(h).abs().cmp(r(c,n,o,U).minus(h).abs())<1?[b.toString(),g.toString()]:[c.toString(),n.toString()],z=a,t},N.toNumber=function(){return+this},N.toPower=N.pow=function(e,t){var r,n,i,o=f(e<0?-e:+e),a=this;if(null!=t&&(M=23,t=new V(t)),!K(e,-g,g,23,"exponent")&&(!isFinite(e)||o>g&&(e/=0)||parseFloat(e)!=e&&!(e=NaN))||0==e)return r=Math.pow(+a,e),new V(t?r%t:r);for(t?e>1&&a.gt(O)&&a.isInt()&&t.gt(O)&&t.isInt()?a=a.mod(t):(i=t,t=null):H&&(r=u(H/m+2)),n=new V(O);;){if(o%2){if(!(n=n.times(a)).c)break;r?n.c.length>r&&(n.c.length=r):t&&(n=n.mod(t))}if(!(o=f(o/2)))break;a=a.times(a),r?a.c&&a.c.length>r&&(a.c.length=r):t&&(a=a.mod(t))}return t?n:(e<0&&(n=O.div(n)),i?n.mod(i):r?te(n,H,U):n)},N.toPrecision=function(e,t){return W(this,null!=e&&K(e,1,v,24,"precision")?0|e:null,t,24)},N.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(t=E(r.c),t=null!=e&&K(e,2,64,25,"base")?X(R(t,i),0|e,10,n):i<=q||i>=j?k(t,i):R(t,i),n<0&&r.c[0]&&(t="-"+t)),t},N.truncated=N.trunc=function(){return te(new V(this),this.e+1,1)},N.valueOf=N.toJSON=function(){var e,t=this,r=t.e;return null===r?t.toString():(e=E(t.c),e=r<=q||r>=j?k(e,r):R(e,r),t.s<0?"-"+e:e)},null!=t&&V.config(t),V}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){var n;e.exports=(n=r(3),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),c[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],l=r[6],h=r[7],d=0;d<64;d++){if(d<16)u[d]=0|e[t+d];else{var p=u[d-15],b=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=u[d-2],g=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[d]=b+u[d-7]+g+u[d-16]}var y=n&i^n&o^i&o,_=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),v=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&l)+c[d]+u[d];h=l,l=f,f=s,s=a+v|0,a=o,o=i,i=n,n=v+(_+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+l|0,r[7]=r[7]+h|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(f),t.HmacSHA256=o._createHmacHelper(f)}(Math),n.SHA256)},function(e,t,r){var n;e.exports=(n=r(3),r(37),function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var f=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],l=r[6],h=r[7],d=n.high,p=n.low,b=i.high,m=i.low,g=o.high,y=o.low,_=a.high,v=a.low,w=s.high,E=s.low,S=f.high,T=f.low,A=l.high,I=l.low,k=h.high,R=h.low,x=d,B=p,P=b,C=m,M=g,N=y,O=_,L=v,U=w,q=E,j=S,D=T,z=A,Y=I,K=k,F=R,G=0;G<80;G++){var H=u[G];if(G<16)var Q=H.high=0|e[t+2*G],V=H.low=0|e[t+2*G+1];else{var X=u[G-15],W=X.high,Z=X.low,$=(W>>>1|Z<<31)^(W>>>8|Z<<24)^W>>>7,J=(Z>>>1|W<<31)^(Z>>>8|W<<24)^(Z>>>7|W<<25),ee=u[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=u[G-7],ae=oe.high,se=oe.low,ce=u[G-16],ue=ce.high,fe=ce.low;Q=(Q=(Q=$+ae+((V=J+se)>>>0>>0?1:0))+ne+((V+=ie)>>>0>>0?1:0))+ue+((V+=fe)>>>0>>0?1:0),H.high=Q,H.low=V}var le,he=U&j^~U&z,de=q&D^~q&Y,pe=x&P^x&M^P&M,be=B&C^B&N^C&N,me=(x>>>28|B<<4)^(x<<30|B>>>2)^(x<<25|B>>>7),ge=(B>>>28|x<<4)^(B<<30|x>>>2)^(B<<25|x>>>7),ye=(U>>>14|q<<18)^(U>>>18|q<<14)^(U<<23|q>>>9),_e=(q>>>14|U<<18)^(q>>>18|U<<14)^(q<<23|U>>>9),ve=c[G],we=ve.high,Ee=ve.low,Se=K+ye+((le=F+_e)>>>0>>0?1:0),Te=ge+be;K=z,F=Y,z=j,Y=D,j=U,D=q,U=O+(Se=(Se=(Se=Se+he+((le+=de)>>>0>>0?1:0))+we+((le+=Ee)>>>0>>0?1:0))+Q+((le+=V)>>>0>>0?1:0))+((q=L+le|0)>>>0>>0?1:0)|0,O=M,L=N,M=P,N=C,P=x,C=B,x=Se+(me+pe+(Te>>>0>>0?1:0))+((B=le+Te|0)>>>0>>0?1:0)|0}p=n.low=p+B,n.high=d+x+(p>>>0>>0?1:0),m=i.low=m+C,i.high=b+P+(m>>>0>>0?1:0),y=o.low=y+N,o.high=g+M+(y>>>0>>0?1:0),v=a.low=v+L,a.high=_+O+(v>>>0>>0?1:0),E=s.low=E+q,s.high=w+U+(E>>>0>>0?1:0),T=f.low=T+D,f.high=S+j+(T>>>0>>0?1:0),I=l.low=I+Y,l.high=A+z+(I>>>0>>0?1:0),R=h.low=R+F,h.high=k+K+(R>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),n.SHA512)},function(e,t,r){var n;e.exports=(n=r(3),r(37),function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.x64.Word,s=t.algo,c=[],u=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){c[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,l=0,h=0;h<7;h++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(R=r[i]).high^=a,R.low^=o}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var d=0,p=0,b=0;b<5;b++)d^=(R=r[h+5*b]).high,p^=R.low;var m=l[h];m.high=d,m.low=p}for(h=0;h<5;h++){var g=l[(h+4)%5],y=l[(h+1)%5],_=y.high,v=y.low;for(d=g.high^(_<<1|v>>>31),p=g.low^(v<<1|_>>>31),b=0;b<5;b++)(R=r[h+5*b]).high^=d,R.low^=p}for(var w=1;w<25;w++){var E=(R=r[w]).high,S=R.low,T=c[w];T<32?(d=E<>>32-T,p=S<>>32-T):(d=S<>>64-T,p=E<>>64-T);var A=l[u[w]];A.high=d,A.low=p}var I=l[0],k=r[0];for(I.high=k.high,I.low=k.low,h=0;h<5;h++)for(b=0;b<5;b++){var R=r[w=h+5*b],x=l[w],B=l[(h+1)%5+5*b],P=l[(h+2)%5+5*b];R.high=x.high^~B.high&P.high,R.low=x.low^~B.low&P.low}R=r[0];var C=f[s];R.high^=C.high,R.low^=C.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],f=0;f>>24)|4278255360&(h<<24|h>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),u.push(d),u.push(h)}return new i.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(h),t.HmacSHA3=o._createHmacHelper(h)}(Math),n.SHA3)},function(e,t,r){"use strict";e.exports=r(157)},function(e){e.exports={COMPRESSED_TYPE_INVALID:"compressed should be a boolean",EC_PRIVATE_KEY_TYPE_INVALID:"private key should be a Buffer",EC_PRIVATE_KEY_LENGTH_INVALID:"private key length is invalid",EC_PRIVATE_KEY_RANGE_INVALID:"private key range is invalid",EC_PRIVATE_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting private key is invalid",EC_PRIVATE_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PRIVATE_KEY_EXPORT_DER_FAIL:"couldn't export to DER format",EC_PRIVATE_KEY_IMPORT_DER_FAIL:"couldn't import from DER format",EC_PUBLIC_KEYS_TYPE_INVALID:"public keys should be an Array",EC_PUBLIC_KEYS_LENGTH_INVALID:"public keys Array should have at least 1 element",EC_PUBLIC_KEY_TYPE_INVALID:"public key should be a Buffer",EC_PUBLIC_KEY_LENGTH_INVALID:"public key length is invalid",EC_PUBLIC_KEY_PARSE_FAIL:"the public key could not be parsed or is invalid",EC_PUBLIC_KEY_CREATE_FAIL:"private was invalid, try again",EC_PUBLIC_KEY_TWEAK_ADD_FAIL:"tweak out of range or resulting public key is invalid",EC_PUBLIC_KEY_TWEAK_MUL_FAIL:"tweak out of range",EC_PUBLIC_KEY_COMBINE_FAIL:"the sum of the public keys is not valid",ECDH_FAIL:"scalar was invalid (zero or overflow)",ECDSA_SIGNATURE_TYPE_INVALID:"signature should be a Buffer",ECDSA_SIGNATURE_LENGTH_INVALID:"signature length is invalid",ECDSA_SIGNATURE_PARSE_FAIL:"couldn't parse signature",ECDSA_SIGNATURE_PARSE_DER_FAIL:"couldn't parse DER signature",ECDSA_SIGNATURE_SERIALIZE_DER_FAIL:"couldn't serialize signature to DER format",ECDSA_SIGN_FAIL:"nonce generation function failed or private key is invalid",ECDSA_RECOVER_FAIL:"couldn't recover public key from signature",MSG32_TYPE_INVALID:"message should be a Buffer",MSG32_LENGTH_INVALID:"message length is invalid",OPTIONS_TYPE_INVALID:"options should be an Object",OPTIONS_DATA_TYPE_INVALID:"options.data should be a Buffer",OPTIONS_DATA_LENGTH_INVALID:"options.data length is invalid",OPTIONS_NONCEFN_TYPE_INVALID:"options.noncefn should be a Function",RECOVERY_ID_TYPE_INVALID:"recovery should be a Number",RECOVERY_ID_VALUE_INVALID:"recovery should have value between -1 and 4",TWEAK_TYPE_INVALID:"tweak should be a Buffer",TWEAK_LENGTH_INVALID:"tweak length is invalid"}},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(47).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i=r(39);e.exports=_;var o,a=r(64);_.ReadableState=y;r(48).EventEmitter;var s=function(e,t){return e.listeners(t).length},c=r(74),u=r(0).Buffer,f=t.Uint8Array||function(){};var l=r(26);l.inherits=r(1);var h=r(163),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(164),m=r(75);l.inherits(_,c);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(16));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(50).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function _(e){if(o=o||r(16),!(this instanceof _))return new _(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function v(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,T(e)}(e,a)):(i||(o=function(e,t){var r;n=t,u.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):I(e,a)):w(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){d("emit readable"),e.emit("readable"),B(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=u.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):T(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&C(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?f:_;function u(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",u),r.removeListener("end",f),r.removeListener("end",_),r.removeListener("data",b),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){d("onend"),e.end()}o.endEmitted?i.nextTick(c):r.once("end",c),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",l);var h=!1;var p=!1;function b(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==N(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){d("onerror",t),_(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),_()}function y(){d("onfinish"),e.removeListener("close",g),_()}function _(){d("unpipe"),r.unpipe(e)}return r.on("data",b),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",g),e.once("finish",y),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+d(r[g-15])+r[g-16];for(var y=0;y<64;++y){var _=m+h(c)+u(c,p,b)+a[y]+r[y]|0,v=l(n)+f(n,i,o)|0;m=b,b=p,p=c,c=s+_|0,s=o,o=i,i=n,n=_+v|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,r){var n=r(1),i=r(20),o=r(0).Buffer,a=[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],s=new Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,c=0|this._fh,y=0|this._gh,_=0|this._hh,v=0|this._al,w=0|this._bl,E=0|this._cl,S=0|this._dl,T=0|this._el,A=0|this._fl,I=0|this._gl,k=0|this._hl,R=0;R<32;R+=2)t[R]=e.readInt32BE(4*R),t[R+1]=e.readInt32BE(4*R+4);for(;R<160;R+=2){var x=t[R-30],B=t[R-30+1],P=d(x,B),C=p(B,x),M=b(x=t[R-4],B=t[R-4+1]),N=m(B,x),O=t[R-14],L=t[R-14+1],U=t[R-32],q=t[R-32+1],j=C+L|0,D=P+O+g(j,C)|0;D=(D=D+M+g(j=j+N|0,N)|0)+U+g(j=j+q|0,q)|0,t[R]=D,t[R+1]=j}for(var z=0;z<160;z+=2){D=t[z],j=t[z+1];var Y=f(r,n,i),K=f(v,w,E),F=l(r,v),G=l(v,r),H=h(s,T),Q=h(T,s),V=a[z],X=a[z+1],W=u(s,c,y),Z=u(T,A,I),$=k+Q|0,J=_+H+g($,k)|0;J=(J=(J=J+W+g($=$+Z|0,Z)|0)+V+g($=$+X|0,X)|0)+D+g($=$+j|0,j)|0;var ee=G+K|0,te=F+Y+g(ee,G)|0;_=y,k=I,y=c,I=A,c=s,A=T,s=o+J+g(T=S+$|0,S)|0,o=i,S=E,i=n,E=w,n=r,w=v,r=J+te+g(v=$+ee|0,$)|0}this._al=this._al+v|0,this._bl=this._bl+w|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+T|0,this._fl=this._fl+A|0,this._gl=this._gl+I|0,this._hl=this._hl+k|0,this._ah=this._ah+r+g(this._al,v)|0,this._bh=this._bh+n+g(this._bl,w)|0,this._ch=this._ch+i+g(this._cl,E)|0,this._dh=this._dh+o+g(this._dl,S)|0,this._eh=this._eh+s+g(this._el,T)|0,this._fh=this._fh+c+g(this._fl,A)|0,this._gh=this._gh+y+g(this._gl,I)|0,this._hh=this._hh+_+g(this._hl,k)|0},c.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(13),i=r(27),o=r(81),a=r(10),s=n.sum32,c=n.sum32_4,u=n.sum32_5,f=o.ch32,l=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,m),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let t=0;t=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128){const e=new i(2);return e[0]=o,e[1]=n.length,this._createEncoderBuffer([e,n])}let a=1;for(let e=n.length;e>=256;e>>=8)a++;const c=new i(2+a);c[0]=o,c[1]=128|a;for(let e=1+a,t=n.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=new i(2*e.length);for(let r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t=128;r>>=7)n++}const o=new i(n);let a=o.length-1;for(let t=e.length-1;t>=0;t--){let r=e[t];for(o[a--]=127&r;(r>>=7)>0;)o[a--]=128|127&r}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[f(n.getUTCFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getUTCFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=new i(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=new i(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let t=e;t>=256;t>>=8)r++;const n=new Array(r);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new i(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;ir||o!=o)throw new TypeError("Bad key length")}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,r(9))},function(e,t,r){var n=r(95),i=r(51),o=r(52),a=r(98),s=r(99),c=r(0).Buffer,u=c.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,t,r){var a=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return o(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=a(t):t.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(h);)r.iadd(d);if(m(p=r.shrn(1))&&m(r)&&g(p)&&g(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(4),i=r(80);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var u=e.shrn(c),f=s.toRed(o);t>0;t--){var l=this._randrange(new n(2),s);r&&r(l);var h=l.toRed(o).redPow(u);if(0!==h.cmp(a)&&0!==h.cmp(f)){for(var d=1;d0;t--){var f=this._randrange(new n(2),a),l=e.gcd(f);if(0!==l.cmpn(1))return l;var h=f.toRed(i).redPow(c);if(0!==h.cmp(o)&&0!==h.cmp(u)){for(var d=1;d>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var c=1,u=n.length;u>=256;u>>=8)c++;(o=new i(2+c))[0]=a,o[1]=128|c;u=1+c;for(var f=n.length;f>0;u--,f>>=8)o[u]=255&f;return this._createEncoderBuffer([o,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),c=s.length-1;for(n=e.length-1;n>=0;n--){a=e[n];for(s[c--]=127&a;(a>>=7)>0;)s[c--]=128|127&a}return this._createEncoderBuffer(s)},u.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[f(n.getFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var a=e;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=a,a.getr=s},function(e,t,r){var n=Math.pow(2,30)-1,i=r(0).Buffer;function o(e,t){if("string"!=typeof e&&!i.isBuffer(e))throw new TypeError(t+" must be a buffer or string")}e.exports=function(e,t,r,i){if(o(e,"Password"),o(t,"Salt"),"number"!=typeof r)throw new TypeError("Iterations not a number");if(r<0)throw new TypeError("Bad iterations");if("number"!=typeof i)throw new TypeError("Key length not a number");if(i<0||i>n||i!=i)throw new TypeError("Bad key length")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={};let i;t.wordlists=n,t._default=i,["chinese_simplified","chinese_traditional","korean","french","italian","spanish","japanese","english"].forEach(e=>{try{t._default=i=r(264)("./"+e+".json"),n[e]=i,"japanese"===e&&(n.JA=i),"english"===e&&(n.EN=i)}catch(e){}})},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(279));t.encodeBase64=function(e){var r="";return r="string"==typeof e?e:t.arrayBufferToString(e),i.getEnvBtoa()(r)},t.decodeBase64=function(e){var r=i.getEnvAtob()(e),n=t.stringToArrayBuffer(r);return a(n)};var o=function(e){if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e)&&void 0!==e.buffer)return new Uint8Array(e.buffer);if(e instanceof ArrayBuffer)return new Uint8Array(e);throw new Error("Input must be an ArrayBuffer or a TypedArray")},a=function(e){for(var t=!0,r=0;r126||e[r]<32&&13!==e[r]&&10!==e[r]){t=!1;break}var n=null;if(t){n="";for(r=0;r * @license MIT */ function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i=0;u--)if(f[u]!==l[u])return!1;for(u=f.length-1;u>=0;u--)if(c=f[u],!y(e[c],t[c],r,n))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function v(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function w(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&m(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!e&&i&&!r;if((!e&&o.isError(i)&&a&&v(i,r)||s)&&m(i,r,"Got unwanted exception"+n),e&&i&&r&&!v(i,r)||!e&&i)throw i}l.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=p(b((t=this).actual),128)+" "+t.operator+" "+p(b(t.expected),128),this.generatedMessage=!0);var r=e.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=d(r),a=i.indexOf("\n"+o);if(a>=0){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}},o.inherits(l.AssertionError,Error),l.fail=m,l.ok=g,l.equal=function(e,t,r){e!=t&&m(e,t,r,"==",l.equal)},l.notEqual=function(e,t,r){e==t&&m(e,t,r,"!=",l.notEqual)},l.deepEqual=function(e,t,r){y(e,t,!1)||m(e,t,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(e,t,r){y(e,t,!0)||m(e,t,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(e,t,r){y(e,t,!1)&&m(e,t,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function e(t,r,n){y(t,r,!0)&&m(t,r,n,"notDeepStrictEqual",e)},l.strictEqual=function(e,t,r){e!==t&&m(e,t,r,"===",l.strictEqual)},l.notStrictEqual=function(e,t,r){e===t&&m(e,t,r,"!==",l.notStrictEqual)},l.throws=function(e,t,r){w(!0,e,t,r)},l.doesNotThrow=function(e,t,r){w(!1,e,t,r)},l.ifError=function(e){if(e)throw e};var E=Object.keys||function(e){var t=[];for(var r in e)a.call(e,r)&&t.push(r);return t}}).call(this,r(7))},function(e,t,r){const n=r(315),i=r(58),o=r(316),{handshake:a,hash:s,timestamp:c,msg_type:u,transaction_index:f,identity:l,level:h,topic:d,sequence:p,group_id:b,return_code:m,encrypted_tx:g,Message:y,Request:_,Response:v,Tx:w,Receipt:E,block_number:S,BlockHeader:T,BlockBody:A,Block:I,recover_key:k,auth_key:R,auth_weight:x,Account:B,OldAccount:P,Contract:C,node_id:M,P2pStatus:N,NodeInfo:O,SyncStatus:L,TransactionCacheInfo:U,BlockCacheInfo:q,cCode:j,parameter:D,payload:z,event_type:Y,filter_id:K,event_data_type:F,event_data:G,common_consensus_type:H,common_consensus_info:Q,consensus_info:V,hashes:X,transactions:W,transaction_infos:Z,configs:$,black_list:J,signature:ee,block_proof:te,state_proof:re,transaction_proof:ne,receipt_proof:ie,reverse:oe,max_amount:ae,header_infos:se,block_receipts:ce,block_body:ue}=r(122),fe=r(326),le=r(327),he=r(12);function de(e,t){const r=ke[e];if(!r)throw new Error(e+" is not api");return function e(t,r){const n=[];for(let i=0;i{i.push(be(t[0],e))});else if("number"==typeof t.array_type){const r=t.slice(0);for(let t=0;t{i.push(ge(e,t))});r[n||"arr"]=i}else if(t.rlp){r=me(he.rlp_decode(e),t,r)}else n?r[n]=ge(e,t):r=ge(e,t,r);else r[n]=be(t,e);return r}function ge(e,t,r={}){for(let n=0;n(e.from=ye(e.from),e.to=ye(e.to),e.data="0x0",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_TRANS_BALANCE,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.SetRecoverkey,topics:"set_recover_key",request_msg_type:n.MSG_TYPE_TX_REQ_SET_RECOVERY_KEY,response_msg_type:n.MSG_TYPE_TX_RESP_SET_RECOVERY_KEY,transaction_type:o.TX_SET_RECOVER_KEY,request:[u,[_,w]],response:[u,[v,s]],data:[k],dataInput:e=>(e.from=ye(e.from),e.to=e.from,e.data=de(i.SetRecoverkey,e.data)[0]||"",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_SET_RECOVERY_KEY,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.PreResetPubKey,topics:"",request_msg_type:n.MSG_TYPE_TX_REQ_PRE_RESET_PUB_KEY,response_msg_type:n.MSG_TYPE_TX_RESP_PRE_RESET_PUB_KEY,transaction_type:o.TX_PRE_RESET_PUB_KEY,request:[u,[_,w]],response:[u,[v,s]],data:[],dataInput:e=>(e.from=ye(e.from),e.to=e.from,e.data="0x0",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userRecoverPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_PRE_RESET_PUB_KEY,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userRecoverPrivateKey)}}},{name:i.ResetPubKey,topics:"",request_msg_type:n.MSG_TYPE_TX_REQ_RESET_PUB_KEY,response_msg_type:n.MSG_TYPE_TX_RESP_RESET_PUB_KEY,transaction_type:o.TX_RESET_PUB_KEY,request:[u,[_,w]],response:[u,[v,s]],data:[R,x],dataInput:e=>(e.from=ye(e.from),e.to=e.from,e.data=de(i.ResetPubKey,e.data)[0]||"",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userRecoverPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_RESET_PUB_KEY,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userRecoverPrivateKey)}}},{name:i.UpdateAuthMap,topics:"",request_msg_type:n.MSG_TYPE_TX_REQ_UPDATE_AUTH_MAP,response_msg_type:n.MSG_TYPE_TX_RESP_UPDATE_AUTH_MAP,transaction_type:o.TX_UPDATE_AUTH_MAP,request:[u,[_,w]],response:[u,[v,s]],data:[R,x],dataInput:e=>(e.from=ye(e.from),e.to=e.from,e.data=de(i.UpdateAuthMap,e.data)[0]||"",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_UPDATE_AUTH_MAP,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.FreezeAccount,topics:"",request_msg_type:n.MSG_TYPE_TX_REQ_FREEZE_ACCOUNT,response_msg_type:n.MSG_TYPE_TX_RESP_FREEZE_ACCOUNT,transaction_type:o.TX_FREEZE_ACCOUNT_CONTRACT,request:[u,[_,w]],response:[u,[v,s]],data:[],dataInput:e=>(e.from=ye(e.from),e.to=ye(e.from),e.data="0x0",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_FREEZE_ACCOUNT,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.FreezeContract,topics:"",request_msg_type:n.MSG_TYPE_TX_REQ_FREEZE_CONTRACT,response_msg_type:n.MSG_TYPE_TX_RESP_FREEZE_CONTRACT,transaction_type:o.TX_FREEZE_ACCOUNT_CONTRACT,request:[u,[_,w]],response:[u,[v,s]],data:[],dataInput:e=>(e.from=ye(e.from),e.to=ye(e.to),e.data="0x0",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_FREEZE_CONTRACT,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.NativeDepositData,request_msg_type:n.MSG_TYPE_TX_REQ_NATIVE_DEPOSIT_DATA,response_msg_type:n.MSG_TYPE_TX_RESP_NATIVE_DEPOSIT_DATA,transaction_type:o.TX_NATIVE_DEPOSIT_DATA,request:[u,[_,w]],response:[u,[v,s]],data:[z],dataInput:e=>(e.from=ye(e.from),e.to=ye(e.to),e.data=de(i.NativeDepositData,e.data)[0]||"",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_NATIVE_DEPOSIT_DATA,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.QueryLastBlock,request_msg_type:n.MSG_TYPE_QUERY_REQ_LAST_BLOCK,response_msg_type:n.MSG_TYPE_QUERY_RESP_LAST_BLOCK,transaction_type:"",request:[u,_],response:[u,[v,I]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_LAST_BLOCK,sequence:r.sequence})},{name:i.QueryBlockHeader,request_msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_HEADER,response_msg_type:n.MSG_TYPE_QUERY_RESP_BLOCK_HEADER,transaction_type:"",request:[u,[_,S,s]],response:[u,[v,T]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,block_number:t.block_number||0,hash:t.hash||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_HEADER,sequence:r.sequence,block_number:t.block_number||0,hash:we(t.hash)||"0"})},{name:i.QueryLastBlockHeader,request_msg_type:n.MSG_TYPE_QUERY_REQ_LAST_BLOCK_HEADER,response_msg_type:n.MSG_TYPE_QUERY_RESP_LAST_BLOCK_HEADER,transaction_type:"",request:[u,_],response:[u,[v,T]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_LAST_BLOCK_HEADER,sequence:r.sequence})},{name:i.QueryBlock,request_msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK,response_msg_type:n.MSG_TYPE_QUERY_RESP_BLOCK,transaction_type:"",request:[u,[_,S,s]],response:[u,[v,I]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,block_number:t.block_number||0,hash:t.hash||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK,sequence:r.sequence,block_number:t.block_number||0,hash:we(t.hash)||"0"})},{name:i.QueryTransaction,request_msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION,response_msg_type:n.MSG_TYPE_QUERY_RESP_TRANSACTION,transaction_type:"",request:[u,[_,s]],response:[u,[v,w,S,f]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.hash}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION,sequence:r.sequence,hash:we(t.hash)})},{name:i.QueryTransactionReceipt,request_msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION_RECEIPT,response_msg_type:n.MSG_TYPE_QUERY_RESP_TRANSACTION_RECEIPT,transaction_type:"",request:[u,[_,s]],response:[u,[v,E,S,f]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.hash}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION_RECEIPT,sequence:r.sequence,hash:we(t.hash)})},{name:i.QueryTransactionList,request_msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION_LIST,response_msg_type:n.MSG_TYPE_QUERY_RESP_TRANSACTION_LIST,transaction_type:"",request:[u,[_,s]],response:[u,[v,W]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.hashes}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION_LIST,sequence:r.sequence,hashes:Ee(t.hashes)})},{name:i.QueryTransactionAndReceipt,request_msg_type:n.MSG_TYPE_QUERY_REQ_TX_AND_RECEIPT,response_msg_type:n.MSG_TYPE_QUERY_RESP_TX_AND_RECEIPT,transaction_type:"",request:[u,[_,s]],response:[u,[v,Z]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.hashes}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_RESP_TX_AND_RECEIPT,sequence:r.sequence,hashes:Ee(t.hashes)})},{name:i.QueryAccount,request_msg_type:n.MSG_TYPE_QUERY_REQ_ACCOUNT,response_msg_type:n.MSG_TYPE_QUERY_RESP_ACCOUNT,transaction_type:"",request:[u,[_,s]],response:[u,[v,B]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.from}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_ACCOUNT,sequence:r.sequence,id:ye(t.from,!0)})},{name:i.QueryContract,request_msg_type:n.MSG_TYPE_QUERY_REQ_CONTRACT,response_msg_type:n.MSG_TYPE_QUERY_RESP_CONTRACT,transaction_type:"",request:[u,[_,s]],response:[u,[v,C]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.from}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_CONTRACT,sequence:r.sequence,id:ye(t.from,!0)})},{name:i.QueryTimestamp,request_msg_type:n.MSG_TYPE_QUERY_REQ_TS,response_msg_type:n.MSG_TYPE_QUERY_RESP_TS,transaction_type:"",request:[u,_],response:[u,[v,c]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_TS,sequence:r.sequence})},{name:i.QueryP2PStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_P2P,response_msg_type:n.MSG_TYPE_STATUS_RESP_P2P,transaction_type:"",request:[u,_,M],response:[u,[v,N]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_P2P,sequence:r.sequence,node_id:we(t.node_id)||0})},{name:i.QueryConsensusStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_CONSENSUS,response_msg_type:n.MSG_TYPE_STATUS_RESP_PBFT,transaction_type:"",request:[u,[_,M]],response:[u,[v,V]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,node_id:t.node_id||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_CONSENSUS,sequence:r.sequence,node_id:we(t.node_id)||0})},{name:i.QueryCommonConsensusStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_COMMON_CONSENSUS,response_msg_type:n.MSG_TYPE_STATUS_RESP_COMMON_CONSENSUS,transaction_type:"",request:[u,[_,M]],response:[u,[v,H,Q]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,node_id:t.node_id||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_COMMON_CONSENSUS,sequence:r.sequence,node_id:we(t.node_id)||0})},{name:i.QuerySyncStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_SYNC,response_msg_type:n.MSG_TYPE_STATUS_RESP_SYNC,transaction_type:"",request:[u,[_,M]],response:[u,[v,L]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,node_id:t.node_id||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_SYNC,sequence:r.sequence,node_id:we(t.node_id)||0})},{name:i.QueryTransactionCacheStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_TX_CACHE,response_msg_type:n.MSG_TYPE_STATUS_RESP_TX_CACHE,transaction_type:"",request:[u,[_,M]],response:[u,[v,U]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,node_id:t.node_id||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_TX_CACHE,sequence:r.sequence,node_id:we(t.node_id)||0})},{name:i.QueryBlockCacheStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_BLOCK_CACHE,response_msg_type:n.MSG_TYPE_STATUS_RESP_BLOCK_CACHE,transaction_type:"",request:[u,[_,M]],response:[u,[v,q]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,node_id:t.node_id||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_BLOCK_CACHE,sequence:r.sequence,node_id:we(t.node_id)||0})},{name:i.QueryContractNodesStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_CONTRACT_NODES,response_msg_type:n.MSG_TYPE_STATUS_RESP_CONTRACT_NODES,transaction_type:"",request:[u,_],response:[u,[v,O]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_CONTRACT_NODES,sequence:r.sequence})},{name:i.QueryContractConfigStatus,request_msg_type:n.MSG_TYPE_STATUS_REQ_CONTRACT_CONFIG,response_msg_type:n.MSG_TYPE_STATUS_RESP_CONTRACT_CONFIG,transaction_type:"",request:[u,_],response:[u,[v,$]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_STATUS_REQ_CONTRACT_CONFIG,sequence:r.sequence})},{name:i.QueryLogLevel,request_msg_type:n.MSG_TYPE_ADMIN_REQ_LOG_LEVEL,response_msg_type:n.MSG_TYPE_ADMIN_RESP_LOG_LEVEL,transaction_type:"",request:[u,_],response:[u,[v,h]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_ADMIN_REQ_LOG_LEVEL,sequence:r.sequence})},{name:i.UpdateBlackList,request_msg_type:n.MSG_TYPE_ADMIN_REQ_UPDATE_BLACK_LIST,response_msg_type:n.MSG_TYPE_ADMIN_RESP_UPDATE_BLACK_LIST,transaction_type:"",request:[u,[_,J,ee]],response:[u,v],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,black_list:t.black_list,signature:t.signature}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_ADMIN_REQ_UPDATE_BLACK_LIST,sequence:r.sequence,black_list:t.black_list,signature:t.signature})},{name:i.QueryBlockProof,request_msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_PROOF,response_msg_type:n.MSG_TYPE_QUERY_RESP_BLOCK_PROOF,transaction_type:"",request:[u,[_,S,s]],response:[u,[v,te]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,block_number:t.block_number||0,hash:t.hash||"0x0"}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK,sequence:r.sequence,block_number:t.block_number||0,hash:we(t.hash)||"0"})},{name:i.QueryLatestStateProof,request_msg_type:n.MSG_TYPE_QUERY_REQ_LATEST_STATE_PROOF,response_msg_type:n.MSG_TYPE_QUERY_RESP_LATEST_STATE_PROOF,transaction_type:"",request:[u,[_,l]],response:[u,[v,re]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,identity:t.id}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_LATEST_STATE_PROOF,sequence:r.sequence,identity:t.id})},{name:i.QueryStateProof,request_msg_type:n.MSG_TYPE_QUERY_REQ_STATE_PROOF,response_msg_type:n.MSG_TYPE_QUERY_RESP_STATE_PROOF,transaction_type:"",request:[u,[_,l]],response:[u,[v,re]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,identity:t.id,block_number:t.block_number,hash:t.hash}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_STATE_PROOF,sequence:r.sequence,identity:t.id,block_number:t.block_number,hash:t.hash})},{name:i.QueryTransactionProof,request_msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION_PROOF,response_msg_type:n.MSG_TYPE_QUERY_RESP_TRANSACTION_PROOF,transaction_type:"",request:[u,[_,s]],response:[u,[v,ne]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.hash}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_TRANSACTION_PROOF,sequence:r.sequence,hash:t.hash})},{name:i.QueryReceiptProof,request_msg_type:n.MSG_TYPE_QUERY_REQ_RECEIPT_PROOF,response_msg_type:n.MSG_TYPE_QUERY_RESP_RECEIPT_PROOF,transaction_type:"",request:[u,[_,s]],response:[u,[v,ie]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.hash}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_RECEIPT_PROOF,sequence:r.sequence,hash:t.hash})},{name:i.QueryBlockHeaderInfos,request_msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_HEADER_INFOS,response_msg_type:n.MSG_TYPE_QUERY_RESP_BLOCK_HEADER_INFOS,transaction_type:"",request:[u,[_,s,S,ae,oe]],response:[u,[v,se]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.block_hash,block_number:t.block_number,max_amount:t.max_amount,reverse:t.reverse}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_HEADER_INFOS,sequence:r.sequence,hash:t.block_hash,block_number:t.block_number,max_amount:t.max_amount,reverse:t.reverse})},{name:i.QueryBlockReceiptInfos,request_msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_RECEIPTS,response_msg_type:n.MSG_TYPE_QUERY_RESP_BLOCK_RECEIPTS,transaction_type:"",request:[u,[_,s]],response:[u,[v,ce]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.block_hashes}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_RECEIPTS,sequence:r.sequence,hash:t.block_hashes})},{name:i.QueryBlockBodyInfos,request_msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_BODY_INFOS,response_msg_type:n.MSG_TYPE_QUERY_RESP_BLOCK_BODY_INFOS,transaction_type:"",request:[u,[_,s]],response:[u,[v,ue]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,hash:t.block_hashes}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_QUERY_REQ_BLOCK_BODY_INFOS,sequence:r.sequence,hash:t.block_hashes})},{name:i.DeployContract,request_msg_type:n.MSG_TYPE_TX_REQ_CONTRACT_DEPLOY,response_msg_type:n.MSG_TYPE_TX_RESP_CONTRACT_DEPLOY,transaction_type:o.TX_DEPLOY_CONTRACT,request:[u,[_,w]],response:[u,[v,s]],data:[j],dataInput:e=>(e.from=ye(e.from),e.to=ye(e.to),e.data=de(i.DeployContract,e.data)[0]||"",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_CONTRACT_DEPLOY,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.UpdateContract,request_msg_type:n.MSG_TYPE_TX_REQ_CONTRACT_UPDATE,response_msg_type:n.MSG_TYPE_TX_RESP_CONTRACT_UPDATE,transaction_type:o.TX_UPDATE_CONTRACT,request:[u,[_,w]],response:[u,[v,s]],data:[j],dataInput:e=>(e.to=ye(e.to),e.from=e.from?ye(e.from):e.to,e.data=de(i.UpdateContract,e.data)[0]||"",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_CONTRACT_UPDATE,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.CallContract,request_msg_type:n.MSG_TYPE_TX_REQ_CONTRACT_CALL,response_msg_type:n.MSG_TYPE_TX_RESP_CONTRACT_CALL,transaction_type:o.TX_CALL_CONTRACT,request:[u,[_,w]],response:[u,[v,s]],data:[D],dataInput:e=>(e.from=ye(e.from),e.to=ye(e.to),e.data=de(i.CallContract,e.data)[0]||"",e),nodeInput(e,t,r){return _e(this.dataInput(t),r,r.userPrivateKey)},httpInput(e,t,r){return{msg_type:n.MSG_TYPE_TX_REQ_CONTRACT_CALL,sequence:r.sequence,transaction:Se(this.dataInput(t),r,r.userPrivateKey)}}},{name:i.EventAccount,request_msg_type:n.MSG_TYPE_EVENT_REQ_ACCOUNT,response_msg_type:n.MSG_TYPE_EVENT_RESP_FILTER_ID,transaction_type:"",request:[u,[_,Y,l]],response:[u,[v,K]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,type:t.type,identity:t.identity}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_EVENT_REQ_ACCOUNT,sequence:r.sequence,event_type:t.type||0,id:he.getHash(t.identity,!0)})},{name:i.EventContract,request_msg_type:n.MSG_TYPE_EVENT_REQ_CONTRACT,response_msg_type:n.MSG_TYPE_EVENT_RESP_FILTER_ID,transaction_type:"",request:[u,[_,Y,l]],response:[u,[v,K]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,type:t.type,identity:t.identity}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_EVENT_REQ_CONTRACT,sequence:r.sequence,event_type:t.type||0,id:he.getHash(t.identity,!0)})},{name:i.EventTopics,request_msg_type:n.MSG_TYPE_EVENT_REQ_TOPICS,response_msg_type:n.MSG_TYPE_EVENT_RESP_FILTER_ID,transaction_type:"",request:[u,[_,Y,[d]]],response:[u,[v,K]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,type:t.type,topic:t.identity}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_EVENT_REQ_TOPICS,sequence:r.sequence,event_type:t.type||0,topics:[t.identity]})},{name:i.EventBlock,request_msg_type:n.MSG_TYPE_EVENT_REQ_BLOCK,response_msg_type:n.MSG_TYPE_EVENT_RESP_FILTER_ID,transaction_type:"",request:[u,[_,Y,p]],response:[u,[v,K]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,type:t.type||0}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_EVENT_REQ_BLOCK,sequence:r.sequence,event_type:t.type||0})},{name:i.EventFetch,request_msg_type:n.MSG_TYPE_EVENT_REQ_FETCH,response_msg_type:n.MSG_TYPE_EVENT_RESP_FETCH,transaction_type:"",request:[u,[_,K]],response:[u,[v,F,G]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,filter_id:t.filter_id}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_EVENT_REQ_FETCH,sequence:r.sequence,filter_id:t.filter_id})},{name:i.EventCancel,request_msg_type:n.MSG_TYPE_EVENT_REQ_CANCEL,response_msg_type:n.MSG_TYPE_EVENT_RESP_CANCEL,transaction_type:"",request:[u,[_,[K]]],response:[u,[y,p,m,b]],data:[],dataInput:e=>e,nodeInput:(e,t,r)=>({sequence:r.sequence,filter_id:t.filter_id}),httpInput:(e,t,r)=>({msg_type:n.MSG_TYPE_EVENT_REQ_CANCEL,sequence:r.sequence,filter_ids:[t.filter_id]})},{name:i.LocalTransaction,request_msg_type:n.MSG_TYPE_TX_REQ_LOCAL,response_msg_type:n.MSG_TYPE_TX_RESP_LOCAL,request:[u,[_,S,w]],response:[u,[v,s,E]],data:[],dataInput:e=>e.encrypt?ke[i.EncryptedTransaction].dataInput(e):ke[e.apiName].dataInput(e),nodeInput(e,t,r){let n={};return t.encrypt?(r.transaction_type=o.TX_CONFIDENTIAL,n=ke[i.EncryptedTransaction].nodeInput(t.apiName,t,r)):(r.transaction_type=ke[t.apiName].transaction_type,n=ke[t.apiName].nodeInput(t.apiName,t,r)),n.block_number=t.block_number||"0xffffffffffffffff",n},httpInput(e,t,r){let a={msg_type:n.MSG_TYPE_TX_RESP_LOCAL,sequence:r.sequence};return t.encrypt?(r.transaction_type=o.TX_CONFIDENTIAL,a=ke[i.EncryptedTransaction].httpInput(t.apiName,t,r)):(r.transaction_type=ke[t.apiName].transaction_type,a=ke[t.apiName].httpInput(t.apiName,t,r)),a.block_number=t.block_number||"18446744073709551615",a}},{name:i.EncryptedTransaction,request_msg_type:n.MSG_TYPE_TX_REQ_CONFIDENTIAL_TX,response_msg_type:n.MSG_TYPE_TX_RESP_CONFIDENTIAL_TX,transaction_type:o.TX_CONFIDENTIAL,request:[u,[_,w]],response:[u,[v,s]],data:[g],dataInput:e=>(e.from=ye(e.from),e.to=ye(e.to),e.data=de(i.EncryptedTransaction,e.data)[0]||"",e),nodeInput(e,t,r){let n={...r};n.transaction_type=ke[t.apiName].transaction_type;let i=ke[t.apiName].nodeInput(t.apiName,t,n),o=he.rlp_encode(pe(t.apiName,i,w),!0);return t.data={encrypted_tx:he.sealSGXWithPassword(t.publicKey,o,t.aesKey,i.hash,t.encryptType)},ve(this.dataInput(t),r,r.userPrivateKey,i.timestamp,i.hash)},httpInput(e,t,r){let i={...r};i.transaction_type=ke[t.apiName].transaction_type;let o=ke[t.apiName].nodeInput(t.apiName,t,i),a=he.rlp_encode(pe(t.apiName,o,w),!0);return t.data={encrypted_tx:he.sealSGXWithPassword(t.publicKey,a,t.aesKey,o.hash,t.encryptType)},{msg_type:n.MSG_TYPE_TX_REQ_CONFIDENTIAL_TX,sequence:r.sequence,transaction:Te(this.dataInput(t),r,r.userPrivateKey,o.timestamp,o.hash)}}}],Ie={},ke={};Ae.forEach(e=>{ke[e.name]=e,Ie[e.response_msg_type]=e}),he.decryptTXWithAES=function(e,t,r){if(!e)throw new Error("aes empty key or iv or tag!");const n=(e=he.hexToBuffer(e)).length,i=he.decryptAESTX(e.slice(258,n),he.generateAESKey(t,r));return ge(he.rlp_decode(i),w)},he.txTransform=function(e){return ge(he.rlp_decode(e),w)},he.receiptTransform=function(e){return ge(he.rlp_decode(e),E)},e.exports={...ke,requestTransform:function(e,t){const r=ke[e];if(!r)throw new Error(e+" is not api");return pe(e,t,r.request)},responseTransform:function(e){let t=parseInt(e[0],16);e[0]&&he.isBuffer(e[0])&&(t=parseInt(e[0].toString("hex"),16));const r=Ie[t];if(!r){if(e[0]&&e[0][0]){const t="Handshake",r=ge(e,a);return r.api=t,r}throw new Error('msg_type "'+t+'" is not error')}const n=r.name,i=ge(e,r.response);return i.api=n,i},dataTransform:de,eventDataFormat:function(e,t){switch(e){case"Account":return function(e){return ge(e,[[P]])}(t);case"Contract":return function(e){const t=ge(e,[[B]]);return t&&t.account?t.account:null}(t);case"Topics":return function(e){return ge(e,[[[d,{name:"data",type:"bytes"}]]])}(t);case"Block":return function(e){return ge(e,[[T]])}(t)}},getTxData:_e,httpOutput:function(e,t){return fe[e]?function e(t,r,n){if(he.isObject(t)){const n={};for(let i in t){const o=t[i],a=r[i];if(a)if(a.mapInfo){const t=a.mapInfo.key||{name:"key"},s=a.mapInfo.value||{name:"value"};if("array"===a.type){const c=[];for(let n in o){const i={};i[t.name]=e(n,r,t),i[s.name]=e(o[n],r,s),c.push(i)}n[a.name||i]=c}else{const c={};for(let n in o)c[t.name]=e(n,r,t),c[s.name]=e(o[n],r,s);n[a.name||i]=c}}else n[a.name||i]=e(o,r,a);else n[i]=o}return n}if(Array.isArray(t)){const i=[];let o=n;n&&"array"===n.type&&"one"===n.array_type&&(o=n[0]);for(let n=0;ne._pos){var o=r.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new n(o.length),s=0;se._pos&&(e.push(new n(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(r)}e._xhr.readyState===c.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,r(9),r(2).Buffer,r(7))},function(e,t,r){const n=r(12),i=r(284),o=r(329),a=r(345),s=function(e,t){const r=new i(e,e=>{"function"==typeof t&&t(e,r)},new o);return r};s.utils=n,s.SenderData=a,e.exports=s},function(e,t,r){const n=r(129),i=r(24),o=r(0).Buffer;e.exports={HEADER_LEN:16,makeTlsPacket(e){Array.isArray(e)&&(e=this._rlp_encode(e));const t=16+e.length,r=o.alloc(16);return r.writeInt32BE(t,0),r.writeInt16BE(2,4),r.writeInt8(51,6),r.writeInt8(119,7),r.writeInt32BE(0,8),r.writeInt32BE(0,12),o.concat([r,e],t)},getTotalLength:e=>e.readInt32BE(0),getTlsPacket(e,t){return{total_len:this.getTotalLength(e),version:e.readInt16BE(4),magic1:e.readInt8(6),magic2:e.readInt8(7),reserved1:e.readInt32BE(8),reserved2:e.readInt32BE(12),data:this.rlp_decode(t)}},_rlp_encode:e=>n.encode(e),rlp_encode(e,t){return i.bufferToHex(this._rlp_encode(e),t)},rlp_decode:e=>n.decode(e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4);function i(e,t){if("00"===e.slice(0,2))throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function o(t,r){if(t<56)return e.from([t+r]);var n=s(t),i=s(r+55+n.length/2);return e.from(i+n,"hex")}function a(e){return"0x"===e.slice(0,2)}function s(e){var t=e.toString(16);return t.length%2?"0"+t:t}function c(t){if(!e.isBuffer(t)){if("string"==typeof t)return a(t)?e.from((i="string"!=typeof(o=t)?o:a(o)?o.slice(2):o).length%2?"0"+i:i,"hex"):e.from(t);if("number"==typeof t)return t?(r=s(t),e.from(r,"hex")):e.from([]);if(null==t)return e.from([]);if(t instanceof Uint8Array)return e.from(t);if(n.isBN(t))return e.from(t.toArray());throw new Error("invalid type")}var r,i,o;return t}t.encode=function t(r){if(r instanceof Array){for(var n=[],i=0;ir.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(s=r.slice(o,l)).length)throw new Error("invalid rlp, List has a invalid length");for(;s.length;)c=t(s),u.push(c.data),s=c.remainder;return{data:u,remainder:r.slice(l)}}(c(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=c(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var o=n-246;return o+i(r.slice(1,o).toString("hex"),16)}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=u(e),n=r[0],a=r[1],s=new o(function(e,t,r){return 3*(t+r)/4-r}(0,n,a)),c=0,f=a>0?n-4:n,l=0;l>16&255,s[c++]=t>>8&255,s[c++]=255&t;2===a&&(t=i[e.charCodeAt(l)]<<2|i[e.charCodeAt(l+1)]>>4,s[c++]=255&t);1===a&&(t=i[e.charCodeAt(l)]<<10|i[e.charCodeAt(l+1)]<<4|i[e.charCodeAt(l+2)]>>2,s[c++]=t>>8&255,s[c++]=255&t);return s},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=h,f-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,c,u=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*c-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*b}},function(e,t){},function(e,t){var r,n,i,o=String.fromCharCode;function a(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function c(e,t){return o(e>>t&63|128)}function u(e){if(0==(4294967168&e))return o(e);var t="";return 0==(4294965248&e)?t=o(e>>6&31|192):0==(4294901760&e)?(s(e),t=o(e>>12&15|224),t+=c(e,6)):0==(4292870144&e)&&(t=o(e>>18&7|240),t+=c(e,12),t+=c(e,6)),t+=o(63&e|128)}function f(){if(i>=n)throw Error("Invalid byte index");var e=255&r[i];if(i++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}e.exports={version:"2.1.2",encode:function(e){for(var t=a(e),r=t.length,n=-1,i="";++n=128?u:224==(240&c)&&(u=(15&c)<<12|f()<<6|f())>=2048?(s(u),u):240==(248&c)&&(u=(7&c)<<18|f()<<12|f()<<6|f())>=65536&&u<=1114111?u:void 0));)l.push(t);return function(e){for(var t,r=e.length,n=-1,i="";++n65535&&(i+=o((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=o(t);return i}(l)}}},function(e,t,r){var n;e.exports=(n=r(3),function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),n.lib.WordArray)},function(e,t,r){var n;e.exports=(n=r(3),function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},r.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),n.enc.Utf16)},function(e,t,r){var n,i,o,a,s,c;e.exports=(n=r(3),r(67),o=(i=n).lib.WordArray,a=i.algo,s=a.SHA256,c=a.SHA224=s.extend({_doReset:function(){this._hash=new o.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=4,e}}),i.SHA224=s._createHelper(c),i.HmacSHA224=s._createHmacHelper(c),n.SHA224)},function(e,t,r){var n,i,o,a,s,c,u,f;e.exports=(n=r(3),r(37),r(68),o=(i=n).x64,a=o.Word,s=o.WordArray,c=i.algo,u=c.SHA512,f=c.SHA384=u.extend({_doReset:function(){this._hash=new s.init([new a.init(3418070365,3238371032),new a.init(1654270250,914150663),new a.init(2438529370,812702999),new a.init(355462360,4144912697),new a.init(1731405415,4290775857),new a.init(2394180231,1750603025),new a.init(3675008525,1694076839),new a.init(1203062813,3204075428)])},_doFinalize:function(){var e=u._doFinalize.call(this);return e.sigBytes-=16,e}}),i.SHA384=u._createHelper(f),i.HmacSHA384=u._createHmacHelper(f),n.SHA384)},function(e,t,r){var n;e.exports=(n=r(3), /** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=i.create([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]),c=i.create([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]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,v,w,E,S,T,A,I,k,R=this._hash.words,x=l.words,B=h.words,P=s.words,C=c.words,M=u.words,N=f.words;for(E=o=R[0],S=a=R[1],T=d=R[2],A=v=R[3],I=w=R[4],r=0;r<80;r+=1)k=o+e[t+P[r]]|0,k+=r<16?p(a,d,v)+x[0]:r<32?b(a,d,v)+x[1]:r<48?m(a,d,v)+x[2]:r<64?g(a,d,v)+x[3]:y(a,d,v)+x[4],k=(k=_(k|=0,M[r]))+w|0,o=w,w=v,v=_(d,10),d=a,a=k,k=E+e[t+C[r]]|0,k+=r<16?y(S,T,A)+B[0]:r<32?g(S,T,A)+B[1]:r<48?m(S,T,A)+B[2]:r<64?b(S,T,A)+B[3]:p(S,T,A)+B[4],k=(k=_(k|=0,N[r]))+I|0,E=I,I=A,A=_(T,10),T=S,S=k;k=R[1]+d+A|0,R[1]=R[2]+v+I|0,R[2]=R[3]+w+E|0,R[3]=R[4]+o+S|0,R[4]=R[0]+a+T|0,R[0]=k},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function b(e,t,r){return e&t|~e&r}function m(e,t,r){return(e|~t)^r}function g(e,t,r){return e&r|t&~r}function y(e,t,r){return e^(t|~r)}function _(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(Math),n.RIPEMD160)},function(e,t,r){var n,i,o,a,s,c,u,f,l;e.exports=(n=r(3),r(45),r(46),o=(i=n).lib,a=o.Base,s=o.WordArray,c=i.algo,u=c.SHA1,f=c.HMAC,l=c.PBKDF2=a.extend({cfg:a.extend({keySize:4,hasher:u,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=f.create(r.hasher,e),i=s.create(),o=s.create([1]),a=i.words,c=o.words,u=r.keySize,l=r.iterations;a.length>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var r=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var c=0;c>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)},function(e,t,r){var n;e.exports=(n=r(3),r(5),n.pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)},function(e,t,r){var n;e.exports=(n=r(3),r(5),n.pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)},function(e,t,r){var n;e.exports=(n=r(3),r(5),n.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},n.pad.ZeroPadding)},function(e,t,r){var n;e.exports=(n=r(3),r(5),n.pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)},function(e,t,r){var n,i,o,a;e.exports=(n=r(3),r(5),o=(i=n).lib.CipherParams,a=i.enc.Hex,i.format.Hex={stringify:function(e){return e.ciphertext.toString(a)},parse:function(e){var t=a.parse(e);return o.create({ciphertext:t})}},n.format.Hex)},function(e,t,r){var n;e.exports=(n=r(3),r(17),r(18),r(19),r(5),function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],a=[],s=[],c=[],u=[],f=[],l=[],h=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var b=e[r],m=e[b],g=e[m],y=257*e[p]^16843008*p;a[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,c[r]=y<<8|y>>>24,u[r]=y,y=16843009*g^65537*m^257*b^16843008*r,f[p]=y<<24|y>>>8,l[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,d[p]=y,r?(r=b^e[e[e[g^b]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],b=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[a/r|0]<<24),o[a]=o[a-r]^s}for(var c=this._invKeySchedule=[],u=0;u>>24]]^l[i[s>>>16&255]]^h[i[s>>>8&255]]^d[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,l,h,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var c=this._nRounds,u=e[t]^r[0],f=e[t+1]^r[1],l=e[t+2]^r[2],h=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^o[l>>>8&255]^a[255&h]^r[d++],m=n[f>>>24]^i[l>>>16&255]^o[h>>>8&255]^a[255&u]^r[d++],g=n[l>>>24]^i[h>>>16&255]^o[u>>>8&255]^a[255&f]^r[d++],y=n[h>>>24]^i[u>>>16&255]^o[f>>>8&255]^a[255&l]^r[d++];u=b,f=m,l=g,h=y}b=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[l>>>8&255]<<8|s[255&h])^r[d++],m=(s[f>>>24]<<24|s[l>>>16&255]<<16|s[h>>>8&255]<<8|s[255&u])^r[d++],g=(s[l>>>24]<<24|s[h>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^r[d++],y=(s[h>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&l])^r[d++],e[t]=b,e[t+1]=m,e[t+2]=g,e[t+3]=y},keySize:8});e.AES=t._createHelper(b)}(),n.AES)},function(e,t,r){var n;e.exports=(n=r(3),r(17),r(18),r(19),r(5),function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],f=c[o];for(r=0;r<24;r++)u[r/6|0]|=t[(s[r]-1+f)%28]<<31-r%6,u[4+(r/6|0)]|=t[28+(s[r+24]-1+f)%28]<<31-r%6;for(u[0]=u[0]<<1|u[0]>>>31,r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var l=this._invSubKeys=[];for(r=0;r<16;r++)l[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^i[c])&f[c])>>>0];this._lBlock=a,this._rBlock=o^s}var l=this._lBlock;this._lBlock=this._rBlock,this._rBlock=l,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var c=n[i];n[i]=n[o],n[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),n.RC4)},function(e,t,r){var n;e.exports=(n=r(3),r(17),r(18),r(19),r(5),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],a=[],s=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=u>>>16|4294901760&f,h=f<<16|65535&u;for(i[0]^=u,i[1]^=l,i[2]^=f,i[3]^=h,i[4]^=u,i[5]^=l,i[6]^=f,i[7]^=h,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),n.Rabbit)},function(e,t,r){var n;e.exports=(n=r(3),r(17),r(18),r(19),r(5),function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],a=[],s=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=u>>>16|4294901760&f,h=f<<16|65535&u;for(n[0]^=u,n[1]^=l,n[2]^=f,n[3]^=h,n[4]^=u,n[5]^=l,n[6]^=f,n[7]^=h,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),n.RabbitLegacy)},function(e,t,r){const n=r(70),i=r(44),o=r(24),a=r(0).Buffer,s=r(200),c=r(201),u=r(29),f=r(22),l=r(8),h=r(260),d=r(261),p=r(273),b=r(278),m=r(32),g=r(281),y=r(282);e.exports={getKeyInfo(e,t){if(t)return this.getKeyInfoFromPEM(e,t);if("string"!=typeof e)return;let r=o.toBuffer(e),i=n.publicKeyCreate(r,!1);return i.length>64&&(i=i.slice(1)),{privateKey:r,publicKey:i}},getKeyInfoFromPEM(e,t){let r=s(e,"EC PRIVATE KEY",t).pem;const n=new c(r,"pem");let i=n.d,o=n.publicCodePoint;return o.length>64&&(o=o.slice(1)),{privateKey:i,publicKey:o}},generateECKey(){let e,t=i.lib.WordArray.random(32);do{e=o.toBuffer(t.toString(i.enc.Hex))}while(!n.privateKeyVerify(e));let r=n.publicKeyCreate(e,!1);return r.length>64&&(r=r.slice(1)),{privateKey:e,publicKey:r}},sign(e,t){o.isBuffer(e)?32!==e.length&&(e=o.toBuffer(o.getHash(e))):e=o.isString(e)&&0===e.indexOf("0x")?o.toBuffer(e):o.toBuffer(o.getHash(e));const r=n.sign(e,t);return a.concat([r.signature,a.from([r.recovery])],65)},generateAESKey(e,t){if(!e||!t)throw new Error("aes password or tx hash is invalid"+e+"..."+t);if(o.isString(e)&&(e="0x"===e.substr(0,2)?a.from(e.substr(2),"hex"):a.from(e,"ascii")),!o.isBuffer(e))throw new Error("aes password is invalid");return t=o.hexToBuffer(t),l("sha256").update(a.concat([e,t])).digest().slice(0,16)},randomBytes(e){if("number"!=typeof e)throw new Error("param is not number.");return o.bufferToHex(m(e))},randomNumber:()=>m(4).readUInt32BE(0),sealSGXWithPassword(e,t,r,n,i){return i===y.ECIES?this.sealEccSGX(e,t,this.generateAESKey(r,n)):this.sealRsaSGX(e,t,this.generateAESKey(r,n))},sealRsaSGX(e,t,r){if(r||(r=m(16)),r=o.hexToBuffer(r),!e)throw new Error("rsa_pub_key is invalid");o.isString(e)&&-1===e.indexOf("PUBLIC KEY")&&("0x"===e.substr(0,2)&&(e=e.substr(2)),e=h.hextopem(e,"PUBLIC KEY"));let n=m(12),i=this.encryptAES(t,r,n),s=u.publicEncrypt(e,r);if(s.length<256){let e=a.alloc(256);s.copy(e,256-s.length),s=e}let c=new a(2);return c.writeUInt16BE(1),"0x"+a.concat([c,s,n,a.from(i.authTag,"hex"),a.from(i.data,"hex")]).toString("hex")},sealEccSGX(e,t,r){if(!e)throw new Error("ecc_pub_key is invalid");r||(r=m(16)),r=o.hexToBuffer(r);let n=m(12),i=this.encryptAES(t,r,n),s=a.from(i.authTag,"hex"),c=a.from(i.data,"hex"),u={iv:n};const f=b.formatter.pemToBin(e.toString());var l=a.from(f);e=l.slice(l.byteLength-65,l.byteLength),e=o.hexToBuffer(e);var h=g.encrypt(e,r,u);if(h.length<109){let e=a.alloc(109);h.copy(e,109-h.length),h=e}let d=new a(2);return d.writeUInt16BE(320),h=o.hexToBuffer(h),"0x"+a.concat([d,h,n,s,c]).toString("hex")},encryptAES(e,t,r){if(!t||!r)throw new Error("aes empty key or iv!");e=o.hexToBuffer(e),t=o.hexToBuffer(t);let n=f.createCipheriv("aes-128-gcm",t,r);n.setAutoPadding(!1);let i=n.update(e).toString("hex");return n.final(),{data:i,authTag:n.getAuthTag().toString("hex")}},decryptAES(e,t){if(!t||!e)throw new Error("aes empty key or data!");e=o.hexToBuffer(e),t=o.hexToBuffer(t);let r=e.length-16,n=e.length;const i=e.slice(r,n);r-=12,n-=16;const a=e.slice(r,n),s=e.slice(0,r);let c=f.createDecipheriv("aes-128-gcm",t,a);return c.setAuthTag(i),"0x"+c.update(s).toString("hex")},decryptAESWithIV(e,t,r,n){if(!t||!r||!n)throw new Error("aes empty key or iv or tag!");e=o.hexToBuffer(e),t=o.hexToBuffer(t),r=o.hexToBuffer(r),n=o.hexToBuffer(n);let i=f.createDecipheriv("aes-128-gcm",t,r);return i.setAuthTag(n),"0x"+i.update(e).toString("hex")},decryptAESWithPassword(e,t,r){return this.decryptAES(e,this.generateAESKey(t,r))},decryptAESTX(e,t){if(!t||!e)throw new Error("aes empty key or data!");e=o.hexToBuffer(e),t=o.hexToBuffer(t);let r=0,n=12;const i=e.slice(r,n);r+=12,n+=16;const a=e.slice(r,n);r+=16,n=e.length;const s=e.slice(r,n);let c=f.createDecipheriv("aes-128-gcm",t,i);return c.setAuthTag(a),"0x"+c.update(s).toString("hex")},bip39:d,HDKey:p}},function(e,t,r){"use strict";e.exports=r(158)(r(162))},function(e,t,r){"use strict";var n=r(159),i=r(160),o=r(71);function a(e,t){return void 0===e?t:(n.isBoolean(e,o.COMPRESSED_TYPE_INVALID),e)}e.exports=function(e){return{privateKeyVerify:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),32===t.length&&e.privateKeyVerify(t)},privateKeyExport:function(t,r){n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0);var s=e.privateKeyExport(t,r);return i.privateKeyExport(t,s,r)},privateKeyImport:function(t){if(n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),(t=i.privateKeyImport(t))&&32===t.length&&e.privateKeyVerify(t))return t;throw new Error(o.EC_PRIVATE_KEY_IMPORT_DER_FAIL)},privateKeyNegate:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyNegate(t)},privateKeyModInverse:function(t){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),e.privateKeyModInverse(t)},privateKeyTweakAdd:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakAdd(t,r)},privateKeyTweakMul:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),e.privateKeyTweakMul(t,r)},publicKeyCreate:function(t,r){return n.isBuffer(t,o.EC_PRIVATE_KEY_TYPE_INVALID),n.isBufferLength(t,32,o.EC_PRIVATE_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyCreate(t,r)},publicKeyConvert:function(t,r){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),r=a(r,!0),e.publicKeyConvert(t,r)},publicKeyVerify:function(t){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),e.publicKeyVerify(t)},publicKeyTweakAdd:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakAdd(t,r,i)},publicKeyTweakMul:function(t,r,i){return n.isBuffer(t,o.EC_PUBLIC_KEY_TYPE_INVALID),n.isBufferLength2(t,33,65,o.EC_PUBLIC_KEY_LENGTH_INVALID),n.isBuffer(r,o.TWEAK_TYPE_INVALID),n.isBufferLength(r,32,o.TWEAK_LENGTH_INVALID),i=a(i,!0),e.publicKeyTweakMul(t,r,i)},publicKeyCombine:function(t,r){n.isArray(t,o.EC_PUBLIC_KEYS_TYPE_INVALID),n.isLengthGTZero(t,o.EC_PUBLIC_KEYS_LENGTH_INVALID);for(var i=0;i=r)throw RangeError(n)}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(161),o=n.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a=n.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(e,t,r){var i=n.from(r?o:a);return e.copy(i,r?8:9),t.copy(i,r?181:214),i},t.privateKeyImport=function(e){var t=e.length,r=0;if(!(t2||t1?e[r+n-2]<<8:0);if(!(t<(r+=n)+i||t32||t1&&0===t[o]&&!(128&t[o+1]);--r,++o);for(var a=n.concat([n.from([0]),e.s]),s=33,c=0;s>1&&0===a[c]&&!(128&a[c+1]);--s,++c);return i.encode(t.slice(o),a.slice(c))},t.signatureImport=function(e){var t=n.alloc(32,0),r=n.alloc(32,0);try{var o=i.decode(e);if(33===o.r.length&&0===o.r[0]&&(o.r=o.r.slice(1)),o.r.length>32)throw new Error("R length is too long");if(33===o.s.length&&0===o.s[0]&&(o.s=o.s.slice(1)),o.s.length>32)throw new Error("S length is too long")}catch(e){return}return o.r.copy(t,32-o.r.length),o.s.copy(r,32-o.s.length),{r:t,s:r}},t.signatureImportLax=function(e){var t=n.alloc(32,0),r=n.alloc(32,0),i=e.length,o=0;if(48===e[o++]){var a=e[o++];if(!(128&a&&(o+=a-128)>i)&&2===e[o++]){var s=e[o++];if(128&s){if(o+(a=s-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(s=0;a>0;o+=1,a-=1)s=(s<<8)+e[o]}if(!(s>i-o)){var c=o;if(o+=s,2===e[o++]){var u=e[o++];if(128&u){if(o+(a=u-128)>i)return;for(;a>0&&0===e[o];o+=1,a-=1);for(u=0;a>0;o+=1,a-=1)u=(u<<8)+e[o]}if(!(u>i-o)){var f=o;for(o+=u;s>0&&0===e[c];s-=1,c+=1);if(!(s>32)){var l=e.slice(c,c+s);for(l.copy(t,32-l.length);u>0&&0===e[f];u-=1,f+=1);if(!(u>32)){var h=e.slice(f,f+u);return h.copy(r,32-h.length),{r:t,s:r}}}}}}}}}},function(e,t,r){var n=r(0).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}}},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(8),o=r(4),a=r(6).ec,s=r(71),c=new a("secp256k1"),u=c.curve;function f(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new o(t);if(r.cmp(u.p)>=0)return null;var n=(r=r.toRed(u.red)).redSqr().redIMul(r).redIAdd(u.b).redSqrt();return 3===e!==n.isOdd()&&(n=n.redNeg()),c.keyPair({pub:{x:r,y:n}})}(t,e.slice(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var n=new o(t),i=new o(r);if(n.cmp(u.p)>=0||i.cmp(u.p)>=0)return null;if(n=n.toRed(u.red),i=i.toRed(u.red),(6===e||7===e)&&i.isOdd()!==(7===e))return null;var a=n.redSqr().redIMul(n);return i.redSqr().redISub(a.redIAdd(u.b)).isZero()?c.keyPair({pub:{x:n,y:i}}):null}(t,e.slice(1,33),e.slice(33,65));default:return null}}t.privateKeyVerify=function(e){var t=new o(e);return t.cmp(u.n)<0&&!t.isZero()},t.privateKeyExport=function(e,t){var r=new o(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_EXPORT_DER_FAIL);return n.from(c.keyFromPrivate(e).getPublic(t,!0))},t.privateKeyNegate=function(e){var t=new o(e);return t.isZero()?n.alloc(32):u.n.sub(t).umod(u.n).toArrayLike(n,"be",32)},t.privateKeyModInverse=function(e){var t=new o(e);if(t.cmp(u.n)>=0||t.isZero())throw new Error(s.EC_PRIVATE_KEY_RANGE_INVALID);return t.invm(u.n).toArrayLike(n,"be",32)},t.privateKeyTweakAdd=function(e,t){var r=new o(t);if(r.cmp(u.n)>=0)throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);if(r.iadd(new o(e)),r.cmp(u.n)>=0&&r.isub(u.n),r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_ADD_FAIL);return r.toArrayLike(n,"be",32)},t.privateKeyTweakMul=function(e,t){var r=new o(t);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PRIVATE_KEY_TWEAK_MUL_FAIL);return r.imul(new o(e)),r.cmp(u.n)&&(r=r.umod(u.n)),r.toArrayLike(n,"be",32)},t.publicKeyCreate=function(e,t){var r=new o(e);if(r.cmp(u.n)>=0||r.isZero())throw new Error(s.EC_PUBLIC_KEY_CREATE_FAIL);return n.from(c.keyFromPrivate(e).getPublic(t,!0))},t.publicKeyConvert=function(e,t){var r=f(e);if(null===r)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return n.from(r.getPublic(t,!0))},t.publicKeyVerify=function(e){return null!==f(e)},t.publicKeyTweakAdd=function(e,t,r){var i=f(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(u.n)>=0)throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);var a=u.g.mul(t).add(i.pub);if(a.isInfinity())throw new Error(s.EC_PUBLIC_KEY_TWEAK_ADD_FAIL);return n.from(a.encode(!0,r))},t.publicKeyTweakMul=function(e,t,r){var i=f(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);if((t=new o(t)).cmp(u.n)>=0||t.isZero())throw new Error(s.EC_PUBLIC_KEY_TWEAK_MUL_FAIL);return n.from(i.pub.mul(t).encode(!0,r))},t.publicKeyCombine=function(e,t){for(var r=new Array(e.length),i=0;i=0||r.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);var i=n.from(e);return 1===r.cmp(c.nh)&&u.n.sub(r).toArrayLike(n,"be",32).copy(i,32),i},t.signatureExport=function(e){var t=e.slice(0,32),r=e.slice(32,64);if(new o(t).cmp(u.n)>=0||new o(r).cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);return{r:t,s:r}},t.signatureImport=function(e){var t=new o(e.r);t.cmp(u.n)>=0&&(t=new o(0));var r=new o(e.s);return r.cmp(u.n)>=0&&(r=new o(0)),n.concat([t.toArrayLike(n,"be",32),r.toArrayLike(n,"be",32)])},t.sign=function(e,t,r,i){if("function"==typeof r){var a=r;r=function(r){var c=a(e,t,null,i,r);if(!n.isBuffer(c)||32!==c.length)throw new Error(s.ECDSA_SIGN_FAIL);return new o(c)}}var f=new o(t);if(f.cmp(u.n)>=0||f.isZero())throw new Error(s.ECDSA_SIGN_FAIL);var l=c.sign(e,t,{canonical:!0,k:r,pers:i});return{signature:n.concat([l.r.toArrayLike(n,"be",32),l.s.toArrayLike(n,"be",32)]),recovery:l.recoveryParam}},t.verify=function(e,t,r){var n={r:t.slice(0,32),s:t.slice(32,64)},i=new o(n.r),a=new o(n.s);if(i.cmp(u.n)>=0||a.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);if(1===a.cmp(c.nh)||i.isZero()||a.isZero())return!1;var l=f(r);if(null===l)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);return c.verify(e,n,{x:l.pub.x,y:l.pub.y})},t.recover=function(e,t,r,i){var a={r:t.slice(0,32),s:t.slice(32,64)},f=new o(a.r),l=new o(a.s);if(f.cmp(u.n)>=0||l.cmp(u.n)>=0)throw new Error(s.ECDSA_SIGNATURE_PARSE_FAIL);try{if(f.isZero()||l.isZero())throw new Error;var h=c.recoverPubKey(e,a,r);return n.from(h.encode(!0,i))}catch(e){throw new Error(s.ECDSA_RECOVER_FAIL)}},t.ecdh=function(e,r){var n=t.ecdhUnsafe(e,r,!0);return i("sha256").update(n).digest()},t.ecdhUnsafe=function(e,t,r){var i=f(e);if(null===i)throw new Error(s.EC_PUBLIC_KEY_PARSE_FAIL);var a=new o(t);if(a.cmp(u.n)>=0||a.isZero())throw new Error(s.ECDH_FAIL);return n.from(i.pub.mul(a).encode(!0,r))}},function(e,t){},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(165);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(167),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,c=1,u={},f=!1,l=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){p(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var d=~~(h/20),p=0|((t=n)<<5|t>>>27)+f(d,i,o,s)+c+r[h]+a[d];c=s,s=o,o=u(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,r){var n=r(1),i=r(20),o=r(0).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function u(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),b=u(n)+l(p,i,o,s)+c+r[d]+a[p]|0;c=s,s=o,o=f(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},function(e,t,r){var n=r(1),i=r(77),o=r(20),a=r(0).Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},function(e,t,r){var n=r(1),i=r(78),o=r(20),a=r(0).Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},function(e){e.exports={name:"elliptic",version:"6.4.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},__npminstall_done:"Fri Mar 08 2019 14:24:57 GMT+0800 (GMT+08:00)",_from:"elliptic@6.4.1",_resolved:"http://registry.npm.alibaba-inc.com/elliptic/download/elliptic-6.4.1.tgz"}},function(e,t,r){"use strict";var n=t,i=r(4),o=r(10),a=r(79);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t){for(var r=[],n=1<=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,c=1;c0||t.cmpn(-i)>0;){var o,a,s,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),o=0==(1&c)?0:3!=(s=e.andln(7)+n&7)&&5!==s||2!==u?c:-c,r[0].push(o),a=0==(1&u)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==c?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t){},function(e,t,r){"use strict";var n=r(4),i=r(6).utils,o=i.getNAF,a=i.getJSF,s=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1),i=(1<=c;t--)u=(u<<1)+n[t];a.push(u)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=i;h>0;h--){for(c=0;c=0;u--){for(t=0;u>=0&&0===a[u];u--)t++;if(u>=0&&t++,c=c.dblp(t),u<0)break;var f=a[u];s(0!==f),c="affine"===e.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){for(var s=this._wnafT1,c=this._wnafT2,u=this._wnafT3,f=0,l=0;l=1;l-=2){var d=l-1,p=l;if(1===s[d]&&1===s[p]){var b=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(b[1]=t[d].add(t[p]),b[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(b[1]=t[d].toJ().mixedAdd(t[p]),b[2]=t[d].add(t[p].neg())):(b[1]=t[d].toJ().mixedAdd(t[p]),b[2]=t[d].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[d],r[p]);f=Math.max(g[0].length,f),u[d]=new Array(f),u[p]=new Array(f);for(var y=0;y=0;l--){for(var S=0;l>=0;){var T=!0;for(y=0;y=0&&S++,w=w.dblp(S),l<0)break;for(y=0;y0?A=c[y][I-1>>1]:I<0&&(A=c[y][-I-1>>1].neg()),w="affine"===A.type?w.mixedAdd(A):w.add(A))}}for(l=0;l=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(a=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:i},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new o(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(l,s.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),l=n.redMul(u),h=c.redSqr().redIAdd(f).redISub(l).redISub(l),d=c.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),l=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(l)).redISub(i.redMul(u)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(40),i=r(4),o=r(1),a=n.base,s=r(6).utils;function c(e){a.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(c,a),e.exports=c,c.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},o(u,a.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},c.prototype.point=function(e,t){return new u(this,e,t)},c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(40),i=r(6),o=r(4),a=r(1),s=n.base,c=i.utils.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new o(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,r,n,i){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new o(t,16),this.y=new o(r,16),this.z=n?new o(n,16):this.curve.one,this.t=i&&new o(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}a(u,s),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(i.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(t&&!c||!t&&c)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new o(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(i.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},a(f,s.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new f(this,e,t,r,n)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(c,u,l,f)},f.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(u=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(u.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),c=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(c),t=a.redMul(u.redSub(o)),r=a.redMul(c)}}else{var u=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),c=u.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(u)).redMul(c),t=this.curve._mulC(u).redMul(i.redISub(o)),r=u.redMul(c)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),l=o.redMul(c),h=a.redMul(s);return this.curve.point(u,f,h,l)},f.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(l,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},function(e,t,r){"use strict";var n,i=t,o=r(53),a=r(6),s=a.utils.assert;function c(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(192)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){"use strict";t.sha1=r(187),t.sha224=r(188),t.sha256=r(82),t.sha384=r(189),t.sha512=r(83)},function(e,t,r){"use strict";var n=r(13),i=r(27),o=r(81),a=n.rotl32,s=n.sum32,c=n.sum32_5,u=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return s.iaddn(1),this.keyFromPrivate(s)}},u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),f=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),h=0;;h++){var d=o.k?o.k(h):new n(f.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(l)>=0)){var p=this.g.mul(d);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=d.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new c({r:m,s:g,recoveryParam:y})}}}}}},u.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new c(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),f=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(f,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},u.prototype.recoverPubKey=function(e,t,r,i){a((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var o=this.n,s=new n(e),u=t.r,f=t.s,l=1&r,h=r>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");u=h?this.curve.pointFromX(u.add(this.curve.n),l):this.curve.pointFromX(u,l);var d=t.r.invm(o),p=o.sub(s).mul(d).umod(o),b=f.mul(d).umod(o);return this.g.mulAdd(p,u,b)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(53),i=r(79),o=r(10);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(e,t,r){"use strict";var n=r(4),i=r(6).utils,o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(c(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=c(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var u=c(e,r);if(e.length!==u+r.place)return!1;var f=e.slice(r.place,u+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(53),i=r(6),o=i.utils,a=o.assert,s=o.parseBytes,c=r(198),u=r(199);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;ti)throw new TypeError("Invalid private key size: expected "+i+" gotten "+a.length);var s=l(n,r.publicKey.data);return s.d=a,s}function d(e){var t=f.decode(e,"der");return l(t.algorithmIdentifier.parameters,t.publicKey.data)}const p=/-+BEGIN EC PRIVATE KEY-+([\s\S]+)-+END EC PRIVATE KEY-+/m,b=/-+BEGIN PRIVATE KEY-+([\s\S]*)-+END PRIVATE KEY-+/m,m=/-+BEGIN PUBLIC KEY-+([\s\S]*)-+END PUBLIC KEY-+/m;function g(e){if("string"!=typeof e)throw new TypeError("PEM must be a string");var t=null;if(t=e.match(p))return function(e){var t=c.decode(e,"der"),r=o[t.parameters],n=t.privateKey;if(n.length>r)throw new TypeError("Invalid private key size: expected "+r+" gotten "+n.length);var i=l(t.parameters,t.publicKey.data);return i.d=n,i}(new i(t[1].replace(/[\s-]/gm,""),"base64"));if(t=e.match(b))return h(new i(t[1].replace(/[\s-]/gm,""),"base64"));if(t=e.match(m))return d(new i(t[1].replace(/[\s-]/gm,""),"base64"));throw new TypeError("Unrecognized PEM key structure")}function y(e,t){if(!(this instanceof y))return new y(e,t);var r,n,c,u,f;if(t||(t="pem"),i.isBuffer(e))if("pem"==t)r=(p=g(e.toString("ascii"))).c,c=p.x,u=p.y,n=p.d;else if("pkcs8"==t||"rfc5208"==t){r=(p=h(e)).c,c=p.x,u=p.y,n=p.d}else{if("spki"!=t&&"rfc5280"!=t)throw new TypeError('Unknown format for EC Key "'+t+'"');r=(p=d(e)).c,c=p.x,u=p.y,n=p.d}else if("string"==typeof e){if("pem"==t)r=(p=g(e)).c,c=p.x,u=p.y,n=p.d;else if("pkcs8"==t||"rfc5208"==t){r=(p=h(new i(e,"base64"))).c,c=p.x,u=p.y,n=p.d}else{if("spki"!=t&&"rfc5280"!=t)throw new TypeError('Unknown format for EC Key "'+t+'"');r=(p=d(new i(e,"base64"))).c,c=p.x,u=p.y,n=p.d}}else{if(!(f=e)||f.constructor!==Object)throw new TypeError("Unrecognized format for EC key");if("string"==typeof e.curve?r=e.curve:"string"==typeof e.crv&&(r=s[e.crv]||e.crv),i.isBuffer(e.privateKey)?n=e.privateKey:"string"==typeof e.privateKey?n=new i(e.privateKey,"base64"):i.isBuffer(e.d)?n=e.d:"string"==typeof e.d&&(n=new i(e.d,"base64")),i.isBuffer(e.publicKey)){var p=l(r,e.publicKey);c=p.x,u=p.y}else if("string"==typeof e.publicKey){p=l(r,new i(e.publicKey,"base64"));c=p.x,u=p.y}else i.isBuffer(e.x)?c=e.x:"string"==typeof e.x&&(c=new i(e.x,"base64")),i.isBuffer(e.y)?u=e.y:"string"==typeof e.y&&(u=new i(e.y,"base64"))}if(!r)throw new TypeError("EC Key curve not specified");if(!c||!u)throw new TypeError("Public EC Key point unavailable");var b=o[r];if(!b)throw new TypeError('EC Key curve "'+r+'" invalid');if(c.length!=b)throw new TypeError("Public EC Key point X of wrong length");if(u.length!=b)throw new TypeError("Public EC Key point Y of wrong length");if(n&&u.length!=b)throw new TypeError("Private EC Key of wrong length");Object.defineProperties(this,{curve:{enumerable:!0,configurable:!1,value:r},isPrivateECKey:{enumerable:!0,configurable:!1,value:null!=n},x:{enumerable:!0,configurable:!1,get:function(){return new i(c)}},y:{enumerable:!0,configurable:!1,get:function(){return new i(u)}},jsonCurve:{enumerable:!1,configurable:!1,value:a[r]},publicCodePoint:{enumerable:!1,configurable:!1,get:function(){return i.concat([new i([4]),c,u])}}}),n&&Object.defineProperty(this,"d",{enumerable:!0,configurable:!1,get:function(){return new i(n)}})}y.prototype.asPublicECKey=function(){return this.isPrivateECKey?new y({curve:this.curve,x:this.x,y:this.y}):this},y.prototype.toBuffer=function(e){if(e||(e="pem"),"pem"==e)return new i(this.toString("pem"),"ascii");if(this.isPrivateECKey){for(var t=this.d;0==t[0];)t=t.slice(1);if("pkcs8"==e||"rfc5208"==e)return u.encode({version:0,algorithmIdentifier:{privateKeyType:"EC",parameters:this.curve},privateKey:c.encode({version:1,privateKey:t,publicKey:{data:this.publicCodePoint}},"der")},"der");if("rfc5915"==e)return c.encode({version:1,privateKey:t,parameters:this.curve,publicKey:{data:this.publicCodePoint}},"der");throw new TypeError('Unknown format for private key "'+e+'"')}if("spki"==e||"rfc5280"==e)return f.encode({algorithmIdentifier:{publicKeyType:"EC",parameters:this.curve},publicKey:{data:this.publicCodePoint}},"der");throw new TypeError('Unknown format for public key "'+e+'"')},y.prototype.toString=function(e){if(e||(e="pem"),this.isPrivateECKey){if("pem"==e)return"-----BEGIN PRIVATE KEY-----\n"+this.toBuffer("pkcs8").toString("base64").match(/.{1,64}/g).join("\n")+"\n-----END PRIVATE KEY-----\n";if("rfc5915"==e)return"-----BEGIN EC PRIVATE KEY-----\n"+this.toBuffer("rfc5915").toString("base64").match(/.{1,64}/g).join("\n")+"\n-----END EC PRIVATE KEY-----\n";if("pkcs8"==e||"rfc5208"==e)return this.toBuffer("pkcs8").toString("base64");if("spki"==e||"rfc5280"==e)return this.toBuffer("spki").toString("base64");throw new TypeError('Unknown format for private key "'+e+'"')}if("pem"==e)return"-----BEGIN PUBLIC KEY-----\n"+this.toBuffer("spki").toString("base64").match(/.{1,64}/g).join("\n")+"\n-----END PUBLIC KEY-----\n";if("spki"==e||"rfc5280"==e)return this.toBuffer("spki").toString("base64");throw new TypeError('Unknown format for public key "'+e+'"')},y.prototype.toJSON=function(){function e(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}var t={kty:"EC",crv:a[this.curve],x:e(this.x),y:e(this.y)},r=this.d;if(r){var n=o[this.curve];if(r.lengthr-h-2)throw new Error("message too long");var d=l.alloc(r-n-h-2),p=r-f-1,b=i(f),m=s(l.concat([u,d,l.alloc(1,1),t],p),a(b,p)),g=s(b,a(m,f));return new c(l.concat([l.alloc(1),g,m],r))}(p,t);else if(1===h)d=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?l.alloc(a-o-3,255):function(e){var t,r=l.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n=0)throw new Error("data too long for modulus")}return r?f(d,p):u(d,p)}},function(e,t,r){"use strict";var n=r(21);t.certificate=r(213);var i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});t.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});t.PublicKey=a;var s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),c=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});t.PrivateKey=c;var u=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});t.EncryptedPrivateKey=u;var f=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});t.DSAPrivateKey=f,t.DSAparam=n.define("DSAparam",function(){this.int()});var l=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});t.ECPrivateKey=l;var h=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});t.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},function(e,t,r){"use strict";var n=r(21),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),c=n.define("RelativeDistinguishedName",function(){this.setof(o)}),u=n.define("RDNSequence",function(){this.seqof(c)}),f=n.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),l=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),h=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(f),this.key("validity").use(l),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});e.exports=p},function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,a=r(30),s=r(22);const c=r(0).Buffer;e.exports=function(e,t){var r,u=e.toString(),f=u.match(n);if(f){var l="aes"+f[1],h=new c(f[2],"hex"),d=new c(f[3].replace(/[\r\n]/g,""),"base64"),p=a(t,h.slice(0,8),parseInt(f[1],10)).key,b=[],m=s.createDecipheriv(l,p,h);b.push(m.update(d)),b.push(m.final()),r=c.concat(b)}else{var g=u.match(o);r=new c(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(i)[1],data:r}}},function(e,t,r){var n=r(54),i=r(93),o=r(0).Buffer,a=r(94),s=r(15),c=r(41),u=r(30);function f(e,t,r){s.call(this),this._cache=new h,this._cipher=new c.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(1)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function d(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new f(s.module,t,r)}f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=o.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(93),i=r(0).Buffer,o=r(54),a=r(94),s=r(15),c=r(41),u=r(30);function f(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new c.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function h(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new f(s.module,t,r)}r(1)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(t,!1,r.key,r.iv);return h(e,n.key,n.iv)},t.createDecipheriv=h},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(23),t.createHash=t.Hash=r(8),t.createHmac=t.Hmac=r(42);var n=r(226),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(97);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(228);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var c=r(236);t.DiffieHellmanGroup=c.DiffieHellmanGroup,t.createDiffieHellmanGroup=c.createDiffieHellmanGroup,t.getDiffieHellman=c.getDiffieHellman,t.createDiffieHellman=c.createDiffieHellman,t.DiffieHellman=c.DiffieHellman;var u=r(239);t.createSign=u.createSign,t.Sign=u.Sign,t.createVerify=u.createVerify,t.Verify=u.Verify,t.createECDH=r(254);var f=r(255);t.publicEncrypt=f.publicEncrypt,t.privateEncrypt=f.privateEncrypt,t.publicDecrypt=f.publicDecrypt,t.privateDecrypt=f.privateDecrypt;var l=r(258);t.randomFill=l.randomFill,t.randomFillSync=l.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t,r){"use strict";var n=r(1),i=r(0).Buffer,o=r(15),a=i.alloc(128),s=64;function c(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var o=0,a=0,s=n.length>>>1,c=0;c>>n[c]&1;for(c=s;c>>n[c]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,e.keys,o)}},u.prototype._update=function(e,t,r,n){var i=this._desState,o=a.readUInt32BE(e,t),s=a.readUInt32BE(e,t+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,o=h}a.rip(s,o,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var o=r,s=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],f=e.keys[c+1];a.expand(o,e.tmp,0),u^=e.tmp[0],f^=e.tmp[1];var l=a.substitute(u,f),h=o;o=(s^a.permute(l))>>>0,s=h}a.rip(o,s,n,i)}},function(e,t,r){"use strict";var n=r(10),i=r(1),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t0&&r.ishrn(n),r}function l(e,r,i){var o,a;do{for(o=new t(0);8*o.length=t)throw new Error("invalid sig")}e.exports=function(e,r,c,u,f){var l=o(c);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,r,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,a=r.data.q,c=r.data.g,u=r.data.pub_key,f=o.signature.decode(e,"der"),l=f.s,h=f.r;s(l,a),s(h,a);var d=n.mont(i),p=l.invm(a);return 0===c.toRed(d).redPow(new n(t).mul(p).mod(a)).fromRed().mul(u.toRed(d).redPow(h.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(h)}(e,r,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");r=t.concat([f,r]);for(var h=l.modulus.byteLength(),d=[1],p=0;r.length+d.length+2r-h-2)throw new Error("message too long");var d=l.alloc(r-n-h-2),p=r-f-1,b=i(f),m=s(l.concat([u,d,l.alloc(1,1),t],p),a(b,p)),g=s(b,a(m,f));return new c(l.concat([l.alloc(1),g,m],r))}(p,t);else if(1===h)d=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?l.alloc(a-o-3,255):function(e){var t,r=l.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n=0)throw new Error("data too long for modulus")}return r?f(d,p):u(d,p)}},function(e,t,r){var n=r(43),i=r(108),o=r(109),a=r(4),s=r(57),c=r(8),u=r(110),f=r(0).Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var h,d=n(e),p=d.modulus.byteLength();if(t.length>p||new a(t).cmp(d.modulus)>=0)throw new Error("decryption error");h=r?u(new a(t),d):s(t,d);var b=f.alloc(p-h.length);if(h=f.concat([b,h],p),4===l)return function(e,t){var r=e.modulus.byteLength(),n=c("sha1").update(f.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),u=t.slice(a+1),l=o(s,i(u,a)),h=o(u,i(l,r-a-1));if(function(e,t){e=f.from(e),t=f.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,h,r);if(3===l)return h;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,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(0),a=r(23),s=o.Buffer,c=o.kMaxLength,u=e.crypto||e.msCrypto,f=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>f||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function h(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>f||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>c)throw new RangeError("buffer too small")}function d(e,t,r,i){if(n.browser){var o=e.buffer,s=new Uint8Array(o,t,r);return u.getRandomValues(s),i?void n.nextTick(function(){i(null,e)}):e}if(!i)return a(r).copy(e,t),e;a(r,function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)})}u&&u.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(r,t.length),h(n,r,t.length),d(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(r,t.length),void 0===n&&(n=t.length-r);return h(n,r,t.length),d(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(7),r(9))},function(e,t,r){var n=r(89),i=r(111),o=r(112),a=r(4),s=r(114),c=r(8),u=r(113),f=r(0).Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var h,d=n(e),p=d.modulus.byteLength();if(t.length>p||new a(t).cmp(d.modulus)>=0)throw new Error("decryption error");h=r?u(new a(t),d):s(t,d);var b=f.alloc(p-h.length);if(h=f.concat([b,h],p),4===l)return function(e,t){var r=e.modulus.byteLength(),n=c("sha256").update(f.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),u=t.slice(a+1),l=o(s,i(u,a)),h=o(u,i(l,r-a-1));if(function(e,t){e=f.from(e),t=f.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,h,r);if(3===l)return h;throw new Error("unknown padding")}},function(e,t){ /** * @fileOverview * @name base64x-1.1.js * @author Kenji Urushima kenji.urushima@gmail.com * @version jsrsasign 8.0.12 base64x 1.1.14 (2018-Apr-22) * @since jsrsasign 2.1 * @license MIT License */ e.exports={hextopem:(e,t)=>"-----BEGIN "+t+"-----\r\n"+function(e){return function(e){var t,i,o="";for(t=0;t+3<=e.length;t+=3)i=parseInt(e.substring(t,t+3),16),o+=r.charAt(i>>6)+r.charAt(63&i);t+1==e.length?(i=parseInt(e.substring(t,t+1),16),o+=r.charAt(i<<2)):t+2==e.length&&(i=parseInt(e.substring(t,t+2),16),o+=r.charAt(i>>2)+r.charAt((3&i)<<4));if(n)for(;(3&o.length)>0;)o+=n;return o}(e)} /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/ */(e).replace(/(.{64})/g,"$1\r\n").replace(/\r\n$/,"")+"\r\n-----END "+t+"-----\r\n"};var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="="},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8),i=r(0).Buffer,o=r(262),a=r(32),s=r(116);let c=s._default;const u="Invalid mnemonic",f="Invalid entropy",l="Invalid mnemonic checksum",h="A wordlist is required but a default could not be found.\nPlease explicitly pass a 2048 word array explicitly.";function d(e,t,r){for(;e.lengthd(e.toString(2),"0",8)).join("")}function m(e){const t=8*e.length/32;return b([...n("sha256").update(e).digest()]).slice(0,t)}function g(e,t){if(!(t=t||c))throw new Error(h);const r=(e||"").split(" ");if(r.length%3!=0)throw new Error(u);const n=r.map(e=>{const r=t.indexOf(e);if(-1===r)throw new Error(u);return d(r.toString(2),"0",11)}).join(""),o=32*Math.floor(n.length/33),a=n.slice(0,o),s=n.slice(o),b=a.match(/(.{1,8})/g).map(p);if(b.length<16)throw new Error(f);if(b.length>32)throw new Error(f);if(b.length%4!=0)throw new Error(f);const g=i.from(b);if(m(g)!==s)throw new Error(l);return g.toString("hex")}function y(e,t){if(i.isBuffer(e)||(e=i.from(e,"hex")),!(t=t||c))throw new Error(h);if(e.length<16)throw new TypeError(f);if(e.length>32)throw new TypeError(f);if(e.length%4!=0)throw new TypeError(f);const r=(b([...e])+m(e)).match(/(.{1,11})/g).map(e=>{const r=p(e);return t[r]});return"あいこくしん"===t[0]?r.join(" "):r.join(" ")}t.mnemonicToSeedSync=function(e,t){const r=i.from(e||"","utf8"),n=i.from(function(e){return"mnemonic"+(e||"")}(t||""),"utf8");return o.pbkdf2Sync(r,n,2048,64,"sha512")},t.mnemonicToEntropy=g,t.entropyToMnemonic=y,t.generateMnemonic=function(e,t,r){if((e=e||128)%32!=0)throw new TypeError(f);return y((t=t||a)(e/8),r)},t.validateMnemonic=function(e,t){try{g(e,t)}catch(e){return!1}return!0},t.setDefaultWordlist=function(e){const t=s.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');c=t},t.getDefaultWordlist=function(){if(!c)throw new Error("No Default Wordlist set");return Object.keys(s.wordlists).filter(e=>"JA"!==e&&"EN"!==e&&s.wordlists[e].every((e,t)=>e===c[t]))[0]};var _=r(116);t.wordlists=_.wordlists},function(e,t,r){var n=r(115),i=r(55);if(i.pbkdf2Sync&&-1!==i.pbkdf2Sync.toString().indexOf("keylen, digest"))t.pbkdf2Sync=function(e,t,r,o,a){return n(e,t,r,o),a=a||"sha1",i.pbkdf2Sync(e,t,r,o,a)};else{const e=r(263);i.pbkdf2Sync=e,t.pbkdf2Sync=e}},function(e,t,r){var n={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20},i=r(42),o=r(115),a="utf-8",s=r(0).Buffer;e.exports=function(e,t,r,c,u){o(e,t,r,c),s.isBuffer(e)||(e=s.from(e,a)),s.isBuffer(t)||(t=s.from(t,a)),u=u||"sha1";var f=s.allocUnsafe(c),l=s.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);for(var h=0,d=n[u],p=Math.ceil(c/d),b=1;b<=p;b++){l.writeUInt32BE(b,t.length);for(var m=i(u,e).update(l).digest(),g=m,y=1;y1&&"'"===e[e.length-1],i=parseInt(e,10);n&&(i+=2147483648),r=r.deriveChild(i)}}),r},f.prototype.deriveChild=function(e){var t,r=e>=2147483648,o=n.allocUnsafe(4);if(o.writeUInt32BE(e,0),r){var s=this.privateKey,c=n.alloc(1,0);s=n.concat([c,s]),t=n.concat([s,o])}else t=n.concat([this.publicKey,o]);var u=i.createHmac("sha512",this.chainCode).update(t).digest(),l=u.slice(0,32),h=u.slice(32),d=new f(this.versions);if(this.privateKey)try{d.privateKey=a.privateKeyTweakAdd(this.privateKey,l)}catch(t){return this.derive(e+1)}else try{d.publicKey=a.publicKeyTweakAdd(this.publicKey,l,!0)}catch(t){return this.derive(e+1,r)}return d.chainCode=h,d.depth=this.depth+1,d.parentFingerprint=this.fingerprint,d.index=e,d},f.prototype.sign=function(e){return a.sign(e,this.privateKey).signature},f.prototype.verify=function(e,t){return a.verify(e,t,this.publicKey)},f.prototype.wipePrivateData=function(){return this._privateKey&&i.randomBytes(this._privateKey.length).copy(this._privateKey),this._privateKey=null,this},f.prototype.toJSON=function(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}},f.fromMasterSeed=function(e,t){var r=i.createHmac("sha512",s).update(e).digest(),n=r.slice(0,32),o=r.slice(32),a=new f(t);return a.chainCode=o,a.privateKey=n,a},f.fromExtendedKey=function(e,t){var r=new f(t=t||u),n=o.decode(e);n.readUInt32BE(0);r.depth=n.readUInt8(4),r.parentFingerprint=n.readUInt32BE(5),r.index=n.readUInt32BE(9),r.chainCode=n.slice(13,45);var i=n.slice(45);return 0===i.readUInt8(0)?r.privateKey=i.slice(1):r.publicKey=i,r},f.fromJSON=function(e){return f.fromExtendedKey(e.xpriv)},f.HARDENED_OFFSET=2147483648,e.exports=f},function(e,t,r){var n=r(276),i=r(8),o=r(0).Buffer;function a(e,t){var r;(Array.isArray(e)||e instanceof Uint8Array)&&(e=new o(e)),null!=t?("number"==typeof t&&(t=new o([t])),r=o.concat([t,e])):r=e;var i=u(r).slice(0,4),a=o.concat([r,i]);return n.encode(a)}function s(e,t){var r,i=n.decode(e),a=new o(i);if(null==t)r=0;else if("number"==typeof t&&(t=new o([t])),r=t.length,a.slice(0,r).toString("hex")!==t.toString("hex"))throw new Error("Invalid version");var s=a.slice(-4),c=a.length-4,f=a.slice(0,c),l=u(f).slice(0,4);if(s.toString("hex")!==l.toString("hex"))throw new Error("Invalid checksum");return f.slice(r)}function c(e,t){try{s(e,t)}catch(e){return!1}return!0}function u(e){var t=i("sha256").update(e).digest();return i("sha256").update(t).digest()}e.exports={encode:a,decode:s,isValid:c,createEncoder:function(e){return function(t){return a(t,e)}},createDecoder:function(e){return function(t){return s(t,e)}},createValidator:function(e){return function(t){return c(t,e)}}}},function(e,t,r){var n=r(277);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){const n=r(0).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);t.fill(255);for(let r=0;r>>0,f=new Uint8Array(u);for(;e[a];){let n=t[e.charCodeAt(a)];if(255===n)return;let i=0;for(let e=u-1;(0!==n||i>>0,f[e]=n%256>>>0,n=n/256>>>0;if(0!==n)throw new Error("Non-zero carry");c=i,a++}if(" "===e[a])return;let l=u-c;for(;l!==u&&0===f[l];)l++;const h=n.allocUnsafe(s+(u-l));h.fill(0,0,s);let d=s;for(;l!==u;)h[d++]=f[l++];return h}return{encode:function(t){if(!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";let o=0,s=0,c=0;const u=t.length;for(;c!==u&&0===t[c];)c++,o++;const f=(u-c)*a+1>>>0,l=new Uint8Array(f);for(;c!==u;){let e=t[c],n=0;for(let t=f-1;(0!==e||n>>0,l[t]=e%r>>>0,e=e/r>>>0;if(0!==e)throw new Error("Non-zero carry");s=n,c++}let h=f-s;for(;h!==f&&0===l[h];)h++;let d=i.repeat(o);for(;h=0?e.from(t):e.from(t.toString(),"binary")).toString("base64")},n=function(t){if(void 0===e)throw new Error("UnsupportedEnvironment");return e.from(t,"base64").toString("binary")}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(117)),o={public:"PUBLIC KEY",private:"PRIVATE KEY",encryptedPrivate:"ENCRYPTED PRIVATE KEY",certificate:"CERTIFICATE",certRequest:"CERTIFICATE REQUEST"};t.pemToBin=function(e){var t=s(e);return i.decodeBase64(t)},t.binToPem=function(e,t){var r=i.encodeBase64(e);return a(r,t)};var a=function(e,t){if(Object.keys(o).indexOf(t)<0)throw new Error("Unsupported type");for(var r=o[t],n="-----BEGIN "+r+"-----\n";e.length>0;)n+=e.substring(0,64)+"\n",e=e.substring(64);return n=n+"-----END "+r+"-----"},s=function(e){var t=RegExp("^-----[s]*BEGIN[^-]*-----$","gm"),r=RegExp("^-----[s]*END[^-]*-----$","gm");try{var n=e.split(t)[1].split(r)[0];return n=n.replace(/\r?\n/g,"")}catch(e){throw new Error("Invalid format as PEM")}}},function(e,t,r){"use strict";(function(e){var n=new(0,r(6).ec)("secp256k1"),i=r(22);const o=r(8),a=r(24),s=r(32),c=e.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),u=e.alloc(32,0);function f(e,t){if(!e)throw new Error(t||"Assertion failed")}function l(t){return r=t,!(!e.isBuffer(r)||32!==r.length)&&(t.compare(u)>0&&t.compare(c)<0);var r}function h(t){return e.from(s(t))}t.generatePrivate=function(){for(var e=h(32);!l(e);)e=h(32);return e};var d=t.getPublic=function(t){return f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),e.from(n.keyFromPrivate(t).getPublic("arr"))};t.sign=function(t,r){return new Promise(function(i){f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),f(r.length>0,"Message should not be empty"),f(r.length<=32,"Message is too long"),i(e.from(n.sign(r,t,{canonical:!0}).toDER()))})},t.verify=function(e,t,r){return new Promise(function(i,o){f(65===e.length||33===e.length,"Bad public key"),65===e.length&&f(4===e[0],"Bad public key"),33===e.length&&f(2===e[0]||3===e[0],"Bad public key"),f(t.length>0,"Message should not be empty"),f(t.length<=32,"Message is too long"),n.verify(t,r,e)?i(null):o(new Error("Bad signature"))})};var p=t.derive=function(t,r){f(e.isBuffer(t),"Bad private key"),f(e.isBuffer(r),"Bad public key"),f(32===t.length,"Bad private key"),f(l(t),"Bad private key"),f(65===r.length||33===r.length,"Bad public key"),65===r.length&&f(4===r[0],"Bad public key"),33===r.length&&f(2===r[0]||3===r[0],"Bad public key");var i=n.keyFromPrivate(t),o=n.keyFromPublic(r),a=i.derive(o.getPublic());return e.from(a.toArray())};t.encrypt=function(t,r,n){for(var s,c,u=(n=n||{}).ephemPrivateKey||h(32);!l(u);)u=n.ephemPrivateKey||h(32);c=d(u);let f=p(u,t),b=e.alloc(36);f.copy(b,0,0,32),b[35]=1;let m=function(e){var t=o("sha256").update(e).digest();return new Uint8Array(t)}(b);s=n.iv||h(12);let g=function(e,t,r){if(!t||!r)throw new Error("aes empty key or iv!");let n=i.createCipheriv("aes-128-gcm",t,r);n.setAutoPadding(!1);let o=n.update(e).toString("hex");return n.final(),{data:o,authTag:n.getAuthTag().toString("hex")}}(r,e.from(m.slice(0,16)),s),y=a.hexToBuffer(g.data),_=a.hexToBuffer(g.authTag);return e.concat([c,s,_,y])}}).call(this,r(2).Buffer)},function(e,t){e.exports={RSA:"01",ECIES:"02"}},function(e,t){e.exports={transformToFullName(e,t){if(-1!==e.name.indexOf("("))return e.name;let r="";return r=t?t.join(","):e.inputs.map(function(e){return e.type}).join(","),e.name+"("+r+")"},extractDisplayName(e){const t=e.indexOf("("),r=e.indexOf(")");return-1!==t&&-1!==r?e.slice(0,t):e},extractTypeName(e){const t=e.indexOf("("),r=e.indexOf(")");return-1!==t&&-1!==r?e.slice(t+1,r).replace(" ",""):""}}},function(e,t,r){const n=r(12),i=r(285),o=r(314),a=r(59);e.exports=class{constructor(e,t,r){this.EVM=a.EVM,this.WASM=a.WASM,this.nonce=e.nonce||"hello world",this.from=e.from||"",this.isSign="boolean"!=typeof e.isSign||e.isSign,this.setUserKey(e),this.setUserRecoverKey(e),this.userSign(),this.userRecoverSign(),this.ctr=new i({host:e.host,port:e.port,clients:e.clients||[],timeout:e.timeout,headers:e.headers,senderData:e.senderData||null,cert:e.cert,ca:e.ca,key:e.key,passphrase:e.passphrase,tx_querytime:e.tx_querytime,tx_querycount:e.tx_querycount,checkServerIdentity:e.checkServerIdentity,mychain:this,power:r},t),this.event=new o({ctr:this.ctr}),this.utils=n}getNonce(){return this.nonce}setUserKey(e){this.userPublicKey=n.toBuffer(e.userPublicKey||"0x97466f2b32bc3bb76d4741ae51cd1d8578b48d3f1e68da206d47321aec267ce78549b514e4453d74ef11b0cd5e4e4c364effddac8b51bcfc8de80682f952896f"),this.userPrivateKey=n.toBuffer(e.userPrivateKey||"0x3ecb44df2159c26e0f995712d4f39b6f6e499b40749b1cf1246c37f9516cb6a4"),this.userKeyInfo={privateKey:this.userPrivateKey,publicKey:this.userPublicKey}}userSign(e){e=e||this.nonce,this.userSignature=n.sign(e,this.userPrivateKey)}getUserKey(){return this.userKeyInfo}getUserSign(){return this.userSignature}setUserRecoverKey(e){this.userRecoverPublicKey=n.toBuffer(e.userRecoverPublicKey||this.userPublicKey),this.userRecoverPrivateKey=n.toBuffer(e.userRecoverPrivateKey||this.userPrivateKey),this.userRecoverKeyInfo={privateKey:this.userRecoverPublicKey,publicKey:this.userRecoverPrivateKey}}userRecoverSign(e){e=e||this.nonce,this.userRecoverSignature=n.sign(e,this.userRecoverPrivateKey)}getUserRecoverKey(){return this.userRecoverKeyInfo}getUserRecoverSign(){return this.userRecoverSignature}getFrom(){return this.from}setFrom(e){this.from=e}}},function(e,t,r){const n=r(58),i=r(286),o=r(12),a=r(35),s=r(287),c=[{apiName:n.CreateAccount,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.TransferBalance,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.SetRecoverkey,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.PreResetPubKey,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.ResetPubKey,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.UpdateAuthMap,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.FreezeAccount,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.FreezeContract,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.NativeDepositData,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.QueryLastBlock,follow:null},{apiName:n.QueryBlockHeader,follow:null},{apiName:n.QueryLastBlockHeader,follow:null},{apiName:n.QueryBlock,follow:null},{apiName:n.QueryTransaction,follow:null},{apiName:n.QueryTransactionReceipt,follow:null},{apiName:n.QueryTransactionList,follow:null},{apiName:n.QueryTransactionAndReceipt,follow:null},{apiName:n.QueryAccount,follow:null},{apiName:n.QueryContract,follow:null},{apiName:n.QueryTimestamp,follow:null},{apiName:n.QueryP2PStatus,follow:null},{apiName:n.QueryConsensusStatus,follow:null},{apiName:n.QueryCommonConsensusStatus,follow:null},{apiName:n.QuerySyncStatus,follow:null},{apiName:n.QueryTransactionCacheStatus,follow:null},{apiName:n.QueryBlockCacheStatus,follow:null},{apiName:n.QueryContractNodesStatus,follow:null},{apiName:n.QueryContractConfigStatus,follow:null},{apiName:n.QueryLogLevel,follow:null},{apiName:n.QueryBlockProof,follow:null},{apiName:n.QueryLatestStateProof,follow:null},{apiName:n.QueryStateProof,follow:null},{apiName:n.QueryTransactionProof,follow:null},{apiName:n.QueryReceiptProof,follow:null},{apiName:n.QueryBlockHeaderInfos,follow:null},{apiName:n.QueryBlockReceiptInfos,follow:null},{apiName:n.QueryBlockBodyInfos,follow:null},{apiName:n.UpdateBlackList,follow:null},{apiName:n.DeployContract,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.UpdateContract,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.CallContract,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]},{apiName:n.EventAccount,follow:null},{apiName:n.EventContract,follow:null},{apiName:n.EventTopics,follow:null},{apiName:n.EventBlock,follow:null},{apiName:n.EventFetch,follow:null},{apiName:n.EventCancel,follow:null},{apiName:n.LocalTransaction,follow:null},{apiName:n.EncryptedTransaction,follow:[{time:3e3,task(e,t,r){this._runWithRetry(e,t,r)}}]}];e.exports=class{constructor(e,t){this.mychain=e.mychain||{},this.tx_querytime=e.tx_querytime,this.tx_querycount=e.tx_querycount,this.power=e.power,this.power.setSender({...e},this.getBaseData(),t),c.forEach(e=>{this.setApi(e)})}_runWithRetry(e,t,r){const n=this;let o=this.tx_querycount||3,a=this.tx_querytime||3e3;!function s(){n.QueryTransactionReceipt({hash:e.hash},(r,n,c)=>{n&&(n.return_code===i.SERVICE_TX_WAITING_EXECUTE||n.return_code===i.SERVICE_TX_WAITING_VERIFY||n.return_code===i.SERVICE_QUERY_NO_RESULT)&&o>0?setTimeout(()=>{s(),o--},a):t(r,{...n,txhash:e.hash},c)},r)}()}getBaseData(){return{isSign:this.mychain.isSign,from:this.mychain.from,userPublicKey:this.mychain.userPublicKey,nonce:this.mychain.nonce,userPrivateKey:this.mychain.userPrivateKey,userSignature:this.mychain.userSignature,userRecoverPrivateKey:this.mychain.userRecoverPrivateKey}}setApi({apiName:e,follow:t,alias:r}){const n=r||e,i=this.power.makeSenderFunc(e);this[n]=((e,r,n)=>{const o=this.getBaseData();o.isSign="boolean"==typeof e.isSign?e.isSign:o.isSign,i(e,o,(e,i,o)=>{Array.isArray(t)&&!e?this._followRun(i,o,r,e,t,n&&n.follow||null):"function"==typeof r&&r(e,i,o)},n)})}callApi(e,t,r,n){if("function"!=typeof this[e])throw a.api(e);return this[e](t,r,n)}_followRun(e,t,r,n,i,o){const a=this;let s=0;!function e(t,r,o,c){const u=i[s];u?setTimeout(()=>{u.task.call(a,t,(t,r,n)=>{t?"function"==typeof o&&o(t,r,n):(s++,e(r,n,o,c&&c.follow||null))},c)},a.tx_querytime||u.time):"function"==typeof o&&o(n,t,r)}(e,t,r,o)}contract(e,t,r,n){return o.isFunction(r)&&(n=r,r=null),new s({client:this,event:this.mychain.event,contractName:e,abi:t,vmType:r,callback:n})}}},function(e,t){e.exports={SUCCESS:0,SERVICE_QUERY_NO_RESULT:404,SERVICE_TX_WAITING_VERIFY:413,SERVICE_TX_WAITING_EXECUTE:414}},function(e,t,r){const n=r(12),i=r(35),o=r(59),a=r(288),s=r(300);function c(e,t){if(e)if(n.isBigNumber(t)&&(t=n.toDecimal(t)),Array.isArray(e)){if(-1===e.indexOf(t))return!1}else if(t!==e)return!1;return!0}e.exports=class{constructor({client:e,event:t,contractName:r,abi:n,vmType:i,callback:c}){if(!r)throw new Error("ERROR: The contractName is null");this.client=e,this.event=t,this.contractName=r,this.abi=n||[],this.vmType=i||o.EVM,this.deploy_type=0,this.callCache=[];let u=a;switch(this.vmType){case o.EVM:u=a;break;case o.WASM:u=s}this.contractTpl=new u({contract:this,contractName:r,abi:this.abi}),setTimeout(()=>{"function"==typeof c&&c(null,this)},1)}callbackRun(e,t,r,n){this.deploy_type=t?2:0,"function"==typeof e&&e(t,r,n)}new(e,t={},r){let n="";try{n=this.contractTpl.newInput(e,t.parameters),t.parameters=null,delete t.parameters}catch(e){return this.callbackRun(r,e,this,null),this}this.deploy_type=1;const o={...t};o.from=t.from,o.to=this.contractName,o.data={code:n};let a=this.client.DeployContract;return o.encrypt&&(a=this.client.EncryptedTransaction,o.apiName="DeployContract"),o.local&&(a=this.client.LocalTransaction,o.apiName="DeployContract"),a.call(this.client,o,(e,t)=>{if(e)this.callbackRun(r,e,this,t);else if(0===t.return_code||408===t.return_code)if(t.receipt)if(408!==t.return_code)if(0===t.receipt.result){if(this.callbackRun(r,null,this,t),this.callCache.length){let e=this.callCache.shift();for(;e;)this.contractTpl.doPayload(e),e=this.callCache.shift()}this.callCache=[]}else this.callbackRun(r,i.receiptResult(t.receipt.result),this,t);else this.callbackRun(r,i.codeResult(t.return_code,t.receipt.result),this,t);else this.callbackRun(r,i.receiptResult(null),this,t);else this.callbackRun(r,i.returnCode(t.return_code),this,t)}),this}updateInput(e){return 0===e.indexOf("0x")&&(e=e.slice(2)),"0x"+this.vmType+e}update(e,t={},r){let n="";try{n=this.updateInput(e)}catch(e){return this.callbackRun(r,e,this,null),this}this.deploy_type=1;const o={...t};o.from=this.contractName,o.to=this.contractName,o.data={code:n};let a=this.client.UpdateContract;return o.encrypt&&(a=this.client.EncryptedTransaction,o.apiName="UpdateContract"),o.local&&(a=this.client.LocalTransaction,o.apiName="UpdateContract"),a.call(this.client,o,(e,t)=>{if(e)this.callbackRun(r,e,this,t);else if(0===t.return_code||408===t.return_code)if(t.receipt)if(408!==t.return_code)if(0===t.receipt.result){if(this.callbackRun(r,null,this,t),this.callCache.length){let e=this.callCache.shift();for(;e;)this.contractTpl.doPayload(e),e=this.callCache.shift()}this.callCache=[]}else this.callbackRun(r,i.receiptResult(t.receipt.result),this,t);else this.callbackRun(r,i.codeResult(t.return_code,t.receipt.result),this,t);else this.callbackRun(r,i.receiptResult(null),this,t);else this.callbackRun(r,i.returnCode(t.return_code),this,t)}),this}callApi(e){1===this.deploy_type?this.callCache.push(e):this.contractTpl.doPayload(e)}sendTransaction(e,t={},r,o){if(2===this.deploy_type)return void(n.isFunction(r)&&setTimeout(()=>{r(i.contractDeploy(this.contractName),null,null)},1));if(e)return void(n.isFunction(r)&&setTimeout(()=>{r(e,null,null)},1));const a=t.extend||null,s={...t,to:this.contractName,data:{parameter:t.data||""}};let c=this.client.CallContract;s.encrypt&&(c=this.client.EncryptedTransaction,s.apiName="CallContract"),s.local&&(c=this.client.LocalTransaction,s.apiName="CallContract");let u=!1;s.encrypt&&(u=!0),c.call(this.client,s,(e,t,a)=>{if(n.isFunction(r)){if(e)return void r(e,null,t,a);if(0!==t.return_code&&408!==t.return_code)return void r(i.returnCode(t.return_code),null,t,a);if(!t.receipt)return void r(new Error("Receipt is null"),null,t,a);if(10201===t.receipt.result){let n=null;try{n=this.formatRequireOutput(t.receipt.output)}catch(e){n=null}return void r(i.receiptResult(t.receipt.result,t.hash,n),n,t,a)}if(408===t.return_code)return void r(i.codeResult(t.return_code,t.receipt.result),null,t,a);if(0!==t.receipt.result)return void r(i.receiptResult(t.receipt.result),null,t,a);if(u)return void r(e,t.receipt.output,t,a);t=this.formatLog(t);let n=e,s=null;try{s=this.contractTpl.unpackApiOutput(t.receipt.output,o)}catch(e){n=e}r(n,s,t,a)}},a)}callEvent(e,t,r,i){if(n.isFunction(r)){if(e)return void r(e,t);let n=null;if(t.event_data&&t.event_data.data)try{n=this.contractTpl.unpackEventOutput(t.event_data.data,i)}catch(t){e=t}(function(e,t){if(!Array.isArray(e))return c(t[0],e);for(let r=0;r0){const e=(t[0]||{}).filter||null;if(e)for(let t=0;tr.length&&i.isObject(e[e.length-1])&&(n=e[e.length-1]),n.data=t+this.unpackInput(e,r),n}unpackInput(e,t){return this.validateArgs(e,t),n.encodeParams(t,e)}validateArgs(e,t){if(e.filter(function(e){return!(!0===i.isObject(e)&&!1===i.isArray(e)&&!1===i.isBigNumber(e))}).length!==t.length)throw o.InvalidNumberOfSolidityArgs()}extractCallback(e){if(i.isFunction(e[e.length-1]))return e.pop()}_unpackOutput(e,t,r){if(!e)return"";r=r||2,e=e.length>=r?e.slice(r):e;const i=n.decodeParams(t,e);return 1===i.length?i[0]:i}_makeContract(){const e=this.abi;for(let t=0;t{n&&0===n.return_code&&(this.eventMap[r]=null,delete this.eventMap[r]),"function"==typeof t&&t(e,n)})}_addEvent(e){const{args:t,sha3Name:r,signName:n,inputTypes:i,outputTypes:o,inputNames:a}=e,s=this.extractCallback(t);this.eventMap[r]||(this.eventMap[r]=this.event.topic({to:r},(e,t,r)=>{e&&console.error(e)})),this.eventMap[r].on((t,r,n)=>{this.contract.callEvent(t,r,s,e)})}}},function(e,t,r){var n=r(11),i=r(290),o=r(291),a=r(292),s=r(293),c=r(294),u=r(295),f=r(296),l=r(297),h=r(298),d=r(299),p=function(e,t){return e.isDynamicType(t)||e.isDynamicArray(t)},b=function(e){this._types=e};b.prototype._requireType=function(e){var t=this._types.filter(function(t){return t.isType(e)})[0];if(!t)throw Error("invalid solidity type!: "+e);return t},b.prototype.encodeParam=function(e,t){return this.encodeParams([e],[t])},b.prototype.encodeParams=function(e,t){var r=this.getSolidityTypes(e),n=r.map(function(r,n){return r.encode(t[n],e[n])}),i=r.reduce(function(t,n,i){var o=n.staticPartLength(e[i]),a=32*Math.floor((o+31)/32);return t+(p(r[i],e[i])?32:a)},0);return this.encodeMultiWithOffset(e,r,n,i)},b.prototype.encodeMultiWithOffset=function(e,t,r,i){var o="",a=this;return e.forEach(function(s,c){if(p(t[c],e[c])){o+=n.formatInputInt(i).encode();var u=a.encodeWithOffset(e[c],t[c],r[c],i);i+=u.length/2}else o+=a.encodeWithOffset(e[c],t[c],r[c],i)}),e.forEach(function(n,s){if(p(t[s],e[s])){var c=a.encodeWithOffset(e[s],t[s],r[s],i);i+=c.length/2,o+=c}}),o},b.prototype.encodeWithOffset=function(e,t,r,i){var o=1,a=2,s=3,c=t.isDynamicArray(e)?o:t.isStaticArray(e)?a:s;if(c!==s){var u=t.nestedName(e),f=t.staticPartLength(u),l=c===o?r[0]:"";if(t.isDynamicArray(u))for(var h=c===o?2:0,d=0;d0&&r[0];return this._unpackOutput(this.result,e,n)}_unpackOutput(e,r,n){if(!e||!r||!n)return r;0===r.indexOf("0x")&&(r=r.slice(2));const o=i.decodeParam(e,n,t.from(r,"hex"));return 1===o.length?o[0]:o}_makeContract(){if(this.schema)for(let e in this.schema){const t=this.schema[e].fields||{},r=[];for(let e in t)r.push({key:e,type:t[e]});this._setFunction(e,r)}}_setThisFunc(e,t){this.contract[e]||(this.contract[e]=t)}_setFunction(e,t){const r=this;this._setThisFunc(e,function(){const n=Array.prototype.slice.call(arguments);r.contract.callApi({type:"function",args:n,actionName:e,inputs:t})})}_sendTransaction(e){const{args:t,actionName:r,inputs:n}=e,a=this.extractCallback(t);let s={};t.length>n.length&&o.isObject(t[t.length-1])&&(s=t.pop());let c=null;try{const e=i.encodeParams(r,this.result,t);e&&(s.data="0x"+e)}catch(e){console.error(e),c=e}this.contract.sendTransaction(c,s,a,e)}}}).call(this,r(2).Buffer)},function(e,t,r){const n=r(302),i=r(0).Buffer;e.exports=function(e){null==e&&(e={});e.abiCache={abi:function(e,o){if(o){i.isBuffer(o)&&(o=JSON.parse(o));const a=function(e,t){const r={};e.types&&e.types.forEach(e=>{r[e.new_type_name]=e.type});e.structs&&e.structs.forEach(e=>{const t={};for(const r of e.fields)t[r.name]=r.type;r[e.name]={base:e.base,fields:t,results:e.results},""===e.base&&delete r[e.name].base});e.interfaces&&e.interfaces.forEach(e=>{const n=r[e.type];n?n.interface={name:e.name}:console.error("Missing abiSchema type",e.type,t)});return r}(o,e),s=n(t,a);return r[e]=Object.assign({abi:o,schema:a},s)}const a=r[e];if(null==a)throw new Error(`Abi '${e}' is not cached`);return a}};const t=Object.assign({},{defaults:!0},e),r={};return e.abiCache}},function(e,t,r){const n=r(303),i=r(311),o=r(0).Buffer;e.exports=((e={},t)=>{const r=Object.assign({},a((t,r)=>{const n=e.abiCache.abi(r);for(const e of n.abi.interfaces)if(e.name===t){const t=n.structs[e.type];if(null!=t)return t}const i=n.structs[t];if(null!=i)return i;throw new Error(`Missing ABI interface: ${t}`)}),s(e),e.override),o=Object.assign({},{},e.customTypes);(e=Object.assign({override:r},{customTypes:o},e)).sort=Object.assign({},e.sort);const c=Object.assign({},i,t),{structs:u,types:f,errors:l,fromBuffer:h,toBuffer:d}=n(c,e);if(0!==l.length)throw new Error(JSON.stringify(l,null,4));return{structs:u,types:f,fromBuffer:h,toBuffer:d}});const a=e=>({"abi_def.fromObject":e=>{if("string"==typeof e){let t=o.from(e,"hex").toString();return 0===t.length&&(t=o.from(e).toString()),JSON.parse(t)}return o.isBuffer(e)?JSON.parse(e.toString()):null}}),s=e=>({"setcode.code.fromObject":({object:t,result:r})=>{try{const n=t.code.toString();if(/^\s*\(module/.test(n)){const{binaryen:t}=e;e.debug&&console.log("Assembling WASM..");const i=o.from(t.parseText(n).emitBinary());r.code=i}else r.code=t.code}catch(e){throw console.error(e,t.code),e}}})},function(e,t,r){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(304),o=r(309),a=r(120),s=o.create;e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!==(void 0===e?"undefined":n(e)))throw new TypeError("definitions is a required parameter");if(t.customTypes)for(var r in e=Object.assign({},e),t.customTypes)delete e[r];var o=i(t),a=s(e,o),f=a.errors,l=a.structs;return{errors:f,structs:l,types:o,extend:function(t){return function e(t,r){var n=Object.assign({},t,r),i=s(n,o),a=i.structs;return{errors:i.errors,structs:a,extend:function(t){return e(n,t)},fromBuffer:c(o,a),toBuffer:u(o,a)}}(e,t)},fromBuffer:c(o,l),toBuffer:u(o,l)}};var c=function(e,r){return function(i,s){a.equal(void 0===i?"undefined":n(i),"string","typeName (type or struct name)"),"string"==typeof s&&(s=t.from(s,"hex")),a(t.isBuffer(s),"expecting buf");var c=e[i];return c=c?c():r[i],a(c,"missing type or struct: "+i),o.fromBuffer(c,s)}},u=function(e,t){return function(r,i){a.equal(void 0===r?"undefined":n(r),"string","typeName (type or struct name)"),a(null!=i,"value is required");var s=e[r];return s=s?s():t[r],a(s,"missing type or struct: "+r),o.toBuffer(s,i)}};e.exports.fromBuffer=o.fromBuffer,e.exports.toBuffer=o.toBuffer}).call(this,r(2).Buffer)},function(e,t,r){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();var o=r(4),a=r(60).Long,s=r(120),c={bytes:function(){return[y]},string:function(){return[_]},vector:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return[l,{type:e,sorted:t}]},optional:function(e){return[h,{type:e}]},time:function(){return[v]},map:function(e){return[u,{annotation:e}]},static_variant:function(e){return[f,{types:e}]},fixed_string16:function(){return[_,{maxLen:16}]},fixed_string32:function(){return[_,{maxLen:32}]},fixed_bytes16:function(){return[y,{len:16}]},fixed_bytes20:function(){return[y,{len:20}]},fixed_bytes28:function(){return[y,{len:28}]},fixed_bytes32:function(){return[y,{len:32}]},fixed_bytes33:function(){return[y,{len:33}]},fixed_bytes64:function(){return[y,{len:64}]},fixed_bytes65:function(){return[y,{len:65}]},uint8:function(){return[p,{bits:8}]},uint16:function(){return[p,{bits:16}]},uint32:function(){return[p,{bits:32}]},uint64:function(){return[p,{bits:64}]},uint128:function(){return[b,{bits:128}]},uint224:function(){return[b,{bits:224}]},uint256:function(){return[b,{bits:256}]},uint512:function(){return[b,{bits:512}]},varuint32:function(){return[p,{bits:32,variable:!0}]},int8:function(){return[p,{signed:!0,bits:8}]},int16:function(){return[p,{signed:!0,bits:16}]},int32:function(){return[p,{signed:!0,bits:32}]},int64:function(){return[p,{signed:!0,bits:64}]},int128:function(){return[b,{signed:!0,bits:128}]},int224:function(){return[b,{signed:!0,bits:224}]},int256:function(){return[b,{signed:!0,bits:256}]},int512:function(){return[b,{signed:!0,bits:512}]},varint32:function(){return[p,{signed:!0,bits:32,variable:!0}]},float32:function(){return[g,{bits:32}]},float64:function(){return[g,{bits:64}]}};e.exports=function(e){e=Object.assign({defaults:!1,debug:!1,customTypes:{}},e);var t=Object.assign({},c,e.customTypes),r=function(r){return function(n,o){return n[o]=function(){for(var a=arguments.length,s=Array(a),u=0;u unknown");if(!A(n))throw new TypeError("map<, type2> unknown");return{fromByteBuffer:function(t){for(var i=t.readVarint32(),o={},a=0;a53?"0":0:(T(t,e),a.isLong(t)?t.toString():t)}}},b=function(e){var r=e.signed,n=void 0!==r&&r,i=e.bits,a=i/8;return{fromByteBuffer:function(r){var s=r.copy(r.offset,r.offset+a);r.skip(a);var c=new o(s.toHex(),"hex"),u=c.toArrayLike(t,"le",a);c=new o(u.toString("hex"),"hex"),n&&(c=c.fromTwos(i));var f=c.toString();return T(f,e),i>53?f:c.toNumber()},appendByteBuffer:function(r,s){T(s,e);var c=new o(s);n&&(c=c.toTwos(i));var u=c.toArrayLike(t,"le",a);r.append(u.toString("binary"),"binary")},fromObject:function(t){return T(t,e),t},toObject:function(t){return e.defaults&&null==t?e.bits>53?"0":0:(T(t,e),t)}}},m=r(308),g=function(e){var r=e.bits,n=32===r?"Float":64===r?"Double":null;s(n,"unsupported float bit size: "+r);var i=r/8;return{fromByteBuffer:function(e){var r=e.copy(e.offset,e.offset+i);e.skip(i);var o=t.from(r.toBinary(),"binary");return m["read"+n+"LE"](o)},appendByteBuffer:function(e,t){var r=[];m["write"+n+"LE"](r,t),e.append(r)},fromObject:function(e){return e},toObject:function(t){return e.defaults&&null==t?0:t}}},y=function(e){return{fromByteBuffer:function(r){var n=e.len,i=void 0;if(null==n){var o=r.readVarint32();i=r.copy(r.offset,r.offset+o),r.skip(o)}else i=r.copy(r.offset,r.offset+n),r.skip(n);return t.from(i.toBinary(),"binary")},appendByteBuffer:function(t,r){null==e.len&&t.writeVarint32(r.length),t.append(r.toString("binary"),"binary")},fromObject:function(r){return"string"==typeof r?r=t.from(r,"hex"):r instanceof Array?r=t.from(r):r instanceof Uint8Array&&(r=t.from(r)),w(r,e),r},toObject:function(t){var r=e.defaults,n=e.len;return r&&null==t?Array(n?n+1:1).join("00"):(w(t,e),t.toString("hex"))},compare:function(e,r){return t.compare(e,r)}}},_=function(e){return{fromByteBuffer:function(e){return e.readVString()},appendByteBuffer:function(t,r){w(r,e),t.writeVString(r.toString())},fromObject:function(t){return w(t,e),t},toObject:function(t){return e.defaults&&null==t?"":(w(t,e),t)}}},v=function(e){return{fromByteBuffer:function(e){return e.readUint32()},appendByteBuffer:function(t,r){w(r,e),t.writeUint32(r)},fromObject:function(t){if(w(t,e),"number"==typeof t)return t;if(t.getTime)return Math.floor(t.getTime()/1e3);if("string"!=typeof t)throw new Error("Unknown date type: "+t);return"string"!=typeof t||/Z$/.test(t)||(t+="Z"),Math.floor(new Date(t).getTime()/1e3)},toObject:function(t){if(e.defaults&&null==t)return new Date(0).toISOString().split(".")[0];w(t,e),T(t,k(e,{bits:32}));var r=parseInt(t);return new Date(1e3*r).toISOString().split(".")[0]}}},w=function(e,t){if(R(e))throw new Error("Required "+t.typeName);if(null!=t.len){if(null==e.length)throw new Error('len validation requries a "length" property');var r=t.len;if(e.length!==r)throw new Error(t.typeName+" length "+e.length+" does not equal "+r)}if(null!=t.maxLen){var n=t.maxLen;if(null==e.length)throw new Error('maxLen validation requries a "length" property');if(e.length>n)throw new Error(t.typeName+" length "+e.length+" exceeds maxLen "+n)}},E=new o,S=new o("1");function T(e,t){if(R(e))throw new Error("Required "+t.typeName);var r=t.signed,n=void 0!==r&&r,i=t.bits,a=void 0===i?54:i;if(e=String(e).trim(),n&&!/^-?[0-9]+$/.test(e)||!n&&!/^[0-9]+$/.test(e))throw new Error("Number format "+t.typeName+" "+e);var s=n?B(a):x(a),c=n?P(a):E,u=new o(e);if(u.cmp(c)<0||u.cmp(s)>0)throw new Error("Overflow "+t.typeName+" "+e+", max "+s.toString()+", min "+c.toString()+", signed "+n+", bits "+a)}var A=function(e){return"object"===(void 0===e?"undefined":n(e))&&"function"==typeof e.fromByteBuffer&&"function"==typeof e.appendByteBuffer&&"function"==typeof e.fromObject&&"function"==typeof e.toObject},I=function(e,t){return e.compare?t.sort(e.compare):t.sort()},k=function(){return Object.assign.apply(Object,arguments)},R=function(e){return null==e},x=function(e){return new o(1).ishln(e).isub(S)},B=function(e){return new o(1).ishln(e-1).isub(S)},P=function(e){return new o(1).ishln(e-1).ineg()}}).call(this,r(2).Buffer)},function(e,t,r){var n,i,o; /** * @license long.js (c) 2013 Daniel Wirtz * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/long.js for details */i=[],void 0===(o="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},n={};function i(e,t){var i,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=n[e])?o:(i=a(e,(0|e)<0?-1:0,!0),s&&(n[e]=i),i):(s=-128<=(e|=0)&&e<128)&&(o=r[e])?o:(i=a(e,e<0?-1:0,!1),s&&(r[e]=i),i)}function o(e,t){if(isNaN(e)||!isFinite(e))return t?b:p;if(t){if(e<0)return b;if(e>=l)return v}else{if(e<=-h)return w;if(e+1>=h)return _}return e<0?o(-e,t).neg():a(e%f|0,e/f|0,t)}function a(t,r,n){return new e(t,r,n)}e.fromInt=i,e.fromNumber=o,e.fromBits=a;var s=Math.pow;function c(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return c(e.substring(1),t,r).neg();for(var i=o(s(r,8)),a=p,u=0;u>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},E.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=u).isZero())return f+c;for(;f.length<6;)f="0"+f;c=""+f+c}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},E.isOdd=function(){return 1==(1&this.low)},E.isEven=function(){return 0==(1&this.low)},E.equals=function(e){return t(e)||(e=u(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.compare=function(e){if(t(e)||(e=u(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},E.neg=E.negate,E.add=function(e){t(e)||(e=u(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,c=65535&e.high,f=e.low>>>16,l=0,h=0,d=0,p=0;return d+=(p+=o+(65535&e.low))>>>16,h+=(d+=i+f)>>>16,l+=(h+=n+c)>>>16,l+=r+s,a((d&=65535)<<16|(p&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},E.subtract=function(e){return t(e)||(e=u(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return p;if(t(e)||(e=u(e)),e.isZero())return p;if(this.eq(w))return e.isOdd()?w:p;if(e.eq(w))return this.isOdd()?w:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return o(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,c=e.high>>>16,f=65535&e.high,l=e.low>>>16,h=65535&e.low,b=0,m=0,g=0,y=0;return g+=(y+=s*h)>>>16,m+=(g+=i*h)>>>16,g&=65535,m+=(g+=s*l)>>>16,b+=(m+=n*h)>>>16,m&=65535,b+=(m+=i*l)>>>16,m&=65535,b+=(m+=s*f)>>>16,b+=r*h+n*l+i*f+s*c,a((g&=65535)<<16|(y&=65535),(b&=65535)<<16|(m&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(t(e)||(e=u(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?b:p;var r,n,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return g;i=b}else{if(this.eq(w))return e.eq(m)||e.eq(y)?w:e.eq(w)?m:(r=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?m:y:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(w))return this.unsigned?b:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=p}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),c=a<=48?1:s(2,a-48),f=o(r),l=f.mul(e);l.isNegative()||l.gt(n);)l=(f=o(r-=c,this.unsigned)).mul(e);f.isZero()&&(f=m),i=i.add(f),n=n.sub(l)}return i},E.div=E.divide,E.modulo=function(e){return t(e)||(e=u(e)),this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.not=function(){return a(~this.low,~this.high,this.unsigned)},E.and=function(e){return t(e)||(e=u(e)),a(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return t(e)||(e=u(e)),a(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return t(e)||(e=u(e)),a(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?a(this.low<>>32-e,this.unsigned):a(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):a(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?a(this.low>>>e|r<<32-e,r>>>e,this.unsigned):a(32===e?r:r>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?n.apply(t,i):n)||(e.exports=o)},function(e,t,r){(function(e){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=o)return e;switch(e){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 e}}),c=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),f(n,e,n.depth)}function c(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=f(e,i,n)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(m(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(S(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return l(r)}var u,v="",T=!1,A=["{","}"];(d(r)&&(T=!0,A=["[","]"]),S(r))&&(v=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(v=" "+RegExp.prototype.toString.call(r)),w(r)&&(v=" "+Date.prototype.toUTCString.call(r)),E(r)&&(v=" "+l(r)),0!==a.length||T&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=T?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,v,A)):A[0]+v+A[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),k(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=b(r)?f(e,c.value,null):f(e,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),y(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function b(e){return null===e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function _(e){return v(e)&&"[object RegExp]"===T(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===T(e)}function E(e){return v(e)&&("[object Error]"===T(e)||e instanceof Error)}function S(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=_,t.isObject=v,t.isDate=w,t.isError=E,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(307);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),I[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(1),t._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function x(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o>>24&255,o=t>>16&255,a=t>>8&255,s=255&t;"bige"===n?(e[r++]=i,e[r++]=o,e[r++]=a,e[r]=s):(e[r++]=s,e[r++]=a,e[r++]=o,e[r]=i)}function g(e,t,r,n,i){"bige"===i?(m(e,t,n,i),m(e,r,n+4,i)):(m(e,r,n,i),m(e,t,n+4,i))}"function"==typeof Float32Array&&(f=new Float32Array(1),l=new Uint8Array(f.buffer),f[0]=-1,p=0===l[3],r=function(e,t){return(t=t||0)<0||t+4>e.length?0:(l[0]=e[t++],l[1]=e[t++],l[2]=e[t++],l[3]=e[t],f[0])},i=function(e,t){return(t=t||0)<0||t+4>e.length?0:(l[3]=e[t++],l[2]=e[t++],l[1]=e[t++],l[0]=e[t],f[0])},n=function(e,t,r){r=r||0,f[0]=t,e[r++]=l[0],e[r++]=l[1],e[r++]=l[2],e[r]=l[3]},o=function(e,t,r){r=r||0,f[0]=t,e[r++]=l[3],e[r++]=l[2],e[r++]=l[1],e[r]=l[0]}),"function"==typeof Float64Array&&(h=new Float64Array(1),d=new Uint8Array(h.buffer),a=function(e,t){return(t=t||0)<0||t+8>e.length?0:(d[0]=e[t+0],d[1]=e[t+1],d[2]=e[t+2],d[3]=e[t+3],d[4]=e[t+4],d[5]=e[t+5],d[6]=e[t+6],d[7]=e[t+7],h[0])},c=function(e,t){return(t=t||0)<0||t+8>e.length?0:(d[7]=e[t+0],d[6]=e[t+1],d[5]=e[t+2],d[4]=e[t+3],d[3]=e[t+4],d[2]=e[t+5],d[1]=e[t+6],d[0]=e[t+7],h[0])},s=function(e,t,r){r=r||0,h[0]=t,e[r+0]=d[0],e[r+1]=d[1],e[r+2]=d[2],e[r+3]=d[3],e[r+4]=d[4],e[r+5]=d[5],e[r+6]=d[6],e[r+7]=d[7]},u=function(e,t,r){r=r||0,h[0]=t,e[r+0]=d[7],e[r+1]=d[6],e[r+2]=d[5],e[r+3]=d[4],e[r+4]=d[3],e[r+5]=d[2],e[r+6]=d[1],e[r+7]=d[0]});for(var y=new Array,_=0;_<1200;_++)y[_]=Math.pow(2,_);var v=new Array;for(_=0;_<1200;_++)v[_]=Math.pow(2,-_);function w(e){return e>=0?y[e]:v[-e]}var E=4294967296,S=2.220446049250313e-16;w(-1023);function T(e,t,r){var n,i,o=b(e,t,r),a=b(e,t+4,r);"bige"===r?(n=o,i=a):(n=a,i=o);var s=(1048575&n)*E+i,c=(2146435072&n)>>>20;return(n>>31||1)*(0===c?s?s*w(-1074):0:c<2047?s>=0?(1+s*S)*w(c-1023):0:s?NaN:1/0)}var A=Math.pow(2,-23),I=Math.pow(2,-127);function k(e,t,r){var n=b(e,t,r),i=8388607&n,o=(2139095040&n)>>>23;return(n>>31||1)*(0===o?i?i*A*2*I:0:o<255?(1+i*A)*w(o-127):i?NaN:1/0)}var R={exp:0,mant:0};function x(e){var t=0;return e>=2?(e*=w(-(t=P(1,e))))>=2&&(e/=2,t+=1):e<1&&((t=P(e,2))<=1023?e*=w(t):(e*=w(t-100),e*=w(100)),t=-t),R.exp=t,R.mant=e,R}var B=Math.pow(2,192);function P(e,t){for(var r=0;e*B=8388608&&(i.mant-=8388608,i.exp+=1)):(i.mant=C(i.mant-1,8388608),i.mant>=8388608&&(i.mant-=8388608,i.exp+=1),i.exp>254&&(i.mant=0,i.exp=255)),m(e,o|i.exp<<23|i.mant,r,n)):m(e,0===t?1/t<0?2147483648:0:t===1/0?2139095040|o:2143289344,r,n)}new t(8);var N=Math.pow(2,52);function O(e,t,r,n){var i,o,a,s=0;t<0&&(s=2147483648,t=-t),t&&t<1/0?((i=x(t)).exp+=1023,i.exp<=0?(i.mant*=w(51+i.exp),i.exp=0):i.mant=(i.mant-1)*N,g(e,o=s|i.exp<<20|i.mant/4294967296,a=i.mant>>>0,r,n)):(0===t?(o=1/t<0?2147483648:0,a=0):t===1/0?(o=s+2146435072,a=0):(o=2146959360,a=0),g(e,o,a,r,n))}(function t(){var f=e.exports||this;f.readWord=b,f.writeWord=m,f.writeDoubleWord=g,f.readFloat=k,f.writeFloat=M,f.readDouble=T,f.writeDouble=O,f._useFloatArray=function(e){f._usingFloatArray=e,e?("full"==e&&(f.readFloatLE=p?i:r),f.writeFloatLE=p?o:n,"full"==e&&(f.readFloatBE=p?r:i),f.writeFloatBE=p?n:o,f.readDoubleLE=p?c:a,f.writeDoubleLE=p?u:s,f.readDoubleBE=p?a:c,f.writeDoubleBE=p?s:u):(f._usingFloatArray="",f.readFloatLE=function(e,t){return f.readFloat(e,t||0,"le")},f.writeFloatLE=function(e,t,r){f.writeFloat(e,t,r||0,"le")},f.readFloatBE=function(e,t){return f.readFloat(e,t||0,"bige")},f.writeFloatBE=function(e,t,r){f.writeFloat(e,t,r||0,"bige")},f.readDoubleLE=function(e,t){return f.readDouble(e,t||0,"le")},f.writeDoubleLE=function(e,t,r){f.writeDouble(e,t,r||0,"le")},f.readDoubleBE=function(e,t){return f.readDouble(e,t||0,"bige")},f.writeDoubleBE=function(e,t,r){f.writeDouble(e,t,r||0,"bige")})},f._getBigeCpu=function(){return p},f._setBigeCpu=function(e){p=e},f._useFloatArray(!1),f._useFloatArray(r&&a&&"fastest"),t.prototype=f}).call(this)}).call(this,r(2).Buffer)},function(e,t,r){"use strict";(function(t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r(60),o=r(310);e.exports={create:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.config,i=[];r.sort||(r.sort={});for(var c in e){var u=e[c],f=u.base,l=u.fields,h=void 0===u?"undefined":n(u);if("object"===h){if(!f&&!l){i.push("Expecting "+c+".fields or "+c+".base");continue}if(f&&"string"!=typeof f&&i.push("Expecting string "+c+".base"),l)if("object"!==(void 0===l?"undefined":n(l)))i.push("Expecting object "+c+".fields");else for(var d in l)"string"!=typeof l[d]&&i.push("Expecting string in "+c+".fields."+d)}else if("string"!==h){i.push("Expecting object or string under "+c+", instead got "+(void 0===u?"undefined":n(u)));continue}}var p={};for(var b in e){var m=e[b];"object"===(void 0===m?"undefined":n(m))&&(p[b]=o(b,r))}for(var g in e){var y=e[g];if("string"==typeof y){var _=t[y];if(_)t[g]=_;else{var v=A(g,y);v?p[g]=v:i.push("Unrecognized type or struct "+g+"."+y)}}}for(var w in e){var E=p[w];if(E){var S=e[w];if("object"===(void 0===S?"undefined":n(S))&&S.base){var f=S.base,T=p[f];if(!T){i.push("Missing "+f+" in "+w+".base");continue}E.add("",s(T))}}}function A(e,n,o,s){var c=a(n);if(!c)return null;var u=c.name,f=c.annotation,l=c.arrayType,h=void 0;if(f){var d=t[u];if(null==d)return i.push("Missing "+u+" in "+n),null;var b=[],m=!0,g=!1,y=void 0;try{for(var _,v=f[Symbol.iterator]();!(m=(_=v.next()).done);m=!0){var w=_.value,E=A(e,w,null,s);if(!E)return i.push("Missing "+w+" in "+n),null;b.push(E)}}catch(e){g=!0,y=e}finally{try{!m&&v.return&&v.return()}finally{if(g)throw y}}h=d(b)}else if(null==l){var S=p[u];if(S)return S;var T=t[u];if(!T)return null;h=T(o)}else if(""===l){var I=A(e,c.name,null,s);if(!I)return null;var k=r.sort[e+"."+s]||!1;h=t.vector(I,k)}else if(l.length>0){var R=A(e,c.arrayType,null,s);if(!R)return i.push("Missing "+c.arrayType+" in "+n),null;var x=A(e,c.name,R,s);if(!x)return i.push("Missing "+c.name+" in "+n),null;h=x}return c.optional?t.optional(h):h}for(var I in e){var k=p[I];if(k){var R=e[I];if(R.fields){var l=R.fields;for(var x in l){var B=l[x],P=A(I,B,null,x);P?k.add(x,P):i.push("Missing "+B+" in "+I+".fields."+x)}}}}if(i.length)return{errors:i};return{errors:i,structs:p}},toBuffer:function(e,r){var n=e.fromObject(r);return t.from(function(e,t){var r=new i(i.DEFAULT_CAPACITY,i.LITTLE_ENDIAN);return e.appendByteBuffer(r,t),r.copy(0,r.offset)}(e,n).toBinary(),"binary")},fromBuffer:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=i.fromBinary(t.toString("binary"),i.LITTLE_ENDIAN),o=e.fromByteBuffer(n);return r?e.toObject(o):o}};var a=function(e){if(!e||"string"!=typeof e)return null;var t=(e=e.trim()).match(/<(.*)>/);if(t){var r=t?t[1].replace(/ /g,"").split(","):null;return{name:e=e.replace(t[0],"").trim(),annotation:r}}var n=e.match(/\[(.*)\]/),i=n?n[1].trim():null;n&&(e=e.replace(n[0],"").trim());var o=!1;return/\?$/.test(e)&&(e=e.substring(0,e.length-1),o=!0),{name:e,arrayType:i,optional:o}},s=function(e){return{fromByteBuffer:function(t){return e.fromByteBuffer(t)},appendByteBuffer:function(t,r){e.appendByteBuffer(t,r)},fromObject:function(t){return e.fromObject(t)},toObject:function(t){return e.toObject(t)}}}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=r(60);e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{debug:!1};t=Object.assign({override:{}},t);var r={},i=void 0,o=void 0;return{compare:function(e,t){var r=e[o],n=t[o];return i&&i.compare?i.compare(r,n):r>n?1:r0&&void 0!==arguments[0]?arguments[0]:{},o=t.override[e+".toObject"];if(o){var a=o(i);if(null!=a)return a}var s={},c=null;try{for(c in r){var u=r[c],f=t.override[e+"."+c+".toObject"];if(f)f({fields:r,object:i,result:s,config:t});else if(""===c){var l=u.toObject(i,t);Object.assign(s,l)}else{var h=u.toObject(i?i[c]:null,t);s[c]=h}if(t.debug)try{var d=new n(n.DEFAULT_CAPACITY,n.LITTLE_ENDIAN);if(null!=i){var p=i[c];if(p){var b=t.override[e+"."+c+".appendByteBuffer"];f&&b?b({fields:r,object:i,b:d}):u.appendByteBuffer(d,p)}}d=d.copy(0,d.offset),console.error("toObject",e+"."+c,"'"+s[c]+"'",d.toHex())}catch(t){t.message=e+"."+c+" "+t.message,console.error(t)}}}catch(t){throw t.message+=" "+e+"."+c,t}return s}}}},function(e,t,r){const n=Object.assign({},r(312));e.exports=n},function(e){e.exports={name:"uint64",Identity:"bytes",checksum160:"fixed_bytes20",checksum256:"fixed_bytes32",checksum512:"fixed_bytes64",signature:"fixed_bytes65",public_key:"fixed_bytes33",message_type:"fixed_string16",symbol:"uint64",symbol_code:"uint64",field_name:"string",account_name:"name",permission_name:"name",type_name:"string",table_name:"name",scope_name:"name",action_name:"string",time_point:"int64",time_point_sec:"time",timestamp:"uint32",block_timestamp_type:"timestamp",block_id:"fixed_bytes32",checksum_type:"fixed_bytes32",checksum256_type:"fixed_bytes32",checksum512_type:"fixed_bytes64",checksum160_type:"fixed_bytes20",sha256:"fixed_bytes32",sha512:"fixed_bytes64",sha160:"fixed_bytes20",weight_type:"uint16",block_num_type:"uint32",share_type:"int64",digest_type:"checksum_type",context_free_type:"bytes",unsigned_int:"varuint32",bool:"uint8",extensions_type:{base:"",fields:{type:"uint16",data:"bytes"}},transaction_header:{base:"",fields:{expiration:"time",ref_block_num:"uint16",ref_block_prefix:"uint32",max_net_usage_words:"unsigned_int",max_cpu_usage_ms:"uint8",delay_sec:"unsigned_int"}},transaction:{base:"transaction_header",fields:{context_free_actions:"action[]",actions:"action[]",transaction_extensions:"extensions_type[]"}},signed_transaction:{base:"transaction",fields:{signatures:"signature[]",context_free_data:"bytes[]"}},fields:"field_def[]",field_def:{fields:{name:"field_name",type:"type_name"}},type_def:{base:"",fields:{new_type_name:"type_name",type:"type_name"}},struct_def:{base:"",fields:{name:"type_name",base:"type_name",fields:"field_def[]"}},clause_pair:{base:"",fields:{id:"string",body:"string"}},error_message:{base:"",fields:{error_code:"uint64",error_msg:"string"}},abi_def:{base:"",fields:{version:"string",types:"type_def[]",structs:"struct_def[]",actions:"action_def[]",tables:"table_def[]",ricardian_clauses:"clause_pair[]",error_messages:"error_message[]",abi_extensions:"extensions_type[]"}},table_def:{base:"",fields:{name:"table_name",index_type:"type_name",key_names:"field_name[]",key_types:"type_name[]",type:"type_name"}},permission_level:{base:"",fields:{actor:"account_name",permission:"permission_name"}},action:{base:"",fields:{name:"action_name"}},action_def:{base:"",fields:{name:"string",type:"type_name"}}}},function(e,t,r){const n=r(24),i=r(0).Buffer;var o=function(){};o.prototype.encodeParams=function(e,t,r,o){let a="";if(!1===n.isString(e)||!1===n.isObject(t)||!1===n.isArray(r))return a;if(!1===n.isObject(t.schema)||!t.schema[e]||!r)return a;if(!1===n.isObject(t.schema[e])||!1===n.isObject(t.schema[e].fields))return a;let s=Object.keys(t.schema[e].fields);if(n.isArray(r)&&s.length!==r.length)return a;let c={},u=0;r&&n.isArray(r)&&s.forEach(function(e){c[e]=r[u],u++});const f=t.toBuffer(e,c),l=t.toBuffer("string",e),h=t.toBuffer("bytes",f),d=i.concat([l,h]);if(o){let e=new i(4);e.writeUInt32BE(d.length),a=e.toString("hex")+d.toString("hex")}else a=d.toString("hex");return a},o.prototype.decodeParam=function(e,t,r){return e&&t&&r?!1===n.isFunction(e.fromBuffer)?null:e.fromBuffer(t,r):null};var a=new o;e.exports=a},function(e,t,r){const n=r(121),i=r(12),o=r(328);class a extends o{constructor({eventCtr:e,ctr:t,eventListen:r,watchListen:n}){super(),this.eventCtr=e,this.ctr=t,this.filter_id=null,this.watchListen=n,r((e,t,r)=>{this.filter_id=e?"error":t.filter_id}),this.isWatch=!0}watch(){this.isWatch&&null!==this.filter_id&&"error"!==this.filter_id&&this.watchListen(this.filter_id,(e,t,r)=>{this.fire(e,t,r)})}stop(){this.isWatch=!1}start(){this.isWatch=!0}close(e){return this.eventCtr.removeEvent(this,(t,r,n)=>{this.destroyEvent(),"function"==typeof e&&e(t,r,n)}),this}}e.exports=class{constructor({ctr:e}){this.ctr=e,this.loopTime=6e3,this.timer=null,this.isLoop=!1,this.events=[],this.runLoop()}setLoopTime(e){this.loopTime=parseInt(e)||this.loopTime,this.runLoop()}runLoop(){const e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),function t(){e.isLoop=!0,e.timer=setTimeout(()=>{const r=e.events;for(let e=0;e{!r&&n&&0===n.return_code&&this._removeEvent(e),t(r,n,i)}):"error"===e.filter_id?this._removeEvent(e):setTimeout(()=>{this.removeEvent(e,t)},500)}_addEvent(e,{to:t,type:r},o){let s="";switch(e){case 0:s="Account";break;case 1:s="Contract";break;case 2:s="Topics";break;case 3:s="Block"}const c=new a({eventCtr:this,ctr:this.ctr,eventListen:e=>{this.ctr["Event"+s]({identity:t,type:r},(t,r,n)=>{"function"==typeof o&&o(t,r,n),e(t,r,n)})},watchListen:(e,t)=>{this.ctr.EventFetch({filter_id:e},(e,r,o)=>{if(r.event_data){const a=n.eventDataFormat(s,i.rlp_decode(r.event_data));a&&(r.event_data=a),t(e,r,o)}})}});return this.events.push(c),c}account(e,t){return this._addEvent(0,e,t)}contract(e,t){return this._addEvent(1,e,t)}topic(e,t){return this._addEvent(2,e,t)}block(e,t){return this._addEvent(3,e,t)}}},function(e,t){e.exports={MSG_TYPE_TX_REQ_CANCEL:0,MSG_TYPE_TX_REQ_LOCAL:1,MSG_TYPE_TX_REQ_ACCOUT_CREATE:2,MSG_TYPE_TX_REQ_TRANS_BALANCE:3,MSG_TYPE_TX_REQ_SET_RECOVERY_KEY:4,MSG_TYPE_TX_REQ_PRE_RESET_PUB_KEY:5,MSG_TYPE_TX_REQ_RESET_PUB_KEY:6,MSG_TYPE_TX_REQ_UPDATE_AUTH_MAP:7,MSG_TYPE_TX_REQ_CONTRACT_DEPLOY:8,MSG_TYPE_TX_REQ_CONTRACT_CALL:9,MSG_TYPE_TX_REQ_CONTRACT_UPDATE:10,MSG_TYPE_TX_REQ_UPDATE_ENCRYPTION_KEY:11,MSG_TYPE_TX_RESP_CANCEL:12,MSG_TYPE_TX_RESP_LOCAL:13,MSG_TYPE_TX_RESP_ACCOUT_CREATE:14,MSG_TYPE_TX_RESP_TRANS_BALANCE:15,MSG_TYPE_TX_RESP_SET_RECOVERY_KEY:16,MSG_TYPE_TX_RESP_PRE_RESET_PUB_KEY:17,MSG_TYPE_TX_RESP_RESET_PUB_KEY:18,MSG_TYPE_TX_RESP_UPDATE_AUTH_MAP:19,MSG_TYPE_TX_RESP_CONTRACT_DEPLOY:20,MSG_TYPE_TX_RESP_CONTRACT_CALL:21,MSG_TYPE_TX_RESP_CONTRACT_UPDATE:22,MSG_TYPE_TX_RESP_UPDATE_ENCRYPTION_KEY:23,MSG_TYPE_TX_REQ_FREEZE_ACCOUNT:24,MSG_TYPE_TX_RESP_FREEZE_ACCOUNT:25,MSG_TYPE_TX_REQ_UNFREEZE_ACCOUNT:26,MSG_TYPE_TX_RESP_UNFREEZE_ACCOUNT:27,MSG_TYPE_TX_REQ_FREEZE_CONTRACT:28,MSG_TYPE_TX_RESP_FREEZE_CONTRACT:29,MSG_TYPE_TX_REQ_UNFREEZE_CONTRACT:30,MSG_TYPE_TX_RESP_UNFREEZE_CONTRACT:31,MSG_TYPE_TX_REQ_ENCRYPTION_ENVELOP:32,MSG_TYPE_TX_RESP_ENCRYPTION_ENVELOP:33,MSG_TYPE_TX_REQ_DEPOSIT_ENVELOP:34,MSG_TYPE_TX_RESP_DEPOSIT_ENVELOP:35,MSG_TYPE_TX_REQ_NATIVE_DEPOSIT_DATA:36,MSG_TYPE_TX_RESP_NATIVE_DEPOSIT_DATA:37,MSG_TYPE_QUERY_REQ_TS:50,MSG_TYPE_QUERY_REQ_LAST_BLOCK:51,MSG_TYPE_QUERY_REQ_BLOCK_HEADER:52,MSG_TYPE_QUERY_REQ_BLOCK:53,MSG_TYPE_QUERY_REQ_ACCOUNT:54,MSG_TYPE_QUERY_REQ_TRANSACTION:55,MSG_TYPE_QUERY_REQ_TRANSACTION_RECEIPT:56,MSG_TYPE_QUERY_RESP_TS:57,MSG_TYPE_QUERY_RESP_LAST_BLOCK:58,MSG_TYPE_QUERY_RESP_BLOCK_HEADER:59,MSG_TYPE_QUERY_RESP_BLOCK:60,MSG_TYPE_QUERY_RESP_ACCOUNT:61,MSG_TYPE_QUERY_RESP_TRANSACTION:62,MSG_TYPE_QUERY_RESP_TRANSACTION_RECEIPT:63,MSG_TYPE_QUERY_REQ_CONTRACT:64,MSG_TYPE_QUERY_RESP_CONTRACT:65,MSG_TYPE_QUERY_REQ_LAST_BLOCK_HEADER:66,MSG_TYPE_QUERY_RESP_LAST_BLOCK_HEADER:67,MSG_TYPE_QUERY_REQ_BLOCK_PROOF:68,MSG_TYPE_QUERY_RESP_BLOCK_PROOF:69,MSG_TYPE_QUERY_REQ_LATEST_STATE_PROOF:70,MSG_TYPE_QUERY_RESP_LATEST_STATE_PROOF:71,MSG_TYPE_QUERY_REQ_TRANSACTION_PROOF:72,MSG_TYPE_QUERY_RESP_TRANSACTION_PROOF:73,MSG_TYPE_QUERY_REQ_BLOCK_HEADER_INFOS:74,MSG_TYPE_QUERY_RESP_BLOCK_HEADER_INFOS:75,MSG_TYPE_QUERY_REQ_BLOCK_RECEIPTS:76,MSG_TYPE_QUERY_RESP_BLOCK_RECEIPTS:77,MSG_TYPE_QUERY_REQ_BLOCK_BODY_INFOS:78,MSG_TYPE_QUERY_RESP_BLOCK_BODY_INFOS:79,MSG_TYPE_QUERY_REQ_STATE_PROOF:80,MSG_TYPE_QUERY_RESP_STATE_PROOF:81,MSG_TYPE_QUERY_REQ_RECEIPT_PROOF:82,MSG_TYPE_QUERY_RESP_RECEIPT_PROOF:83,MSG_TYPE_QUERY_REQ_HOST_INFO:84,MSG_TYPE_QUERY_RESP_HOST_INFO:85,MSG_TYPE_QUERY_REQ_TRANSACTION_LIST:94,MSG_TYPE_QUERY_RESP_TRANSACTION_LIST:95,MSG_TYPE_QUERY_REQ_TX_AND_RECEIPT:96,MSG_TYPE_QUERY_RESP_TX_AND_RECEIPT:97,MSG_TYPE_STATUS_REQ_P2P:100,MSG_TYPE_STATUS_RESP_P2P:101,MSG_TYPE_STATUS_REQ_CONSENSUS:102,MSG_TYPE_STATUS_RESP_PBFT:103,MSG_TYPE_STATUS_REQ_SYNC:104,MSG_TYPE_STATUS_RESP_SYNC:105,MSG_TYPE_STATUS_REQ_TX_CACHE:106,MSG_TYPE_STATUS_RESP_TX_CACHE:107,MSG_TYPE_STATUS_REQ_BLOCK_CACHE:108,MSG_TYPE_STATUS_RESP_BLOCK_CACHE:109,MSG_TYPE_STATUS_REQ_CONTRACT_NODES:110,MSG_TYPE_STATUS_RESP_CONTRACT_NODES:111,MSG_TYPE_STATUS_REQ_CONTRACT_CONFIG:112,MSG_TYPE_STATUS_RESP_CONTRACT_CONFIG:113,MSG_TYPE_EVENT_REQ_ACCOUNT:120,MSG_TYPE_EVENT_REQ_CONTRACT:121,MSG_TYPE_EVENT_REQ_TOPICS:122,MSG_TYPE_EVENT_REQ_BLOCK:123,MSG_TYPE_EVENT_RESP_FILTER_ID:124,MSG_TYPE_EVENT_REQ_FETCH:125,MSG_TYPE_EVENT_RESP_FETCH:136,MSG_TYPE_EVENT_PUSH_ACCOUNT:130,MSG_TYPE_EVENT_PUSH_CONTRACT:131,MSG_TYPE_EVENT_PUSH_TOPICS:132,MSG_TYPE_EVENT_PUSH_BLOCK:133,MSG_TYPE_EVENT_REQ_CANCEL:134,MSG_TYPE_EVENT_RESP_CANCEL:135,MSG_TYPE_ADMIN_REQ_UPDATE_LOG_LEVEL:150,MSG_TYPE_ADMIN_RESP_UPDATE_LOG_LEVEL:151,MSG_TYPE_ADMIN_REQ_LOG_LEVEL:152,MSG_TYPE_ADMIN_RESP_LOG_LEVEL:153,MSG_TYPE_ADMIN_REQ_UPDATE_BLACK_LIST:158,MSG_TYPE_ADMIN_RESP_UPDATE_BLACK_LIST:159,MSG_TYPE_ERROR:199,MSG_TYPE_STATUS_REQ_COMMON_CONSENSUS:200,MSG_TYPE_STATUS_RESP_COMMON_CONSENSUS:201,MSG_TYPE_TX_REQ_CONFIDENTIAL_TX:800,MSG_TYPE_TX_RESP_CONFIDENTIAL_TX:801}},function(e,t){e.exports={TX_CREATE_ACCOUNT:0,TX_TRANSFER_BALANCE:1,TX_DEPLOY_CONTRACT:10,TX_CALL_CONTRACT:11,TX_UPDATE_CONTRACT:12,TX_SET_RECOVER_KEY:20,TX_PRE_RESET_PUB_KEY:21,TX_RESET_PUB_KEY:22,TX_UPDATE_AUTH_MAP:23,TX_UPDATE_ENCRYPTION_KEY:24,TX_FREEZE_ACCOUNT_CONTRACT:25,TX_UNFREEZE_ACCOUNT_CONTRACT:26,TX_ACTIVATE_NODE:30,TX_NATIVE_DEPOSIT_DATA:40,TX_UNKNOWN:255,TX_ENCRYPTION_ENVELOPE:256,TX_DEPOSIT_ENVELOPE:257,TX_CONFIDENTIAL:500}},function(e,t,r){const{identity:n}=r(36),i={name:"balance",value:"",type:"decimal"},o={name:"recover_key",type:"bytes"},a={name:"recover_time",type:"decimal"},s={name:"status",type:"decimal"},c={name:"code",type:"bytes"},u={name:"storage_root",type:"bytes"},f={name:"code_hash",type:"hash"},l={name:"encryption_key",type:"bytes"},h={name:"auth_key",type:"bytes"},d={name:"auth_weight",type:"decimal"},p=[h,d];p.name="auth_map",p.type="array",p.array_type=2,p.rlp=!0,p.mapInfo={key:h,value:d};const b=[n,i,o,a,s,c,u,f,l,[{name:"acc_version",type:"decimal",value:2}],p],m=[n,i,o,a,s,c,u,f,l,h,d];b.name="data";const g=b;e.exports={balance:i,recover_key:o,recover_time:a,status:s,code:c,storage_root:u,code_hash:f,encryption_key:l,auth_map:p,auth_key:h,auth_weight:d,Account:b,OldAccount:m,Contract:g}},function(e,t){const r={name:"total_node_count",type:"decimal"},n={name:"total_consensus_node_count",type:"decimal"},i={name:"total_non_consensus_node_count",type:"decimal"},o={name:"total_connected_consensus_node_count",type:"decimal"},a={name:"total_connected_non_consensus_node_count",type:"decimal"},s={name:"isConnected",type:"decimal"},c={name:"node_id",type:"bytes",value:"0x00"},u={name:"ip",type:"string"},f={name:"port",type:"decimal"},l={name:"public_key",type:"bytes"},h={name:"node_role",type:"decimal"},d={name:"node_state",type:"decimal"},p=[u,f];p.name="endpoints",p.type="array";const b=[c,l,h,d,p],m=[b,s];m.name="node_status",m.type="array";const g=[r,n,i,o,a,m];g.name="p2p_status";const y=[c,l,h,d,p];y.name="node_info",y.type="array",e.exports={total_node_count:r,total_consensus_node_count:n,total_non_consensus_node_count:i,total_connected_consensus_node_count:o,total_connected_non_consensus_node_count:a,isConnected:s,node_id:c,access_ip:u,access_port:f,public_key:l,node_role:h,node_state:d,Node_info:b,Node_status:m,P2pStatus:g,NodeInfo:y}},function(e,t){const r={name:"syncing",type:"decimal"},n={name:"my_best",type:"decimal"},i={name:"target",type:"decimal"},o=[r,n,i];o.name="sync_status",e.exports={syncing:r,my_best:n,target:i,SyncStatus:o}},function(e,t){const r={name:"unverified_queue_limit",type:"decimal"},n={name:"verified_queue_limit",type:"decimal"},i={name:"unverified_queue_usage",type:"decimal"},o={name:"verified_queue_usage",type:"decimal"},a=[r,n,i,o];a.name="transaction_cache_info";const s={name:"verified_parent_not_found_queue_limit",type:"decimal"},c={name:"verified_parent_not_found_queue_usage",type:"decimal"},u={name:"unverified_max_block_number",type:"decimal"},f={name:"verified_max_block_number",type:"decimal"},l={name:"verified_parent_not_found_max_block_number",type:"decimal"},h=[r,n,s,i,o,c,u,f,l];h.name="block_cache_info",e.exports={unverified_queue_limit:r,verified_queue_limit:n,unverified_queue_usage:i,verified_queue_usage:o,TransactionCacheInfo:a,verified_parent_not_found_queue_limit:s,verified_parent_not_found_queue_usage:c,unverified_max_block_number:u,verified_max_block_number:f,verified_parent_not_found_max_block_number:l,BlockCacheInfo:h}},function(e,t){e.exports={cCode:{name:"code",type:"bytes"},parameter:{name:"parameter",type:"bytes"},payload:{name:"payload",type:"bytes"}}},function(e,t){e.exports={event_type:{name:"type",type:"decimal",value:0},filter_id:{name:"filter_id",type:"decimal"},event_data_type:{name:"event_type",type:"decimal"},event_data:{name:"event_data",type:"bytes"}}},function(e,t){const r=[{name:"type",type:"bytes"},{name:"phase",type:"string"},{name:"n",type:"decimal"},{name:"f",type:"decimal"},{name:"current_leader",type:"bytes"},{name:"my_id",type:"bytes"},{name:"current_view",type:"decimal"},{name:"last_exec_seq",type:"decimal"},{name:"propose_size",type:"decimal"},{name:"propose_timeout_interval",type:"decimal"},{name:"normal_timeout_interval",type:"decimal"},{name:"viewchange_timeout_interval",type:"decimal"}];r.name="info",e.exports={common_consensus_info:{name:"info",type:"bytes"},common_consensus_type:{name:"type",type:"decimal"},consensus_info:r}},function(e,t){const r=[{name:"black_list",type:"hash"}];r.name="black_list",r.type="array",e.exports={black_list:r}},function(e,t,r){const n=[{name:"type",type:"decimal"},{name:"proof",type:"bytes"}];n.name="block_proof_info";const i={name:"block_number",type:"decimal"},o=[{name:"data",type:"bytes"},{name:"next_key_begin_index",type:"decimal"},{name:"next_key_end_index",type:"decimal"}];o.name="nodes",o.type="array";const a=[i,{name:"state_root",type:"bytes"},o];a.name="proof";const s={name:"root",type:"bytes"},c={name:"index",type:"decimal"},u={name:"size",type:"decimal"},f={name:"branch",type:"decimal"},l=[i,s,c,u,f];l.name="proof";const h=[i,s,c,u,f];h.name="receipt_proof";const{BlockHeader:d}=r(62),p=[n,d];p.name="header_infos",p.type="array";const b={name:"block_hash",type:"hash"},{receipts:m}=r(61),g=[b,m];g.name="block_receipts",g.type="array";const{transactions:y}=r(123),_=[y,m,{name:"consensus_proof",type:"bytes"}];_.name="body";const v=[b,_];v.name="block_body",v.type="array",e.exports={block_proof:n,state_proof:a,transaction_proof:l,receipt_proof:h,max_amount:{name:"max_amount",type:"decimal"},reverse:{name:"reverse",type:"decimal"},header_infos:p,block_receipts:g,block_body:v}},function(e,t,r){const n=r(58),{handshake:i,hash:o,timestamp:a,msg_type:s,transaction_index:c,identity:u,level:f,gas_used:l,_from:h,to:d,group_id:p,return_code:b,Request:m,Response:g,transaction_type:y,nonce:_,period:v,value:w,gas:E,data:S,signature:T,Tx:A,result:I,log_entry:k,topics:R,log_data:x,output:B,Receipt:P,version:C,block_number:M,parent_hash:N,transaction_root:O,receipt_root:L,state_root:U,log_bloom:q,transaction_list:j,receipt_list:D,consensus_proof:z,BlockHeader:Y,BlockBody:K,Block:F,balance:G,recover_key:H,recover_time:Q,status:V,code:X,storage_root:W,code_hash:Z,encryption_key:$,auth_key:J,auth_weight:ee,auth_map:te,Account:re,Contract:ne,total_node_count:ie,total_consensus_node_count:oe,total_non_consensus_node_count:ae,total_connected_consensus_node_count:se,total_connected_non_consensus_node_count:ce,isConnected:ue,node_id:fe,access_ip:le,access_port:he,public_key:de,node_role:pe,node_state:be,Node_info:me,Node_status:ge,P2pStatus:ye,NodeInfo:_e,syncing:ve,my_best:we,target:Ee,SyncStatus:Se,unverified_queue_limit:Te,verified_queue_limit:Ae,unverified_queue_usage:Ie,verified_queue_usage:ke,TransactionCacheInfo:Re,verified_parent_not_found_queue_limit:xe,verified_parent_not_found_queue_usage:Be,unverified_max_block_number:Pe,verified_max_block_number:Ce,verified_parent_not_found_max_block_number:Me,BlockCacheInfo:Ne,cCode:Oe,parameter:Le,event_type:Ue,filter_id:qe,event_data_type:je,event_data:De,common_consensus_info:ze,common_consensus_type:Ye,consensus_info:Ke,transaction_infos:Fe,transactions:Ge,configs:He,black_list:Qe,block_proof:Ve,state_proof:Xe,transaction_proof:We,receipt_proof:Ze,reverse:$e,max_amount:Je,header_infos:et,block_receipts:tt,block_body:rt}=r(122),nt={};nt[n.CreateAccount]={return_code:b,hash:o},nt[n.TransferBalance]={return_code:b,hash:o},nt[n.SetRecoverkey]={return_code:b,hash:o},nt[n.PreResetPubKey]={return_code:b,hash:o},nt[n.ResetPubKey]={return_code:b,hash:o},nt[n.UpdateAuthMap]={return_code:b,hash:o},nt[n.NativeDepositData]={return_code:b,hash:o},nt[n.QueryLastBlock]={return_code:b,block:F,header:Y,body:K,hash:o,version:C,number:M,parent_hash:N,transaction_root:O,receipt_root:L,state_root:U,gas_used:l,timestamp:a,log_bloom:q,transaction_list:j,receipt_list:D,consensus_proof:z},nt[n.QueryBlockHeader]={return_code:b,block:F,header:Y,hash:o,version:C,number:M,parent_hash:N,transaction_root:O,receipt_root:L,state_root:U,gas_used:l,timestamp:a,log_bloom:q},nt[n.QueryLastBlockHeader]={return_code:b,block:F,header:Y,hash:o,version:C,number:M,parent_hash:N,transaction_root:O,receipt_root:L,state_root:U,gas_used:l,timestamp:a,log_bloom:q},nt[n.QueryBlock]={return_code:b,block:F,header:Y,body:K,hash:o,version:C,number:M,parent_hash:N,transaction_root:O,receipt_root:L,state_root:U,gas_used:l,timestamp:a,log_bloom:q,transaction_list:j,receipt_list:D,consensus_proof:z},nt[n.QueryTransaction]={return_code:b,block_number:M,transaction_index:c,transaction:A,hash:o,type:y,timestamp:a,nonce:_,period:v,from:h,to:d,value:w,gas:E,group_id:p,data:S,signature:T[0]},nt[n.QueryTransactionReceipt]={return_code:b,block_number:M,transaction_index:c,receipt:P,result:I,gas_used:l,logs:k,from:h,to:d,topics:R,log_data:x,output:B},nt[n.QueryTransactionList]={return_code:b,transactions:Ge},nt[n.QueryTransactionAndReceipt]={return_code:b,transaction_infos:Fe},nt[n.QueryAccount]={return_code:b,block_number:M,account:re,id:u,balance:G,recovery_key:H,recovery_time:Q,status:V,code:X,storage_root:W,code_hash:Z,encryption_key:$,auth_map:te},nt[n.QueryContract]={return_code:b,block_number:M,contract:ne,id:u,balance:G,recovery_key:H,recovery_time:Q,status:V,code:X,storage_root:W,code_hash:Z,encryption_key:$,auth_map:te},nt[n.QueryTimestamp]={return_code:b,timestamp:a},nt[n.QueryP2PStatus]={return_code:b,p2p_status:ye,total_node_count:ie,total_consensus_node_count:oe,total_non_consensus_node_count:ae,total_connected_consensus_node_count:se,total_connected_non_consensus_node_count:ce,node_status:ge,node_id:fe,access_ip:le,access_port:he,public_key:de,node_role:pe,node_state:be,is_connected:ue},nt[n.QueryConsensusStatus]={return_code:b,consensus_info:Ke},nt[n.QueryCommonConsensusStatus]={return_code:b,common_consensus_type:Ye,common_consensus_info:ze},nt[n.QuerySyncStatus]={return_code:b,sync_status:Se,syncing:ve,my_best:we,target:Ee},nt[n.QueryTransactionCacheStatus]={return_code:b,transaction_cache_info:Re,unverified_queue_limit:Te,verified_queue_limit:Ae,unverified_queue_usage:Ie,verified_queue_usage:ke},nt[n.QueryBlockCacheStatus]={return_code:b,block_cache_info:Ne,unverified_queue_limit:Te,verified_queue_limit:Ae,verified_parent_not_found_queue_limit:xe,unverified_queue_usage:Ie,verified_queue_usage:ke,verified_parent_not_found_queue_usage:Be,unverified_max_block_number:Pe,verified_max_block_number:Ce,verified_parent_not_found_max_block_number:Me},nt[n.QueryContractNodesStatus]={return_code:b,nodes:_e,node_id:fe,access_ip:le,access_port:he,public_key:de,node_role:pe,node_state:be},nt[n.QueryContractConfigStatus]={return_code:b,configs:He},nt[n.QueryBlockProof]={return_code:b,block_proof:Ve},nt[n.QueryLatestStateProof]={return_code:b,state_proof:Xe},nt[n.QueryStateProof]={return_code:b,state_proof:Xe},nt[n.QueryTransactionProof]={return_code:b,transaction_proof:We},nt[n.QueryReceiptProof]={return_code:b,receipt_proof:Ze},nt[n.QueryBlockHeaderInfos]={return_code:b,header_infos:et},nt[n.QueryBlockReceiptInfos]={return_code:b,block_receipts:tt},nt[n.QueryBlockBodyInfos]={return_code:b,block_body:rt},nt[n.DeployContract]={return_code:b,hash:o},nt[n.UpdateContract]={return_code:b,hash:o},nt[n.CallContract]={return_code:b,hash:o},nt[n.LocalTransaction]={return_code:b,hash:o,block_number:M,transaction_index:c,receipt:P,result:I,gas_used:l,logs:k,from:h,to:d,topics:R,log_data:x,output:B},nt[n.EncryptedTransaction]={return_code:b,hash:o,block_number:M,transaction_index:c,receipt:P,result:I,gas_used:l,logs:k,from:h,to:d,topics:R,log_data:x,output:B},nt[n.EventAccount]={return_code:b,filter_id:qe},nt[n.EventContract]={return_code:b,filter_id:qe},nt[n.EventTopics]={return_code:b,filter_id:qe},nt[n.EventBlock]={return_code:b,filter_id:qe},nt[n.EventFetch]={return_code:b,event_type:je,event_data:De},nt[n.EventCancel]={return_code:b},nt[n.UpdateBlackList]={return_code:b},e.exports=nt},function(e,t,r){(function(t){const n=r(12),i=r(59),o=r(35),a=r(4);function s(e){return n.isBuffer(e)&&(e=e.toString("hex")),e?"0x"+e:""}e.exports={inputdecimal:function(e){return n.toDecimal(e)},inputhash:function e(t){if(n.isString(t)){if(0===t.indexOf("0x")){if(66===t.length)return t;if(t.length<66)return"0x"+n.padEnd(n.toHex(t).slice(2),64)}return n.getHash(t)}if(n.isBuffer(t))return n.bufferToHex(t);if(n.isArray(t)){const r=[];for(let n=0;n{"function"==typeof s&&(r&&r.params&&(r=r.params),s(t,a(e,r)))},c)}}_send(e,t,r,n,i){const o={version:e,method:t,params:r};this.send(o,n,i)}send(e,t,r){this.sender.send(e,t,r)}setSender(e,t,r){return this.sender=new o(e),"function"==typeof r&&setTimeout(()=>{r(null,this.sender)},1),this.sender}}},function(e,t){e.exports={CreateAccount:"transaction_CreateAccount",QueryTransactionReceipt:"query_TransactionReceipt",TransferBalance:"transaction_TransferBalance",SetRecoverkey:"transaction_SetRecoveryKey",PreResetPubKey:"transaction_PreResetPubKey",ResetPubKey:"transaction_ResetPubKey",UpdateAuthMap:"transaction_UpdateAuthMap",NativeDepositData:"transaction_NativeDepositData",QueryLastBlock:"query_LastBlock",QueryBlockHeader:"query_BlockHeader",QueryLastBlockHeader:"query_LastBlockHeader",QueryBlock:"query_Block",QueryTransaction:"query_Transaction",QueryAccount:"query_Account",QueryContract:"query_Contract",QueryTransactionList:"query_TransactionList",QueryTransactionAndReceipt:"query_Transaction_And_Receipt",QueryTimestamp:"query_NodeTimestamp",QueryP2PStatus:"query_P2pStatus",QueryConsensusStatus:"query_ConsensusStatus",QueryCommonConsensusStatus:"query_CommonConsensusStatus",QuerySyncStatus:"query_SyncStatus",QueryTransactionCacheStatus:"query_TransactionCacheStatus",QueryBlockCacheStatus:"query_BlockCacheStatus",QueryContractNodesStatus:"query_ContractNodes",QueryContractConfigStatus:"query_ContractConfig",QueryLogLevel:"admin_LogLevel",QueryBlockProof:"query_BlockProof",QueryLatestStateProof:"query_LatestStateProof",QueryStateProof:"query_StateProof",QueryTransactionProof:"query_TransactionProof",QueryReceiptProof:"query_ReceiptProof",QueryBlockHeaderInfos:"query_BlockHeaderInfos",QueryBlockReceiptInfos:"query_BlockReceiptInfos",QueryBlockBodyInfos:"query_BlockBodyInfos",DeployContract:"transaction_DeployContract",UpdateContract:"transaction_UpdateContract",CallContract:"transaction_CallContract",LocalTransaction:"transaction_Local",EncryptedTransaction:"transaction_ConfidentialTransaction",EventAccount:"event_Account",EventContract:"event_Contract",EventTopics:"event_Topics",EventBlock:"event_Block",EventFetch:"event_Fetch",EventCancel:"event_Cancel",UpdateBlackList:"admin_UpdateBlackList"}},function(e,t,r){const n=r(35);let i=null;i="undefined"!=typeof dd||"undefined"!=typeof my?r(332):"undefined"!=typeof window&&window.XMLHttpRequest?window.XMLHttpRequest:r(333);e.exports=class{constructor({host:e,port:t,clients:r,headers:n,timeout:i,senderData:o,cert:a,ca:s,key:c,passphrase:u}){e&&t?(Array.isArray(r)||(r=[]),r=[{host:e,port:t}].concat(r)):Array.isArray(r)&&r.length&&(e=r[0].host,t=r[0].port),this.senderData=o||null,this.clients=r||[],this.currentClient=0,this.resetConnect({host:e,port:t,headers:n,timeout:i,cert:a,ca:s,key:c,passphrase:u})}open(){const e=new i({cert:this.cert,ca:this.ca,key:this.key,passphrase:this.passphrase,ciphers:"ALL",ecdhCurve:"secp256k1:prime256v1"});return e.withCredentials=!0,e.open("POST",this.host,!0),e.timeout=this.timeout,e.setRequestHeader("Content-Type","application/json"),this.setHeaders(e,this.headers),this.request=e,e}setConfig({host:e,port:t,headers:r,timeout:n,cert:i,ca:o,key:a,passphrase:s}){const c=e+(t?":"+t:"");this.host=c||"http://localhost:7001",this.headers=r,this.timeout=n||5e3,this.cert=i||"",this.ca=o||"",this.key=a||"",this.passphrase=s||""}resetConnect(e){this.setConfig(e)}setHeaders(e,t){Array.isArray(t)&&t.forEach(t=>{e.setRequestHeader(t.name,t.value)})}send(e,t,r){if(this.senderData&&"function"==typeof this.senderData.clientSender&&!this.senderData.clientSender(i,e,t,r))return;const o=this.open();this.setHeaders(o,r?r.headers:null);let a=e;this.senderData&&"function"==typeof this.senderData.request&&(a=this.senderData.request(e));try{o.send(JSON.stringify(a))}catch(e){return void t(n.connection(this.host))}o.onreadystatechange=(()=>{if(4===o.readyState&&1!==o.timeout){let r=o.responseText,i=null;if(200===o.status)try{r=JSON.parse(r)||{}}catch(e){i=n.response()}else{this.currentClient++;const o=this.clients[this.currentClient];if(o)return void setTimeout(()=>{this.resetConnect({host:o.host,port:o.port,headers:this.headers,timeout:this.timeout,cert:this.cert,ca:this.ca,key:this.key,passphrase:this.passphrase}),this.send(e,t)},1e3);i=n.connection(this.host),r={}}this.senderData&&"function"==typeof this.senderData.response&&(r=this.senderData.response(r)),t(i,r)}}),o.ontimeout=(()=>{t(n.timeout())})}}},function(e,t){e.exports=class{constructor(){this.headers={},this.method="POST",this.url="",this.onreadystatechange=function(){}}open(e,t){this.method=e||this.method,this.url=t||""}setRequestHeader(e,t){this.headers||(this.headers={}),this.headers[e]=t}send(e){let t=null;"undefined"!=typeof dd?t=dd.httpRequest:"undefined"!=typeof my&&(t=my.httpRequest,my.canIUse("request")&&(t=my.request)),t&&t({url:this.url,method:this.method,headers:this.headers,data:e,dataType:"json",success:e=>{const t=e.status;let r="";200===t&&(r=JSON.stringify(e.data)||"{}"),this.status=t,this.readyState=4,this.responseText=r,this.onreadystatechange(this)},fail:e=>{const t=e.status||400;let r="";e.data&&(r=JSON.stringify(e.data)||"{}"),this.status=t,this.readyState=4,this.responseText=r,this.onreadystatechange(this)}})}}},function(e,t,r){(function(t,n){ /** * Wrapper for built-in http.js to emulate the browser XMLHttpRequest object. * * This can be used with JS designed for browsers to improve reuse of code and * allow the use of existing libraries. * * Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs. * * @author Dan DeFelippi * @contributor David Ellis * @license MIT */ var i=r(334),o=r(63);e.exports=function(e){"use strict";e=e||{};var a,s,c=this,u=r(124),f=r(344),l={},h=!1,d={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},p=Object.assign({},d),b=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],m=["TRACE","TRACK","CONNECT"],g=!1,y=!1,_={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null,this.open=function(e,t,r,n,i){if(this.abort(),y=!1,!function(e){return e&&-1===m.indexOf(e)}(e))throw"SecurityError: Request method not allowed";l={method:e,url:t.toString(),async:"boolean"!=typeof r||r,user:n||null,password:i||null},v(this.OPENED)},this.setDisableHeaderCheck=function(e){h=e},this.setRequestHeader=function(e,t){if(this.readyState!=this.OPENED)throw"INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN";if(!function(e){return h||e&&-1===b.indexOf(e.toLowerCase())}(e))return console.warn('Refused to set unsafe header "'+e+'"'),!1;if(g)throw"INVALID_STATE_ERR: send flag is true";return p[e]=t,!0},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&s.headers[e.toLowerCase()]&&!y?s.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-f,E=Math.floor,S=String.fromCharCode;function T(e){throw new RangeError(v[e])}function A(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+A((e=e.replace(_,".")).split("."),t).join(".")}function k(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=S((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=S(e)}).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function B(e,t,r){var n=0;for(e=r?E(e/d):e>>1,e+=E(e/t);e>w*l>>1;n+=u)e=E(e/w);return E(n+(w+1)*e/(e+h))}function P(e){var t,r,n,i,o,a,s,h,d,g,y,_=[],v=e.length,w=0,S=b,A=p;for((r=e.lastIndexOf(m))<0&&(r=0),n=0;n=128&&T("not-basic"),_.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=v&&T("invalid-input"),((h=(y=e.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||h>E((c-w)/a))&&T("overflow"),w+=h*a,!(h<(d=s<=A?f:s>=A+l?l:s-A));s+=u)a>E(c/(g=u-d))&&T("overflow"),a*=g;A=B(w-o,t=_.length+1,0==o),E(w/t)>c-S&&T("overflow"),S+=E(w/t),w%=t,_.splice(w++,0,S)}return R(_)}function C(e){var t,r,n,i,o,a,s,h,d,g,y,_,v,w,A,I=[];for(_=(e=k(e)).length,t=b,r=0,o=p,a=0;a<_;++a)(y=e[a])<128&&I.push(S(y));for(n=i=I.length,i&&I.push(m);n<_;){for(s=c,a=0;a<_;++a)(y=e[a])>=t&&yE((c-r)/(v=n+1))&&T("overflow"),r+=(s-t)*v,t=s,a=0;a<_;++a)if((y=e[a])c&&T("overflow"),y==t){for(h=r,d=u;!(h<(g=d<=o?f:d>=o+l?l:d-o));d+=u)A=h-g,w=u-g,I.push(S(x(g+A%w,0))),h=E(A/w);I.push(S(x(h,0))),o=B(r,v,n==i),r=0,++n}++r,++t}return I.join("")}s={version:"1.4.1",ucs2:{decode:k,encode:R},decode:P,encode:C,toASCII:function(e){return I(e,function(e){return y.test(e)?"xn--"+C(e):e})},toUnicode:function(e){return I(e,function(e){return g.test(e)?P(e.slice(4).toLowerCase()):e})}},void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(65)(e),r(7))},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(338),t.encode=t.stringify=r(339)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var f=0;f=0?(l=b.substr(0,m),h=b.substr(m+1)):(l=b,h=""),d=decodeURIComponent(l),p=decodeURIComponent(h),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],function(e){return s+encodeURIComponent(n(e))}).join(t):s+encodeURIComponent(n(e[a]))}).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;ne),this.response=(e=>e),e&&("function"==typeof e.clientSender&&(this.clientSender=e.clientSender),"function"==typeof e.request&&(this.request=e.request),"function"==typeof e.response&&(this.response=e.response))}}}])});