text: /*! For license information please see index.min.js.LICENSE.txt */
  !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Libp2pCrypto=e():t.Libp2pCrypto=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=45)}([function(t,e,r){"use strict";t.exports={options:{usePureJavaScript:!1}}},function(t,e,r){"use strict";(function(t){var n=r(47),i=r(48),a=r(49);function s(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=f.prototype:(null===t&&(t=new f(e)),t.length=e),t}function f(t,e,r){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);f.TYPED_ARRAY_SUPPORT?(t=e).__proto__=f.prototype:t=d(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!f.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=o(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(f.isBuffer(e)){var r=0|l(e.length);return 0===(t=o(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?o(t,0):d(t,e);if("Buffer"===e.type&&a(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(u(e),t=o(t,e<0?0:0|l(e)),!f.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|l(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function l(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(n)return z(t).length;e=(""+e).toLowerCase(),n=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return B(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=f.from(e,n)),f.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var a,s=1,o=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,o/=2,f/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var u=-1;for(a=r;a<o;a++)if(c(t,a)===c(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===f)return u*s}else-1!==u&&(a-=a-u),u=-1}else for(r+f>o&&(r=o-f),a=r;a>=0;a--){for(var h=!0,d=0;d<f;d++)if(c(t,a+d)!==c(e,d)){h=!1;break}if(h)return a}return-1}function v(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o=parseInt(e.substr(2*s,2),16);if(isNaN(o))return s;t[r+s]=o}return s}function w(t,e,r,n){return q(z(e,t.length-r),t,r,n)}function S(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function E(t,e,r,n){return S(t,e,r,n)}function k(t,e,r,n){return q(j(e),t,r,n)}function A(t,e,r,n){return q(function(t,e){for(var r,n,i,a=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function B(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a,s,o,f,c=t[i],u=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(f=(31&c)<<6|63&a)>127&&(u=f);break;case 3:a=t[i+1],s=t[i+2],128==(192&a)&&128==(192&s)&&(f=(15&c)<<12|(63&a)<<6|63&s)>2047&&(f<55296||f>57343)&&(u=f);break;case 4:a=t[i+1],s=t[i+2],o=t[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(f=(15&c)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&f<1114112&&(u=f)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=f,e.SlowBuffer=function(t){+t!=t&&(t=0);return f.alloc(+t)},e.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=s(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,e,r){return c(null,t,e,r)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,e,r){return function(t,e,r,n){return u(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}(null,t,e,r)},f.allocUnsafe=function(t){return h(null,t)},f.allocUnsafeSlow=function(t){return h(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,e){if(!f.isBuffer(t)||!f.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=f.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!f.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},f.byteLength=p,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)y(this,e,e+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?I(this,0,t):b.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,e,r,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),o=Math.min(a,s),c=this.slice(n,i),u=t.slice(e,r),h=0;h<o;++h)if(c[h]!==u[h]){a=c[h],s=u[h];break}return a<s?-1:s<a?1:0},f.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},f.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},f.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},f.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return S(this,t,e,r);case"latin1":case"binary":return E(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function C(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;++a)i+=O(t[a]);return i}function _(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,i,a){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function P(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i<a;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i<a;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function N(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function K(t,e,r,n,a){return a||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function U(t,e,r,n,a){return a||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}f.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),f.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=f.prototype;else{var i=e-t;r=new f(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+t]}return r},f.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},f.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},f.prototype.readUInt8=function(t,e){return e||x(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,e){return e||x(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,e){return e||x(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,e){return e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,e){return e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},f.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||x(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},f.prototype.readInt8=function(t,e){return e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,e){e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt16BE=function(t,e){e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},f.prototype.readInt32LE=function(t,e){return e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,e){return e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,e){return e||x(t,4,this.length),i.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,e){return e||x(t,8,this.length),i.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},f.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},f.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},f.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},f.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},f.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},f.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},f.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var a=0,s=1,o=0;for(this[e]=255&t;++a<r&&(s*=256);)t<0&&0===o&&0!==this[e+a-1]&&(o=1),this[e+a]=(t/s>>0)-o&255;return e+r},f.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[e+a]=255&t;--a>=0&&(s*=256);)t<0&&0===o&&0!==this[e+a+1]&&(o=1),this[e+a]=(t/s>>0)-o&255;return e+r},f.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},f.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},f.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},f.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},f.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},f.prototype.writeFloatLE=function(t,e,r){return K(this,t,e,!0,r)},f.prototype.writeFloatBE=function(t,e,r){return K(this,t,e,!1,r)},f.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},f.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},f.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,a=n-r;if(this===t&&r<e&&e<n)for(i=a-1;i>=0;--i)t[i+e]=this[i+r];else if(a<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},f.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var s=f.isBuffer(t)?t:z(new f(t,n).toString()),o=s.length;for(a=0;a<r-e;++a)this[a+e]=s[a%o]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function O(t){return t<16?"0"+t.toString(16):t.toString(16)}function z(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function j(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(13))},function(t,e,r){"use strict";(function(e,n,i,a){var s=r(0),o=r(55),f=t.exports=s.util=s.util||{};function c(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function u(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(f.isArrayBuffer(t)||f.isArrayBufferView(t))if(void 0!==a&&t instanceof a)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(n){for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof u||"object"==typeof t&&"string"==typeof t.data&&"number"==typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if(void 0!==e&&e.nextTick&&!e.browser)return f.nextTick=e.nextTick,void(f.setImmediate="function"==typeof n?n:f.nextTick);if("function"==typeof n)return f.setImmediate=function(){return n.apply(void 0,arguments)},void(f.nextTick=function(t){return n(t)});if(f.setImmediate=function(t){setTimeout(t,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var t="forge.setImmediate",r=[];f.setImmediate=function(e){r.push(e),1===r.length&&window.postMessage(t,"*")},window.addEventListener("message",(function(e){if(e.source===window&&e.data===t){e.stopPropagation();var n=r.slice();r.length=0,n.forEach((function(t){t()}))}}),!0)}if("undefined"!=typeof MutationObserver){var i=Date.now(),a=!0,s=document.createElement("div");r=[];new MutationObserver((function(){var t=r.slice();r.length=0,t.forEach((function(t){t()}))})).observe(s,{attributes:!0});var o=f.setImmediate;f.setImmediate=function(t){Date.now()-i>15?(i=Date.now(),o(t)):(r.push(t),1===r.length&&s.setAttribute("a",a=!a))}}f.nextTick=f.setImmediate}(),f.isNodejs=void 0!==e&&e.versions&&e.versions.node,f.globalScope=f.isNodejs?i:"undefined"==typeof self?window:self,f.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},f.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},f.isArrayBufferView=function(t){return t&&f.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},f.ByteBuffer=u,f.ByteStringBuffer=u;f.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},f.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},f.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},f.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},f.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},f.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},f.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(f.encodeUtf8(t))},f.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},f.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},f.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},f.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},f.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},f.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},f.ByteStringBuffer.prototype.putInt=function(t,e){c(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},f.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},f.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},f.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},f.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},f.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t},f.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t},f.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},f.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t},f.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t},f.ByteStringBuffer.prototype.getInt=function(t){c(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},f.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},f.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},f.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},f.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},f.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},f.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},f.ByteStringBuffer.prototype.copy=function(){var t=f.createBuffer(this.data);return t.read=this.read,t},f.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},f.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},f.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},f.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t},f.ByteStringBuffer.prototype.toString=function(){return f.decodeUtf8(this.bytes())},f.DataBuffer=function(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=f.isArrayBuffer(t),n=f.isArrayBufferView(t);if(r||n)return this.data=r?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)},f.DataBuffer.prototype.length=function(){return this.write-this.read},f.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},f.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},f.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},f.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this},f.DataBuffer.prototype.putBytes=function(t,e){if(f.isArrayBufferView(t)){var r=(n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(f.isArrayBuffer(t)){var n=new Uint8Array(t);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(t instanceof f.DataBuffer||"object"==typeof t&&"number"==typeof t.read&&"number"==typeof t.write&&f.isArrayBufferView(t.data)){n=new Uint8Array(t.data.byteLength,t.read,t.length());return this.accommodate(n.byteLength),new Uint8Array(t.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(t instanceof f.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"==typeof t){var i;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=f.binary.hex.decode(t,i,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=f.binary.base64.decode(t,i,this.write),this;if("utf8"===e&&(t=f.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=f.binary.raw.decode(i),this;if("utf16"===e)return this.accommodate(2*t.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=f.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},f.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},f.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},f.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},f.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},f.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},f.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},f.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},f.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},f.DataBuffer.prototype.putInt=function(t,e){c(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},f.DataBuffer.prototype.putSignedInt=function(t,e){return c(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},f.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},f.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},f.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},f.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},f.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},f.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},f.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},f.DataBuffer.prototype.getInt=function(t){c(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},f.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},f.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},f.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},f.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},f.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},f.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},f.DataBuffer.prototype.copy=function(){return new f.DataBuffer(this)},f.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},f.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},f.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},f.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t},f.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return f.binary.raw.encode(e);if("hex"===t)return f.binary.hex.encode(e);if("base64"===t)return f.binary.base64.encode(e);if("utf8"===t)return f.text.utf8.decode(e);if("utf16"===t)return f.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},f.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=f.encodeUtf8(t)),new f.ByteBuffer(t)},f.fillString=function(t,e){for(var r="";e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},f.xorBytes=function(t,e,r){for(var n="",i="",a="",s=0,o=0;r>0;--r,++s)i=t.charCodeAt(s)^e.charCodeAt(s),o>=10&&(n+=a,a="",o=0),a+=String.fromCharCode(i),++o;return n+=a},f.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e},f.bytesToHex=function(t){return f.createBuffer(t).toHex()},f.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";f.encode64=function(t,e){for(var r,n,i,a="",s="",o=0;o<t.length;)r=t.charCodeAt(o++),n=t.charCodeAt(o++),i=t.charCodeAt(o++),a+=h.charAt(r>>2),a+=h.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=h.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":h.charAt(63&i)),e&&a.length>e&&(s+=a.substr(0,e)+"\r\n",a=a.substr(e));return s+=a},f.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,a="",s=0;s<t.length;)e=d[t.charCodeAt(s++)-43],r=d[t.charCodeAt(s++)-43],n=d[t.charCodeAt(s++)-43],i=d[t.charCodeAt(s++)-43],a+=String.fromCharCode(e<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},f.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},f.decodeUtf8=function(t){return decodeURIComponent(escape(t))},f.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:o.encode,decode:o.decode}},f.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},f.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n},f.binary.hex.encode=f.bytesToHex,f.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2)));var i=0,a=r=r||0;for(1&t.length&&(i=1,n[a++]=parseInt(t[0],16));i<t.length;i+=2)n[a++]=parseInt(t.substr(i,2),16);return e?a-r:n},f.binary.base64.encode=function(t,e){for(var r,n,i,a="",s="",o=0;o<t.byteLength;)r=t[o++],n=t[o++],i=t[o++],a+=h.charAt(r>>2),a+=h.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=h.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":h.charAt(63&i)),e&&a.length>e&&(s+=a.substr(0,e)+"\r\n",a=a.substr(e));return s+=a},f.binary.base64.decode=function(t,e,r){var n,i,a,s,o=e;o||(o=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var f=0,c=r=r||0;f<t.length;)n=d[t.charCodeAt(f++)-43],i=d[t.charCodeAt(f++)-43],a=d[t.charCodeAt(f++)-43],s=d[t.charCodeAt(f++)-43],o[c++]=n<<2|i>>4,64!==a&&(o[c++]=(15&i)<<4|a>>2,64!==s&&(o[c++]=(3&a)<<6|s));return e?c-r:o.subarray(0,c)},f.binary.base58.encode=function(t,e){return f.binary.baseN.encode(t,l,e)},f.binary.base58.decode=function(t,e){return f.binary.baseN.decode(t,l,e)},f.text={utf8:{},utf16:{}},f.text.utf8.encode=function(t,e,r){t=f.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,a=0;a<t.length;++a)n[i++]=t.charCodeAt(a);return e?i-r:n},f.text.utf8.decode=function(t){return f.decodeUtf8(String.fromCharCode.apply(null,t))},f.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(2*t.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,s=r,o=0;o<t.length;++o)i[s++]=t.charCodeAt(o),a+=2;return e?a-r:n},f.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},f.deflate=function(t,e,r){if(e=f.decode64(t.deflate(f.encode64(e)).rval),r){var n=2;32&e.charCodeAt(1)&&(n=6),e=e.substring(n,e.length-4)}return e},f.inflate=function(t,e,r){var n=t.inflate(f.encode64(e)).rval;return null===n?null:f.decode64(n)};var p=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(null===r?n=t.removeItem(e):(r=f.encode64(JSON.stringify(r)),n=t.setItem(e,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},b=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(f.decode64(r))),r},y=function(t,e,r,n){var i=b(t,e);null===i&&(i={}),i[r]=n,p(t,e,i)},g=function(t,e,r){var n=b(t,e);return null!==n&&(n=r in n?n[r]:null),n},m=function(t,e,r){var n=b(t,e);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),p(t,e,n)}},v=function(t,e){p(t,e,null)},w=function(t,e,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,s=null;for(var o in r){n=r[o];try{if("flash"===n||"both"===n){if(null===e[0])throw new Error("Flash local storage not available.");i=t.apply(this,e),a="flash"===n}"web"!==n&&"both"!==n||(e[0]=localStorage,i=t.apply(this,e),a=!0)}catch(f){s=f}if(a)break}if(!a)throw s;return i};f.setItem=function(t,e,r,n,i){w(y,arguments,i)},f.getItem=function(t,e,r,n){return w(g,arguments,n)},f.removeItem=function(t,e,r,n){w(m,arguments,n)},f.clearItems=function(t,e,r){w(v,arguments,r)},f.parseUrl=function(t){var e=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;e.lastIndex=0;var r=e.exec(t),n=null===r?null:{full:t,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var S=null;f.getQueryVariables=function(t){var e,r=function(t){for(var e={},r=t.split("&"),n=0;n<r.length;n++){var i,a,s=r[n].indexOf("=");s>0?(i=r[n].substring(0,s),a=r[n].substring(s+1)):(i=r[n],a=null),i in e||(e[i]=[]),i in Object.prototype||null===a||e[i].push(unescape(a))}return e};return void 0===t?(null===S&&(S="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),e=S):e=r(t),e},f.parseFragment=function(t){var e=t,r="",n=t.indexOf("?");n>0&&(e=t.substring(0,n),r=t.substring(n+1));var i=e.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:e,queryString:r,path:i,query:""===r?{}:f.getQueryVariables(r)}},f.makeRequest=function(t){var e=f.parseFragment(t),r={path:e.pathString,query:e.queryString,getPath:function(t){return void 0===t?e.path:e.path[t]},getQuery:function(t,r){var n;return void 0===t?n=e.query:(n=e.query[t])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(t,e){var n=r.getQuery(t);return n?n[n.length-1]:e}};return r},f.makeLink=function(t,e,r){t=jQuery.isArray(t)?t.join("/"):t;var n=jQuery.param(e||{});return r=r||"",t+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},f.setPath=function(t,e,r){if("object"==typeof t&&null!==t)for(var n=0,i=e.length;n<i;){var a=e[n++];if(n==i)t[a]=r;else{var s=a in t;(!s||s&&"object"!=typeof t[a]||s&&null===t[a])&&(t[a]={}),t=t[a]}}},f.getPath=function(t,e,r){for(var n=0,i=e.length,a=!0;a&&n<i&&"object"==typeof t&&null!==t;){var s=e[n++];(a=s in t)&&(t=t[s])}return a?t:r},f.deletePath=function(t,e){if("object"==typeof t&&null!==t)for(var r=0,n=e.length;r<n;){var i=e[r++];if(r==n)delete t[i];else{if(!(i in t)||"object"!=typeof t[i]||null===t[i])break;t=t[i]}}},f.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},f.format=function(t){for(var e,r,n=/%./g,i=0,a=[],s=0;e=n.exec(t);){(r=t.substring(s,n.lastIndex-2)).length>0&&a.push(r),s=n.lastIndex;var o=e[0][1];switch(o){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+o+"?>")}}return a.push(t.substring(s)),a.join("")},f.formatNumber=function(t,e,r,n){var i=t,a=isNaN(e=Math.abs(e))?2:e,s=void 0===r?",":r,o=void 0===n?".":n,f=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",u=c.length>3?c.length%3:0;return f+(u?c.substr(0,u)+o:"")+c.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+o)+(a?s+Math.abs(i-c).toFixed(a).slice(2):"")},f.formatSize=function(t){return t=t>=1073741824?f.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?f.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?f.formatNumber(t/1024,0)+" KiB":f.formatNumber(t,0)+" bytes"},f.bytesFromIP=function(t){return-1!==t.indexOf(".")?f.bytesFromIPv4(t):-1!==t.indexOf(":")?f.bytesFromIPv6(t):null},f.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=f.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()},f.bytesFromIPv6=function(t){for(var e=0,r=2*(8-(t=t.split(":").filter((function(t){return 0===t.length&&++e,!0}))).length+e),n=f.createBuffer(),i=0;i<8;++i)if(t[i]&&0!==t[i].length){var a=f.hexToBytes(t[i]);a.length<2&&n.putByte(0),n.putBytes(a)}else n.fillWithByte(0,r),r=0;return n.getBytes()},f.bytesToIP=function(t){return 4===t.length?f.bytesToIPv4(t):16===t.length?f.bytesToIPv6(t):null},f.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")},f.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],r=[],n=0,i=0;i<t.length;i+=2){for(var a=f.bytesToHex(t[i]+t[i+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=r[r.length-1],o=e.length;s&&o===s.end+1?(s.end=o,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:o,end:o})}e.push(a)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),0===c.start&&e.unshift(""),7===c.end&&e.push(""))}return e.join(":")},f.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in f&&!t.update)return e(null,f.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return f.cores=navigator.hardwareConcurrency,e(null,f.cores);if("undefined"==typeof Worker)return f.cores=1,e(null,f.cores);if("undefined"==typeof Blob)return f.cores=2,e(null,f.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(t){for(var e=Date.now(),r=e+4;Date.now()<r;);self.postMessage({st:e,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function t(n,i,a){if(0===i){var s=Math.floor(n.reduce((function(t,e){return t+e}),0)/n.length);return f.cores=Math.max(1,s),URL.revokeObjectURL(r),e(null,f.cores)}!function(t,e){for(var n=[],i=[],a=0;a<t;++a){var s=new Worker(r);s.addEventListener("message",(function(r){if(i.push(r.data),i.length===t){for(var a=0;a<t;++a)n[a].terminate();e(null,i)}})),n.push(s)}for(a=0;a<t;++a)n[a].postMessage(a)}(a,(function(e,r){n.push(function(t,e){for(var r=[],n=0;n<t;++n)for(var i=e[n],a=r[n]=[],s=0;s<t;++s)if(n!==s){var o=e[s];(i.st>o.st&&i.st<o.et||o.st>i.st&&o.st<i.et)&&a.push(s)}return r.reduce((function(t,e){return Math.max(t,e.length)}),0)}(a,r)),t(n,i-1,a)}))}([],5,16)}}).call(this,r(20),r(53).setImmediate,r(13),r(1).Buffer)},function(t,e,r){"use strict";var n=e,i=r(6),a=r(8),s=r(39);n.assert=a,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,a=t.clone(),s=0;s<n.length;s++){var o,f=a.andln(i-1);a.isOdd()?(o=f>(i>>1)-1?(i>>1)-f:f,a.isubn(o)):o=0,n[s]=o,a.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0;t.cmpn(-n)>0||e.cmpn(-i)>0;){var a,s,o,f=t.andln(3)+n&3,c=e.andln(3)+i&3;if(3===f&&(f=-1),3===c&&(c=-1),0==(1&f))a=0;else a=3!==(o=t.andln(7)+n&7)&&5!==o||2!==c?f:-f;if(r[0].push(a),0==(1&c))s=0;else s=3!==(o=e.andln(7)+i&7)&&5!==o||2!==f?c:-c;r[1].push(s),2*n===a+1&&(n=1-n),2*i===s+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,r){"use strict";var n=r(8),i=r(17);function a(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t){return 1===t.length?"0"+t:t}function f(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):a(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=o(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=f(i.toString(16))}return r},e.zero2=o,e.zero8=f,e.join32=function(t,e,r,i){var a=r-e;n(a%4==0);for(var s=new Array(a/4),o=0,f=e;o<s.length;o++,f+=4){var c;c="big"===i?t[f]<<24|t[f+1]<<16|t[f+2]<<8|t[f+3]:t[f+3]<<24|t[f+2]<<16|t[f+1]<<8|t[f],s[o]=c>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var a=t[n];"big"===e?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],a=n+t[e+1]>>>0,s=(a<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=a},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,a,s,o){var f=0,c=e;return f+=(c=c+n>>>0)<e?1:0,f+=(c=c+a>>>0)<a?1:0,t+r+i+s+(f+=(c=c+o>>>0)<o?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,a,s,o){return e+n+a+o>>>0},e.sum64_5_hi=function(t,e,r,n,i,a,s,o,f,c){var u=0,h=e;return u+=(h=h+n>>>0)<e?1:0,u+=(h=h+a>>>0)<a?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+i+s+f+(u+=(h=h+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,a,s,o,f,c){return e+n+a+o+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){"use strict";function n(t,e){for(const r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}t.exports=function(t,e,r){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");r||(r={}),"object"==typeof e&&(r=e,e=void 0),null!=e&&(r.code=e);try{return n(t,r)}catch(i){r.message=t.message,r.stack=t.stack;const e=function(){};return e.prototype=Object.create(Object.getPrototypeOf(t)),n(new e,r)}}},function(t,e,r){"use strict";(function(t){!function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=a:(void 0).BN=a,a.BN=a,a.wordSize=26;try{s=r(110).Buffer}catch(A){}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a<i;a++){var s=t.charCodeAt(a)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function f(t,e,r,n){for(var i=0,a=Math.min(t.length,r),s=e;s<a;s++){var o=t.charCodeAt(s)-48;i*=n,i+=o>=49?o-49+10:o>=17?o-17+10:o}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,s,o=0;if("be"===r)for(i=t.length-1,a=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);else if("le"===r)for(i=0,a=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[a]|=s<<o&67108863,this.words[a+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,a=0;for(r=t.length-6,n=0;r>=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<<a&67108863,this.words[n+1]|=i>>>26-a&4194303),this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,s=a%n,o=Math.min(a,a-s)+r,c=0,u=r;u<o;u+=n)c=f(t,u,u+n,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=f(t,u,t.length,e),u=0;u<s;u++)h*=e;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}},a.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},a.prototype.clone=function(){var t=new a(null);return this.copy(t),t},a.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],s=i*a,o=67108863&s,f=s/67108864|0;r.words[0]=o;for(var c=1;c<n;c++){for(var u=f>>>26,h=67108863&f,d=Math.min(c,e.length-1),l=Math.max(0,c-t.length+1);l<=d;l++){var p=c-l|0;u+=(s=(i=0|t.words[p])*(a=0|e.words[l])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,f=0|u}return 0!==f?r.words[c]=0|f:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,s=0;s<this.length;s++){var o=this.words[s],f=(16777215&(o<<i|a)).toString(16);r=0!==(a=o>>>24-i&16777215)||s!==this.length-1?c[6-f.length]+f+r:f+r,(i+=2)>=26&&(i-=26,s--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=u[t],l=h[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:c[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var s,o,f="le"===e,c=new t(a),u=this.clone();if(f){for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[o]=s;for(;o<a;o++)c[o]=0}else{for(o=0;o<a-i;o++)c[o]=0;for(o=0;!u.isZero();o++)s=u.andln(255),u.iushrn(8),c[a-o-1]=s}return c},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},a.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},a.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},a.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},a.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},a.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},a.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},a.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a<n.length;a++)e=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&e,i=e>>>26;for(;0!==i&&a<r.length;a++)e=(0|r.words[a])+i,this.words[a]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,s=0;s<n.length;s++)a=(e=(0|r.words[s])-(0|n.words[s])+a)>>26,this.words[s]=67108863&e;for(;0!==a&&s<r.length;s++)a=(e=(0|r.words[s])+a)>>26,this.words[s]=67108863&e;if(0===a&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var n,i,a,s=t.words,o=e.words,f=r.words,c=0,u=0|s[0],h=8191&u,d=u>>>13,l=0|s[1],p=8191&l,b=l>>>13,y=0|s[2],g=8191&y,m=y>>>13,v=0|s[3],w=8191&v,S=v>>>13,E=0|s[4],k=8191&E,A=E>>>13,B=0|s[5],I=8191&B,T=B>>>13,M=0|s[6],C=8191&M,_=M>>>13,x=0|s[7],R=8191&x,P=x>>>13,L=0|s[8],N=8191&L,K=L>>>13,U=0|s[9],D=8191&U,O=U>>>13,z=0|o[0],j=8191&z,q=z>>>13,V=0|o[1],H=8191&V,F=V>>>13,Y=0|o[2],G=8191&Y,W=Y>>>13,Q=0|o[3],Z=8191&Q,J=Q>>>13,X=0|o[4],$=8191&X,tt=X>>>13,et=0|o[5],rt=8191&et,nt=et>>>13,it=0|o[6],at=8191&it,st=it>>>13,ot=0|o[7],ft=8191&ot,ct=ot>>>13,ut=0|o[8],ht=8191&ut,dt=ut>>>13,lt=0|o[9],pt=8191&lt,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(c+(n=Math.imul(h,j))|0)+((8191&(i=(i=Math.imul(h,q))+Math.imul(d,j)|0))<<13)|0;c=((a=Math.imul(d,q))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,j),i=(i=Math.imul(p,q))+Math.imul(b,j)|0,a=Math.imul(b,q);var gt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,F)|0)+Math.imul(d,H)|0))<<13)|0;c=((a=a+Math.imul(d,F)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,j),i=(i=Math.imul(g,q))+Math.imul(m,j)|0,a=Math.imul(m,q),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,F)|0)+Math.imul(b,H)|0,a=a+Math.imul(b,F)|0;var mt=(c+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,G)|0))<<13)|0;c=((a=a+Math.imul(d,W)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(w,j),i=(i=Math.imul(w,q))+Math.imul(S,j)|0,a=Math.imul(S,q),n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,F)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,F)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,W)|0;var vt=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(d,Z)|0))<<13)|0;c=((a=a+Math.imul(d,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(k,j),i=(i=Math.imul(k,q))+Math.imul(A,j)|0,a=Math.imul(A,q),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,F)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,F)|0,n=n+Math.imul(g,G)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(m,G)|0,a=a+Math.imul(m,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,J)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(d,$)|0))<<13)|0;c=((a=a+Math.imul(d,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,j),i=(i=Math.imul(I,q))+Math.imul(T,j)|0,a=Math.imul(T,q),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,F)|0)+Math.imul(A,H)|0,a=a+Math.imul(A,F)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(S,G)|0,a=a+Math.imul(S,W)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,J)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,$)|0,a=a+Math.imul(b,tt)|0;var St=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(d,rt)|0))<<13)|0;c=((a=a+Math.imul(d,nt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(C,j),i=(i=Math.imul(C,q))+Math.imul(_,j)|0,a=Math.imul(_,q),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,F)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,F)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,W)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(S,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(g,$)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,a=a+Math.imul(b,nt)|0;var Et=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(d,at)|0))<<13)|0;c=((a=a+Math.imul(d,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(R,j),i=(i=Math.imul(R,q))+Math.imul(P,j)|0,a=Math.imul(P,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,F)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,F)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,G)|0,a=a+Math.imul(T,W)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(A,Z)|0,a=a+Math.imul(A,J)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,at)|0,a=a+Math.imul(b,st)|0;var kt=(c+(n=n+Math.imul(h,ft)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(d,ft)|0))<<13)|0;c=((a=a+Math.imul(d,ct)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,j),i=(i=Math.imul(N,q))+Math.imul(K,j)|0,a=Math.imul(K,q),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,F)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,F)|0,n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(T,Z)|0,a=a+Math.imul(T,J)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(A,$)|0,a=a+Math.imul(A,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,st)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(b,ft)|0,a=a+Math.imul(b,ct)|0;var At=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,dt)|0)+Math.imul(d,ht)|0))<<13)|0;c=((a=a+Math.imul(d,dt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,j),i=(i=Math.imul(D,q))+Math.imul(O,j)|0,a=Math.imul(O,q),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,F)|0)+Math.imul(K,H)|0,a=a+Math.imul(K,F)|0,n=n+Math.imul(R,G)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(P,G)|0,a=a+Math.imul(P,W)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,tt)|0,n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(A,rt)|0,a=a+Math.imul(A,nt)|0,n=n+Math.imul(w,at)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,st)|0,n=n+Math.imul(g,ft)|0,i=(i=i+Math.imul(g,ct)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ht)|0,a=a+Math.imul(b,dt)|0;var Bt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,bt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((a=a+Math.imul(d,bt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,H),i=(i=Math.imul(D,F))+Math.imul(O,H)|0,a=Math.imul(O,F),n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(K,G)|0,a=a+Math.imul(K,W)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(P,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(T,rt)|0,a=a+Math.imul(T,nt)|0,n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(A,at)|0,a=a+Math.imul(A,st)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(g,ht)|0,i=(i=i+Math.imul(g,dt)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,dt)|0;var It=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((a=a+Math.imul(b,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,G),i=(i=Math.imul(D,W))+Math.imul(O,G)|0,a=Math.imul(O,W),n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(K,Z)|0,a=a+Math.imul(K,J)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(P,$)|0,a=a+Math.imul(P,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,st)|0)+Math.imul(T,at)|0,a=a+Math.imul(T,st)|0,n=n+Math.imul(k,ft)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(A,ft)|0,a=a+Math.imul(A,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,dt)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,dt)|0;var Tt=(c+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,bt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,Z),i=(i=Math.imul(D,J))+Math.imul(O,Z)|0,a=Math.imul(O,J),n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(K,$)|0,a=a+Math.imul(K,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(P,rt)|0,a=a+Math.imul(P,nt)|0,n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,st)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(T,ft)|0,a=a+Math.imul(T,ct)|0,n=n+Math.imul(k,ht)|0,i=(i=i+Math.imul(k,dt)|0)+Math.imul(A,ht)|0,a=a+Math.imul(A,dt)|0;var Mt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,bt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,bt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,tt))+Math.imul(O,$)|0,a=Math.imul(O,tt),n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(K,rt)|0,a=a+Math.imul(K,nt)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(P,at)|0,a=a+Math.imul(P,st)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(I,ht)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(T,ht)|0,a=a+Math.imul(T,dt)|0;var Ct=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,bt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((a=a+Math.imul(A,bt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(O,rt)|0,a=Math.imul(O,nt),n=n+Math.imul(N,at)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(K,at)|0,a=a+Math.imul(K,st)|0,n=n+Math.imul(R,ft)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(P,ft)|0,a=a+Math.imul(P,ct)|0,n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(_,ht)|0,a=a+Math.imul(_,dt)|0;var _t=(c+(n=n+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,bt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((a=a+Math.imul(T,bt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(D,at),i=(i=Math.imul(D,st))+Math.imul(O,at)|0,a=Math.imul(O,st),n=n+Math.imul(N,ft)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(K,ft)|0,a=a+Math.imul(K,ct)|0,n=n+Math.imul(R,ht)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(P,ht)|0,a=a+Math.imul(P,dt)|0;var xt=(c+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,bt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,ft),i=(i=Math.imul(D,ct))+Math.imul(O,ft)|0,a=Math.imul(O,ct),n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,dt)|0)+Math.imul(K,ht)|0,a=a+Math.imul(K,dt)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,bt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((a=a+Math.imul(P,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(D,ht),i=(i=Math.imul(D,dt))+Math.imul(O,ht)|0,a=Math.imul(O,dt);var Pt=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,bt)|0)+Math.imul(K,pt)|0))<<13)|0;c=((a=a+Math.imul(K,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Lt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,bt))+Math.imul(O,pt)|0))<<13)|0;return c=((a=Math.imul(O,bt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,f[0]=yt,f[1]=gt,f[2]=mt,f[3]=vt,f[4]=wt,f[5]=St,f[6]=Et,f[7]=kt,f[8]=At,f[9]=Bt,f[10]=It,f[11]=Tt,f[12]=Mt,f[13]=Ct,f[14]=_t,f[15]=xt,f[16]=Rt,f[17]=Pt,f[18]=Lt,0!==c&&(f[19]=c,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var s=i;i=0;for(var o=67108863&n,f=Math.min(a,e.length-1),c=Math.max(0,a-t.length+1);c<=f;c++){var u=a-c,h=(0|t.words[u])*(0|e.words[c]),d=67108863&h;o=67108863&(d=d+o|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[a]=o,n=s,s=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,a){for(var s=0;s<a;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,a){this.permute(a,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var o=s<<1,f=Math.cos(2*Math.PI/o),c=Math.sin(2*Math.PI/o),u=0;u<i;u+=o)for(var h=f,d=c,l=0;l<s;l++){var p=r[u+l],b=n[u+l],y=r[u+l+s],g=n[u+l+s],m=h*y-d*g;g=h*g+d*y,y=m,r[u+l]=p+y,n[u+l]=b+g,r[u+l+s]=p-y,n[u+l+s]=b-g,l!==o&&(m=f*h-c*d,d=f*d+c*h,h=m)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var a=0,s=0;s<e;s++)a+=0|t[s],r[2*s]=8191&a,a>>>=13,r[2*s+1]=8191&a,a>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===a),n(0==(-8192&a))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),a=this.stub(n),s=new Array(n),o=new Array(n),f=new Array(n),c=new Array(n),u=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,c,n),this.transform(s,a,o,f,n,i),this.transform(c,a,u,h,n,i);for(var l=0;l<n;l++){var p=o[l]*u[l]-f[l]*h[l];f[l]=o[l]*h[l]+f[l]*u[l],o[l]=p}return this.conjugate(o,f,n),this.transform(o,f,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},a.prototype.mul=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},a.prototype.mulf=function(t){var e=new a(null);return e.words=new Array(this.length+t.length),p(this,t,e)},a.prototype.imul=function(t){return this.clone().mulTo(t,this)},a.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,a=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var o=this.words[e]&a,f=(0|this.words[e])-o<<r;this.words[e]=f|s,s=o>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},a.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var a=t%26,s=Math.min((t-a)/26,this.length),o=67108863^67108863>>>a<<a,f=r;if(i-=s,i=Math.max(0,i),f){for(var c=0;c<s;c++)f.words[c]=this.words[c];f.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&o}return f&&0!==u&&(f.words[f.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(t){return this.clone().imaskn(t)},a.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},a.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},a.prototype.addn=function(t){return this.clone().iaddn(t)},a.prototype.subn=function(t){return this.clone().isubn(t)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(t,e,r){var i,a,s=t.length+r;this._expand(s);var o=0;for(i=0;i<t.length;i++){a=(0|this.words[i+r])+o;var f=(0|t.words[i])*e;o=((a-=67108863&f)>>26)-(f/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)o=(a=(0|this.words[i+r])+o)>>26,this.words[i+r]=67108863&a;if(0===o)return this.strip();for(n(-1===o),o=0,i=0;i<this.length;i++)o=(a=-(0|this.words[i])+o)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var o,f=n.length-i.length;if("mod"!==e){(o=new a(null)).length=f+1,o.words=new Array(o.length);for(var c=0;c<o.length;c++)o.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,f);0===u.negative&&(n=u,o&&(o.words[f]=1));for(var h=f-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);o&&(o.words[h]=d)}return o&&o.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(o=this.neg().divmod(t,e),"mod"!==e&&(i=o.div.neg()),"div"!==e&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(o=this.divmod(t.neg(),e),"mod"!==e&&(i=o.div.neg()),{div:i,mod:o.mod}):0!=(this.negative&t.negative)?(o=this.neg().divmod(t.neg(),e),"div"!==e&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:o.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,o},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),s=new a(0),o=new a(0),f=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(u),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(u),f.isub(h)),o.iushrn(1),f.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o),s.isub(f)):(r.isub(e),o.isub(i),f.isub(s))}return{a:o,b:f,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new a(1),o=new a(0),f=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(o)):(r.isub(e),o.isub(s))}return(i=0===e.cmpn(1)?s:o).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,s=r;0!==a&&s<this.length;s++){var o=0|this.words[s];a=(o+=a)>>>26,o&=67108863,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},a.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},a.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new E(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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 t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(m,g),m.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var a=0|t.words[n];t.words[n-10]=(4194303&a)<<4|i>>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},m.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(w,g),i(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new m;else if("p224"===t)e=new v;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return y[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var o=new a(1).toRed(this),f=o.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(f);)u.redIAdd(f);for(var h=this.pow(u,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(o);){for(var b=l,y=0;0!==b.cmp(o);y++)b=b.redSqr();n(y<p);var g=this.pow(h,new a(1).iushln(p-y-1));d=d.redMul(g),h=g.redSqr(),l=l.redMul(h),p=y}return d},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new a(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,o=0,f=e.bitLength()%26;for(0===f&&(f=26),n=e.length-1;n>=0;n--){for(var c=e.words[n],u=f-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++o||0===n&&0===u)&&(i=this.mul(i,r[s]),o=0,s=0)):o=0}f=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new k(t)},i(k,E),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),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)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t)}).call(this,r(109)(t))},function(t,e,r){"use strict";t.exports={encode:r(64),decode:r(65),encodingLength:r(66)}},function(t,e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=n,n.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var n=r(0);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(t,e,r){"use strict";var n=r(0);r(2),r(24);var i=t.exports=n.asn1=n.asn1||{};function a(t,e,r){if(r>e){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(t,e,r,a,s){if(n.util.isArray(a)){for(var o=[],f=0;f<a.length;++f)void 0!==a[f]&&o.push(a[f]);a=o}var c={tagClass:t,type:e,constructed:r,composed:r||n.util.isArray(a),value:a};return s&&"bitStringContents"in s&&(c.bitStringContents=s.bitStringContents,c.original=i.copy(c)),c},i.copy=function(t,e){var r;if(n.util.isArray(t)){r=[];for(var a=0;a<t.length;++a)r.push(i.copy(t[a],e));return r}return"string"==typeof t?t:(r={tagClass:t.tagClass,type:t.type,constructed:t.constructed,composed:t.composed,value:i.copy(t.value,e)},e&&!e.excludeBitStringContents&&(r.bitStringContents=t.bitStringContents),r)},i.equals=function(t,e,r){if(n.util.isArray(t)){if(!n.util.isArray(e))return!1;if(t.length!==e.length)return!1;for(var a=0;a<t.length;++a)if(!i.equals(t[a],e[a]))return!1;return!0}if(typeof t!=typeof e)return!1;if("string"==typeof t)return t===e;var s=t.tagClass===e.tagClass&&t.type===e.type&&t.constructed===e.constructed&&t.composed===e.composed&&i.equals(t.value,e.value);return r&&r.includeBitStringContents&&(s=s&&t.bitStringContents===e.bitStringContents),s},i.getBerValueLength=function(t){var e=t.getByte();if(128!==e)return 128&e?t.getInt((127&e)<<3):e};i.fromDer=function(t,e){return void 0===e&&(e={strict:!0,decodeBitStrings:!0}),"boolean"==typeof e&&(e={strict:e,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),"string"==typeof t&&(t=n.util.createBuffer(t)),function t(e,r,n,s){var o;a(e,r,2);var f=e.getByte();r--;var c=192&f,u=31&f;o=e.length();var h,d,l=function(t,e){var r=t.getByte();if(e--,128!==r){var n;if(128&r){var i=127&r;a(t,e,i),n=t.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,r);if(r-=o-e.length(),void 0!==l&&l>r){if(s.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=r,p.requested=l,p}l=r}var b=32==(32&f);if(b)if(h=[],void 0===l)for(;;){if(a(e,r,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),r-=2;break}o=e.length(),h.push(t(e,r,n+1,s)),r-=o-e.length()}else for(;l>0;)o=e.length(),h.push(t(e,l,n+1,s)),r-=o-e.length(),l-=o-e.length();void 0===h&&c===i.Class.UNIVERSAL&&u===i.Type.BITSTRING&&(d=e.bytes(l));if(void 0===h&&s.decodeBitStrings&&c===i.Class.UNIVERSAL&&u===i.Type.BITSTRING&&l>1){var y=e.read,g=r,m=0;if(u===i.Type.BITSTRING&&(a(e,r,1),m=e.getByte(),r--),0===m)try{o=e.length();var v={verbose:s.verbose,strict:!0,decodeBitStrings:!0},w=t(e,r,n+1,v),S=o-e.length();r-=S,u==i.Type.BITSTRING&&S++;var E=w.tagClass;S!==l||E!==i.Class.UNIVERSAL&&E!==i.Class.CONTEXT_SPECIFIC||(h=[w])}catch(A){}void 0===h&&(e.read=y,r=g)}if(void 0===h){if(void 0===l){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");l=r}if(u===i.Type.BMPSTRING)for(h="";l>0;l-=2)a(e,r,2),h+=String.fromCharCode(e.getInt16()),r-=2;else h=e.getBytes(l)}var k=void 0===d?null:{bitStringContents:d};return i.create(c,u,b,h,k)}(t,t.length(),0,e)},i.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,a=n.util.createBuffer(),s=!1;if("bitStringContents"in t&&(s=!0,t.original&&(s=i.equals(t,t.original))),s)a.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:a.putByte(0);for(var o=0;o<t.value.length;++o)void 0!==t.value[o]&&a.putBuffer(i.toDer(t.value[o]))}else if(t.type===i.Type.BMPSTRING)for(o=0;o<t.value.length;++o)a.putInt16(t.value.charCodeAt(o));else t.type===i.Type.INTEGER&&t.value.length>1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?a.putBytes(t.value.substr(1)):a.putBytes(t.value);if(e.putByte(r),a.length()<=127)e.putByte(127&a.length());else{var f=a.length(),c="";do{c+=String.fromCharCode(255&f),f>>>=8}while(f>0);e.putByte(128|c.length);for(o=c.length-1;o>=0;--o)e.putByte(c.charCodeAt(o))}return e.putBuffer(a),e},i.oidToDer=function(t){var e,r,i,a,s=t.split("."),o=n.util.createBuffer();o.putByte(40*parseInt(s[0],10)+parseInt(s[1],10));for(var f=2;f<s.length;++f){e=!0,r=[],i=parseInt(s[f],10);do{a=127&i,i>>>=7,e||(a|=128),r.push(a),e=!1}while(i>0);for(var c=r.length-1;c>=0;--c)o.putByte(r[c])}return o},i.derToOid=function(t){var e;"string"==typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)i<<=7,128&(r=t.getByte())?i+=127&r:(e+="."+(i+r),i=0);return e},i.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),a=parseInt(t.substr(6,2),10),s=parseInt(t.substr(8,2),10),o=0;if(t.length>11){var f=t.charAt(10),c=10;"+"!==f&&"-"!==f&&(o=parseInt(t.substr(10,2),10),c+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(a,s,o,0),c&&("+"===(f=t.charAt(c))||"-"===f)){var u=60*parseInt(t.substr(c+1,2),10)+parseInt(t.substr(c+4,2),10);u*=6e4,"+"===f?e.setTime(+e-u):e.setTime(+e+u)}return e},i.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=parseInt(t.substr(10,2),10),o=parseInt(t.substr(12,2),10),f=0,c=0,u=!1;"Z"===t.charAt(t.length-1)&&(u=!0);var h=t.length-5,d=t.charAt(h);"+"!==d&&"-"!==d||(c=60*parseInt(t.substr(h+1,2),10)+parseInt(t.substr(h+4,2),10),c*=6e4,"+"===d&&(c*=-1),u=!0);return"."===t.charAt(14)&&(f=1e3*parseFloat(t.substr(14),10)),u?(e.setUTCFullYear(r,n,i),e.setUTCHours(a,s,o,f),e.setTime(+e+c)):(e.setFullYear(r,n,i),e.setHours(a,s,o,f)),e},i.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z"},i.dateToGeneralizedTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push(""+t.getUTCFullYear()),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(e+="0"),e+=r[n];return e+="Z"},i.integerToDer=function(t){var e=n.util.createBuffer();if(t>=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},i.derToInteger=function(t){"string"==typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,r,a){var s=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)a&&(t.tagClass!==e.tagClass&&a.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&a.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(s=!0,e.value&&n.util.isArray(e.value))for(var o=0,f=0;s&&f<e.value.length;++f)s=e.value[f].optional||!1,t.value[o]&&((s=i.validate(t.value[o],e.value[f],r,a))?++o:e.value[f].optional&&(s=!0)),!s&&a&&a.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+t.value.length+'"');if(s&&r)if(e.capture&&(r[e.capture]=t.value),e.captureAsn1&&(r[e.captureAsn1]=t),e.captureBitStringContents&&"bitStringContents"in t&&(r[e.captureBitStringContents]=t.bitStringContents),e.captureBitStringValue&&"bitStringContents"in t)if(t.bitStringContents.length<2)r[e.captureBitStringValue]="";else{if(0!==t.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[e.captureBitStringValue]=t.bitStringContents.slice(1)}}else a&&a.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+t.constructed+'"');return s};var s=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(t,e,r){var a="";r=r||2,(e=e||0)>0&&(a+="\n");for(var o="",f=0;f<e*r;++f)o+=" ";switch(a+=o+"Tag: ",t.tagClass){case i.Class.UNIVERSAL:a+="Universal:";break;case i.Class.APPLICATION:a+="Application:";break;case i.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case i.Class.PRIVATE:a+="Private:"}if(t.tagClass===i.Class.UNIVERSAL)switch(a+=t.type,t.type){case i.Type.NONE:a+=" (None)";break;case i.Type.BOOLEAN:a+=" (Boolean)";break;case i.Type.INTEGER:a+=" (Integer)";break;case i.Type.BITSTRING:a+=" (Bit string)";break;case i.Type.OCTETSTRING:a+=" (Octet string)";break;case i.Type.NULL:a+=" (Null)";break;case i.Type.OID:a+=" (Object Identifier)";break;case i.Type.ODESC:a+=" (Object Descriptor)";break;case i.Type.EXTERNAL:a+=" (External or Instance of)";break;case i.Type.REAL:a+=" (Real)";break;case i.Type.ENUMERATED:a+=" (Enumerated)";break;case i.Type.EMBEDDED:a+=" (Embedded PDV)";break;case i.Type.UTF8:a+=" (UTF8)";break;case i.Type.ROID:a+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:a+=" (Sequence)";break;case i.Type.SET:a+=" (Set)";break;case i.Type.PRINTABLESTRING:a+=" (Printable String)";break;case i.Type.IA5String:a+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:a+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case i.Type.BMPSTRING:a+=" (BMP String)"}else a+=t.type;if(a+="\n",a+=o+"Constructed: "+t.constructed+"\n",t.composed){var c=0,u="";for(f=0;f<t.value.length;++f)void 0!==t.value[f]&&(c+=1,u+=i.prettyPrint(t.value[f],e+1,r),f+1<t.value.length&&(u+=","));a+=o+"Sub values: "+c+u}else{if(a+=o+"Value: ",t.type===i.Type.OID){var h=i.derToOid(t.value);a+=h,n.pki&&n.pki.oids&&h in n.pki.oids&&(a+=" ("+n.pki.oids[h]+") ")}if(t.type===i.Type.INTEGER)try{a+=i.derToInteger(t.value)}catch(l){a+="0x"+n.util.bytesToHex(t.value)}else if(t.type===i.Type.BITSTRING){if(t.value.length>1?a+="0x"+n.util.bytesToHex(t.value.slice(1)):a+="(none)",t.value.length>0){var d=t.value.charCodeAt(0);1==d?a+=" (1 unused bit shown)":d>1&&(a+=" ("+d+" unused bits shown)")}}else t.type===i.Type.OCTETSTRING?(s.test(t.value)||(a+="("+t.value+") "),a+="0x"+n.util.bytesToHex(t.value)):t.type===i.Type.UTF8?a+=n.util.decodeUtf8(t.value):t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?a+=t.value:s.test(t.value)?a+="0x"+n.util.bytesToHex(t.value):0===t.value.length?a+="[null]":a+=t.value}return a}},function(t,e,r){"use strict";var n=r(0);r(19),r(75),r(76),r(2),n.random&&n.random.getBytes?t.exports=n.random:function(e){var r={},i=new Array(4),a=n.util.createBuffer();function s(){var t=n.prng.create(r);return t.getBytes=function(e,r){return t.generate(e,r)},t.getBytesSync=function(e){return t.generate(e)},t}r.formatKey=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),n.aes._expandKey(t,!1)},r.formatSeed=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},r.cipher=function(t,e){return n.aes._updateBlock(t,e,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(t){return++t[3],t},r.md=n.md.sha256;var o=s(),f=null,c=n.util.globalScope,u=c.crypto||c.msCrypto;if(u&&u.getRandomValues&&(f=function(t){return u.getRandomValues(t)}),n.options.usePureJavaScript||!n.util.isNodejs&&!f){if("undefined"==typeof window||window.document,o.collectInt(+new Date,32),"undefined"!=typeof navigator){var h="";for(var d in navigator)try{"string"==typeof navigator[d]&&(h+=navigator[d])}catch(l){}o.collect(h),h=null}e&&(e().mousemove((function(t){o.collectInt(t.clientX,16),o.collectInt(t.clientY,16)})),e().keypress((function(t){o.collectInt(t.charCode,8)})))}if(n.random)for(var d in o)n.random[d]=o[d];else n.random=o;n.random.createInstance=s,t.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},function(t,e,r){"use strict";var n=r(4),i=r(8);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=a,a.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},a.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},a.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n}},function(t,e,r){"use strict";var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(i){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,r){"use strict";var n,i=r(0);t.exports=i.jsbn=i.jsbn||{};function a(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function s(){return new a(null)}function o(t,e,r,n,i,a){for(var s=16383&e,o=e>>14;--a>=0;){var f=16383&this.data[t],c=this.data[t++]>>14,u=o*f+c*s;i=((f=s*f+((16383&u)<<14)+r.data[n]+i)>>28)+(u>>14)+o*c,r.data[n++]=268435455&f}return i}i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=o,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(t,e,r,n,i,a){for(var s=32767&e,o=e>>15;--a>=0;){var f=32767&this.data[t],c=this.data[t++]>>15,u=o*f+c*s;i=((f=s*f+((32767&u)<<15)+r.data[n]+(1073741823&i))>>>30)+(u>>>15)+o*c+(i>>>30),r.data[n++]=1073741823&f}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(t,e,r,n,i,a){for(;--a>=0;){var s=e*this.data[t++]+r.data[n]+i;i=Math.floor(s/67108864),r.data[n++]=67108863&s}return i},n=26):(a.prototype.am=o,n=28),a.prototype.DB=n,a.prototype.DM=(1<<n)-1,a.prototype.DV=1<<n;a.prototype.FV=Math.pow(2,52),a.prototype.F1=52-n,a.prototype.F2=2*n-52;var f,c,u=new Array;for(f="0".charCodeAt(0),c=0;c<=9;++c)u[f++]=c;for(f="a".charCodeAt(0),c=10;c<36;++c)u[f++]=c;for(f="A".charCodeAt(0),c=10;c<36;++c)u[f++]=c;function h(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function d(t,e){var r=u[t.charCodeAt(e)];return null==r?-1:r}function l(t){var e=s();return e.fromInt(t),e}function p(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function b(t){this.m=t}function y(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function g(t,e){return t&e}function m(t,e){return t|e}function v(t,e){return t^e}function w(t,e){return t&~e}function S(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function E(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function k(){}function A(t){return t}function B(t){this.r2=s(),this.q3=s(),a.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}b.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},b.prototype.revert=function(t){return t},b.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},b.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},b.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},y.prototype.convert=function(t){var e=s();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(a.ZERO)>0&&this.m.subTo(e,e),e},y.prototype.revert=function(t){var e=s();return t.copyTo(e),this.reduce(e),e},y.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t.data[e],n=r*this.mpl+((r*this.mph+(t.data[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},y.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},a.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},a.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},a.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,s=0;--n>=0;){var o=8==r?255&t[n]:d(t,n);o<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==s?this.data[this.t++]=o:s+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this.data[this.t++]=o>>this.DB-s):this.data[this.t-1]|=o<<s,(s+=r)>=this.DB&&(s-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,s>0&&(this.data[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&a.ZERO.subTo(this,this)},a.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this.data[this.t-1]==t;)--this.t},a.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},a.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e.data[r-t]=this.data[r];e.t=Math.max(this.t-t,0),e.s=this.s},a.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,i=this.DB-n,a=(1<<i)-1,s=Math.floor(t/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e.data[r+s+1]=this.data[r]>>i|o,o=(this.data[r]&a)<<n;for(r=s-1;r>=0;--r)e.data[r]=0;e.data[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()},a.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,a=(1<<n)-1;e.data[0]=this.data[r]>>n;for(var s=r+1;s<this.t;++s)e.data[s-r-1]|=(this.data[s]&a)<<i,e.data[s-r]=this.data[s]>>n;n>0&&(e.data[this.t-r-1]|=(this.s&a)<<i),e.t=this.t-r,e.clamp()}},a.prototype.subTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]-t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()},a.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i<n.t;++i)e.data[i+r.t]=r.am(0,n.data[i],e,i,0,r.t);e.s=0,e.clamp(),this.s!=t.s&&a.ZERO.subTo(e,e)},a.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t.data[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e.data[r],t,2*r,0,1);(t.data[r+e.t]+=e.am(r+1,2*e.data[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},a.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=e&&e.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=s());var o=s(),f=this.s,c=t.s,u=this.DB-p(n.data[n.t-1]);u>0?(n.lShiftTo(u,o),i.lShiftTo(u,r)):(n.copyTo(o),i.copyTo(r));var h=o.t,d=o.data[h-1];if(0!=d){var l=d*(1<<this.F1)+(h>1?o.data[h-2]>>this.F2:0),b=this.FV/l,y=(1<<this.F1)/l,g=1<<this.F2,m=r.t,v=m-h,w=null==e?s():e;for(o.dlShiftTo(v,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),a.ONE.dlShiftTo(h,w),w.subTo(o,o);o.t<h;)o.data[o.t++]=0;for(;--v>=0;){var S=r.data[--m]==d?this.DM:Math.floor(r.data[m]*b+(r.data[m-1]+g)*y);if((r.data[m]+=o.am(0,S,r,v,0,h))<S)for(o.dlShiftTo(v,w),r.subTo(w,r);r.data[m]<--S;)r.subTo(w,r)}null!=e&&(r.drShiftTo(h,e),f!=c&&a.ZERO.subTo(e,e)),r.t=h,r.clamp(),u>0&&r.rShiftTo(u,r),f<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(t,e){if(t>4294967295||t<1)return a.ONE;var r=s(),n=s(),i=e.convert(this),o=p(t)-1;for(i.copyTo(r);--o>=0;)if(e.sqrTo(r,n),(t&1<<o)>0)e.mulTo(n,i,r);else{var f=r;r=n,n=f}return e.revert(r)},a.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,i=!1,a="",s=this.t,o=this.DB-s*this.DB%e;if(s-- >0)for(o<this.DB&&(r=this.data[s]>>o)>0&&(i=!0,a=h(r));s>=0;)o<e?(r=(this.data[s]&(1<<o)-1)<<e-o,r|=this.data[--s]>>(o+=this.DB-e)):(r=this.data[s]>>(o-=e)&n,o<=0&&(o+=this.DB,--s)),r>0&&(i=!0),i&&(a+=h(r));return i?a:"0"},a.prototype.negate=function(){var t=s();return a.ZERO.subTo(this,t),t},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(t){var e=s();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(a.ZERO)>0&&t.subTo(e,e),e},a.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new b(e):new y(e),this.exp(t,r)},a.ZERO=l(0),a.ONE=l(1),k.prototype.convert=A,k.prototype.revert=A,k.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},k.prototype.sqrTo=function(t,e){t.squareTo(e)},B.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=s();return t.copyTo(e),this.reduce(e),e},B.prototype.revert=function(t){return t},B.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},B.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},B.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var I=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=(1<<26)/I[I.length-1];a.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},a.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=l(r),i=s(),a=s(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(t).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(t)+o},a.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,s=0,o=0,f=0;f<t.length;++f){var c=d(t,f);c<0?"-"==t.charAt(f)&&0==this.signum()&&(i=!0):(o=e*o+c,++s>=r&&(this.dMultiply(n),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(a.ONE.shiftLeft(t-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(a.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},a.prototype.bitwiseTo=function(t,e,r){var n,i,a=Math.min(t.t,this.t);for(n=0;n<a;++n)r.data[n]=e(this.data[n],t.data[n]);if(t.t<this.t){for(i=t.s&this.DM,n=a;n<this.t;++n)r.data[n]=e(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<t.t;++n)r.data[n]=e(i,t.data[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},a.prototype.changeBit=function(t,e){var r=a.ONE.shiftLeft(t);return this.bitwiseTo(r,e,r),r},a.prototype.addTo=function(t,e){for(var r=0,n=0,i=Math.min(t.t,this.t);r<i;)n+=this.data[r]+t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t.data[r],e.data[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()},a.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},a.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,t.data[i],r,i,0,this.t);for(n=Math.min(t.t,e);i<n;++i)this.am(0,t.data[i],r,i,0,e-i);r.clamp()},a.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r.data[this.t+n-e]=this.am(e-n,t.data[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},a.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},a.prototype.millerRabin=function(t){var e=this.subtract(a.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),s={nextBytes:function(t){for(var e=0;e<t.length;++e)t[e]=Math.floor(256*Math.random())}},o=0;o<t;++o){do{n=new a(this.bitLength(),s)}while(n.compareTo(a.ONE)<=0||n.compareTo(e)>=0);var f=n.modPow(i,this);if(0!=f.compareTo(a.ONE)&&0!=f.compareTo(e)){for(var c=1;c++<r&&0!=f.compareTo(e);)if(0==(f=f.modPowInt(2,this)).compareTo(a.ONE))return!1;if(0!=f.compareTo(e))return!1}}return!0},a.prototype.clone=function(){var t=s();return this.copyTo(t),t},a.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},a.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n<this.DB&&(r=this.data[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this.data[t]&(1<<n)-1)<<8-n,r|=this.data[--t]>>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},a.prototype.equals=function(t){return 0==this.compareTo(t)},a.prototype.min=function(t){return this.compareTo(t)<0?this:t},a.prototype.max=function(t){return this.compareTo(t)>0?this:t},a.prototype.and=function(t){var e=s();return this.bitwiseTo(t,g,e),e},a.prototype.or=function(t){var e=s();return this.bitwiseTo(t,m,e),e},a.prototype.xor=function(t){var e=s();return this.bitwiseTo(t,v,e),e},a.prototype.andNot=function(t){var e=s();return this.bitwiseTo(t,w,e),e},a.prototype.not=function(){for(var t=s(),e=0;e<this.t;++e)t.data[e]=this.DM&~this.data[e];return t.t=this.t,t.s=~this.s,t},a.prototype.shiftLeft=function(t){var e=s();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},a.prototype.shiftRight=function(t){var e=s();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},a.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this.data[t])return t*this.DB+S(this.data[t]);return this.s<0?this.t*this.DB:-1},a.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=E(this.data[r]^e);return t},a.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this.data[e]&1<<t%this.DB)},a.prototype.setBit=function(t){return this.changeBit(t,m)},a.prototype.clearBit=function(t){return this.changeBit(t,w)},a.prototype.flipBit=function(t){return this.changeBit(t,v)},a.prototype.add=function(t){var e=s();return this.addTo(t,e),e},a.prototype.subtract=function(t){var e=s();return this.subTo(t,e),e},a.prototype.multiply=function(t){var e=s();return this.multiplyTo(t,e),e},a.prototype.divide=function(t){var e=s();return this.divRemTo(t,e,null),e},a.prototype.remainder=function(t){var e=s();return this.divRemTo(t,null,e),e},a.prototype.divideAndRemainder=function(t){var e=s(),r=s();return this.divRemTo(t,e,r),new Array(e,r)},a.prototype.modPow=function(t,e){var r,n,i=t.bitLength(),a=l(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new b(e):e.isEven()?new B(e):new y(e);var o=new Array,f=3,c=r-1,u=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=s();for(n.sqrTo(o[1],h);f<=u;)o[f]=s(),n.mulTo(h,o[f-2],o[f]),f+=2}var d,g,m=t.t-1,v=!0,w=s();for(i=p(t.data[m])-1;m>=0;){for(i>=c?d=t.data[m]>>i-c&u:(d=(t.data[m]&(1<<i+1)-1)<<c-i,m>0&&(d|=t.data[m-1]>>this.DB+i-c)),f=r;0==(1&d);)d>>=1,--f;if((i-=f)<0&&(i+=this.DB,--m),v)o[d].copyTo(a),v=!1;else{for(;f>1;)n.sqrTo(a,w),n.sqrTo(w,a),f-=2;f>0?n.sqrTo(a,w):(g=a,a=w,w=g),n.mulTo(w,o[d],a)}for(;m>=0&&0==(t.data[m]&1<<i);)n.sqrTo(a,w),g=a,a=w,w=g,--i<0&&(i=this.DB-1,--m)}return n.revert(a)},a.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return a.ZERO;for(var r=t.clone(),n=this.clone(),i=l(1),s=l(0),o=l(0),f=l(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;n.isEven();)n.rShiftTo(1,n),e?(o.isEven()&&f.isEven()||(o.addTo(this,o),f.subTo(t,f)),o.rShiftTo(1,o)):f.isEven()||f.subTo(t,f),f.rShiftTo(1,f);r.compareTo(n)>=0?(r.subTo(n,r),e&&i.subTo(o,i),s.subTo(f,s)):(n.subTo(r,n),e&&o.subTo(i,o),f.subTo(s,f))}return 0!=n.compareTo(a.ONE)?a.ZERO:f.compareTo(t)>=0?f.subtract(t):f.signum()<0?(f.addTo(t,f),f.signum()<0?f.add(t):f):f},a.prototype.pow=function(t){return this.exp(t,new k)},a.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return e;for(i<a&&(a=i),a>0&&(e.rShiftTo(a,e),r.rShiftTo(a,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(e=0;e<I.length;++e)if(r.data[0]==I[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<I.length;){for(var n=I[e],i=e+1;i<I.length&&n<T;)n*=I[i++];for(n=r.modInt(n);e<i;)if(n%I[e++]==0)return!1}return r.millerRabin(t)}},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(82),a=self.crypto||self.msCrypto,s=async(t,e)=>{if("undefined"==typeof self||!self.crypto&&!self.msCrypto)throw new Error("Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context");switch(e){case"sha1":return n.from(await a.subtle.digest({name:"SHA-1"},t));case"sha2-256":return n.from(await a.subtle.digest({name:"SHA-256"},t));case"sha2-512":return n.from(await a.subtle.digest({name:"SHA-512"},t));case"dbl-sha2-256":{const e=await a.subtle.digest({name:"SHA-256"},t);return n.from(await a.subtle.digest({name:"SHA-256"},e))}default:throw new Error("".concat(e," is not a supported algorithm"))}};t.exports={factory:t=>async e=>s(e,t),digest:s,multihashing:async(t,e,r)=>{const n=await s(t,e);return i.encode(n,e,r)}}},function(t,e,r){"use strict";var n=r(6),i=r(3),a=i.getNAF,s=i.getJSF,o=i.assert;function f(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=f,f.prototype.point=function(){throw new Error("Not implemented")},f.prototype.validate=function(){throw new Error("Not implemented")},f.prototype._fixedNafMul=function(t,e){o(t.precomputed);var r=t._getDoubles(),n=a(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var s=[],f=0;f<n.length;f+=r.step){var c=0;for(e=f+r.step-1;e>=f;e--)c=(c<<1)+n[e];s.push(c)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),d=i;d>0;d--){for(f=0;f<s.length;f++){(c=s[f])===d?h=h.mixedAdd(r.points[f]):c===-d&&(h=h.mixedAdd(r.points[f].neg()))}u=u.add(h)}return u.toP()},f.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=a(e,r,this._bitLength),f=this.jpoint(null,null,null),c=s.length-1;c>=0;c--){for(e=0;c>=0&&0===s[c];c--)e++;if(c>=0&&e++,f=f.dblp(e),c<0)break;var u=s[c];o(0!==u),f="affine"===t.type?u>0?f.mixedAdd(i[u-1>>1]):f.mixedAdd(i[-u-1>>1].neg()):u>0?f.add(i[u-1>>1]):f.add(i[-u-1>>1].neg())}return"affine"===t.type?f.toP():f},f.prototype._wnafMulAdd=function(t,e,r,n,i){for(var o=this._wnafT1,f=this._wnafT2,c=this._wnafT3,u=0,h=0;h<n;h++){var d=(B=e[h])._getNAFPoints(t);o[h]=d.wnd,f[h]=d.points}for(h=n-1;h>=1;h-=2){var l=h-1,p=h;if(1===o[l]&&1===o[p]){var b=[e[l],null,null,e[p]];0===e[l].y.cmp(e[p].y)?(b[1]=e[l].add(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg())):0===e[l].y.cmp(e[p].y.redNeg())?(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].add(e[p].neg())):(b[1]=e[l].toJ().mixedAdd(e[p]),b[2]=e[l].toJ().mixedAdd(e[p].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],g=s(r[l],r[p]);u=Math.max(g[0].length,u),c[l]=new Array(u),c[p]=new Array(u);for(var m=0;m<u;m++){var v=0|g[0][m],w=0|g[1][m];c[l][m]=y[3*(v+1)+(w+1)],c[p][m]=0,f[l]=b}}else c[l]=a(r[l],o[l],this._bitLength),c[p]=a(r[p],o[p],this._bitLength),u=Math.max(c[l].length,u),u=Math.max(c[p].length,u)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(h=u;h>=0;h--){for(var k=0;h>=0;){var A=!0;for(m=0;m<n;m++)E[m]=0|c[m][h],0!==E[m]&&(A=!1);if(!A)break;k++,h--}if(h>=0&&k++,S=S.dblp(k),h<0)break;for(m=0;m<n;m++){var B,I=E[m];0!==I&&(I>0?B=f[m][I-1>>1]:I<0&&(B=f[m][-I-1>>1].neg()),S="affine"===B.type?S.mixedAdd(B):S.add(B))}}for(h=0;h<n;h++)f[h]=null;return i?S:S.toP()},f.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},f.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?o(t[t.length-1]%2==0):7===t[0]&&o(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(t){return this.encode(t,!0)},c.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},c.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},c.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},c.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var a=0;a<t;a++)n=n.dbl();r.push(n)}return{step:t,points:r}},c.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},function(t,e,r){"use strict";"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";e.get=(t=self)=>{const e=t.crypto||t.msCrypto;if(!e||!e.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return e}},function(t,e,r){"use strict";var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,(function(){return new n.aes.Algorithm(t,e)}))}r(33),r(34),r(2),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},n.aes.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},n.aes.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){u||h();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return l(r._w,t,e,!1)},decrypt:function(t,e){return l(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var i=0;i<e.length;++i)r.putByte(e[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){e=r,r=[];var a=e.length();if(16===a||24===a||32===a){a>>>=2;for(i=0;i<a;++i)r.push(e.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var s=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(s);this._w=d(r,t.decrypt&&!o),this._init=!0}},n.aes._expandKey=function(t,e){return u||h(),d(t,e)},n.aes._updateBlock=l,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var a,s,o,f,c,u=!1;function h(){u=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var t=new Array(256),e=0;e<128;++e)t[e]=e<<1,t[e+128]=e+128<<1^283;a=new Array(256),s=new Array(256),f=new Array(4),c=new Array(4);for(e=0;e<4;++e)f[e]=new Array(256),c[e]=new Array(256);var r,n,i,h,d,l,p,b=0,y=0;for(e=0;e<256;++e){h=(h=y^y<<1^y<<2^y<<3^y<<4)>>8^255&h^99,a[b]=h,s[h]=b,l=(d=t[h])<<24^h<<16^h<<8^h^d,p=((r=t[b])^(n=t[r])^(i=t[n]))<<24^(b^i)<<16^(b^n^i)<<8^b^r^i;for(var g=0;g<4;++g)f[g][b]=l,c[g][h]=p,l=l<<24|l>>>8,p=p<<24|p>>>8;0===b?b=y=1:(b=r^t[t[t[r^i]]],y^=t[t[y]])}}function d(t,e){for(var r,n=t.slice(0),i=1,s=n.length,f=4*(s+6+1),u=s;u<f;++u)r=n[u-1],u%s==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^o[i]<<24,i++):s>6&&u%s==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[u]=n[u-s]^r;if(e){for(var h,d=c[0],l=c[1],p=c[2],b=c[3],y=n.slice(0),g=(u=0,(f=n.length)-4);u<f;u+=4,g-=4)if(0===u||u===f-4)y[u]=n[g],y[u+1]=n[g+3],y[u+2]=n[g+2],y[u+3]=n[g+1];else for(var m=0;m<4;++m)h=n[g+m],y[u+(3&-m)]=d[a[h>>>24]]^l[a[h>>>16&255]]^p[a[h>>>8&255]]^b[a[255&h]];n=y}return n}function l(t,e,r,n){var i,o,u,h,d,l,p,b,y,g,m,v,w=t.length/4-1;n?(i=c[0],o=c[1],u=c[2],h=c[3],d=s):(i=f[0],o=f[1],u=f[2],h=f[3],d=a),l=e[0]^t[0],p=e[n?3:1]^t[1],b=e[2]^t[2],y=e[n?1:3]^t[3];for(var S=3,E=1;E<w;++E)g=i[l>>>24]^o[p>>>16&255]^u[b>>>8&255]^h[255&y]^t[++S],m=i[p>>>24]^o[b>>>16&255]^u[y>>>8&255]^h[255&l]^t[++S],v=i[b>>>24]^o[y>>>16&255]^u[l>>>8&255]^h[255&p]^t[++S],y=i[y>>>24]^o[l>>>16&255]^u[p>>>8&255]^h[255&b]^t[++S],l=g,p=m,b=v;r[0]=d[l>>>24]<<24^d[p>>>16&255]<<16^d[b>>>8&255]<<8^d[255&y]^t[++S],r[n?3:1]=d[p>>>24]<<24^d[b>>>16&255]<<16^d[y>>>8&255]<<8^d[255&l]^t[++S],r[2]=d[b>>>24]<<24^d[y>>>16&255]<<16^d[l>>>8&255]<<8^d[255&p]^t[++S],r[n?1:3]=d[y>>>24]<<24^d[l>>>16&255]<<16^d[p>>>8&255]<<8^d[255&b]^t[++S]}function p(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=t,i.call(e,r)},e}},function(t,e,r){"use strict";var n,i,a=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function f(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var c,u=[],h=!1,d=-1;function l(){h&&c&&(h=!1,c.length?u=c.concat(u):d=-1,u.length&&p())}function p(){if(!h){var t=f(l);h=!0;for(var e=u.length;e;){for(c=u,u=[];++d<e;)c&&c[d].run();d=-1,e=u.length}c=null,h=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function b(t,e){this.fun=t,this.array=e}function y(){}a.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new b(t,e)),1!==u.length||h||f(p)},b.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=y,a.addListener=y,a.once=y,a.off=y,a.removeListener=y,a.removeAllListeners=y,a.emit=y,a.prependListener=y,a.prependOnceListener=y,a.listeners=function(t){return[]},a.binding=function(t){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(t){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(t,e,r){"use strict";var n=r(58);const{Buffer:i}=r(1);var a=r(62);t.exports=function(t,e){if(e||(e={}),!t)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var r="object"!=typeof t||i.isBuffer(t)?n.parse(t):t,s=function(){var t=this;a(r,e.encodings||{}).forEach((function(e){t[e.name]=function(t){if(!t)return null;var e={};return Object.keys(t).forEach((function(r){e[r]=t[r].value})),e}(e.values)||e}))};return s.prototype.toString=function(){return n.stringify(r)},s.prototype.toJSON=function(){return r},new s}},function(t,e,r){"use strict";e.defined=function(t){return null!=t&&("number"!=typeof t||!isNaN(t))}},function(t,e,r){"use strict";t.exports="enum KeyType {\n  RSA = 0;\n  Ed25519 = 1;\n  Secp256k1 = 2;\n}\nmessage PublicKey {\n  required KeyType Type = 1;\n  required bytes Data = 2;\n}\nmessage PrivateKey {\n  required KeyType Type = 1;\n  required bytes Data = 2;\n}"},function(t,e,r){"use strict";var n=r(0);n.pki=n.pki||{};var i=t.exports=n.pki.oids=n.oids=n.oids||{};function a(t,e){i[t]=e,i[e]=t}function s(t,e){i[t]=e}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),s("2.5.29.1","authorityKeyIdentifier"),s("2.5.29.2","keyAttributes"),s("2.5.29.3","certificatePolicies"),s("2.5.29.4","keyUsageRestriction"),s("2.5.29.5","policyMapping"),s("2.5.29.6","subtreesConstraint"),s("2.5.29.7","subjectAltName"),s("2.5.29.8","issuerAltName"),s("2.5.29.9","subjectDirectoryAttributes"),s("2.5.29.10","basicConstraints"),s("2.5.29.11","nameConstraints"),s("2.5.29.12","policyConstraints"),s("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),s("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),s("2.5.29.20","cRLNumber"),s("2.5.29.21","cRLReason"),s("2.5.29.22","expirationDate"),s("2.5.29.23","instructionCode"),s("2.5.29.24","invalidityDate"),s("2.5.29.25","cRLDistributionPoints"),s("2.5.29.26","issuingDistributionPoint"),s("2.5.29.27","deltaCRLIndicator"),s("2.5.29.28","issuingDistributionPoint"),s("2.5.29.29","certificateIssuer"),s("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),s("2.5.29.33","policyMappings"),s("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),s("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),s("2.5.29.46","freshestCRL"),s("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e){},function(t,e,r){"use strict";var n=r(0);if(r(10),r(14),r(24),r(78),r(80),r(11),r(2),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(25):null,s=n.asn1,o=n.util;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var f=n.pki,c=[6,4,2,4,2,4,6,2],u={name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},d={name:"RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},l=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p=function(t){var e;if(!(t.algorithm in f.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=f.oids[t.algorithm];var n=s.oidToDer(e).getBytes(),i=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]),a=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[]);a.value.push(s.create(s.Class.UNIVERSAL,s.Type.OID,!1,n)),a.value.push(s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,""));var o=s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(a),i.value.push(o),s.toDer(i).getBytes()},b=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var a;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(a.compareTo(e.n)>=0||!a.gcd(e.n).equals(i.ONE));for(var s=(t=t.multiply(a.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),o=t.mod(e.q).modPow(e.dQ,e.q);s.compareTo(o)<0;)s=s.add(e.p);var f=s.subtract(o).multiply(e.qInv).mod(e.p).multiply(e.q).add(o);return f=f.multiply(a.modInverse(e.n)).mod(e.n)};function y(t,e,r){var i=n.util.createBuffer(),a=Math.ceil(e.n.bitLength()/8);if(t.length>a-11){var s=new Error("Message is too long for PKCS#1 v1.5 padding.");throw s.length=t.length,s.max=a-11,s}i.putByte(0),i.putByte(r);var o,f=a-3-t.length;if(0===r||1===r){o=0===r?0:255;for(var c=0;c<f;++c)i.putByte(o)}else for(;f>0;){var u=0,h=n.random.getBytes(f);for(c=0;c<f;++c)0===(o=h.charCodeAt(c))?++u:i.putByte(o);f=u}return i.putByte(0),i.putBytes(t),i}function g(t,e,r,i){var a=Math.ceil(e.n.bitLength()/8),s=n.util.createBuffer(t),o=s.getByte(),f=s.getByte();if(0!==o||r&&0!==f&&1!==f||!r&&2!=f||r&&0===f&&void 0===i)throw new Error("Encryption block is invalid.");var c=0;if(0===f){c=a-3-i;for(var u=0;u<c;++u)if(0!==s.getByte())throw new Error("Encryption block is invalid.")}else if(1===f)for(c=0;s.length()>1;){if(255!==s.getByte()){--s.read;break}++c}else if(2===f)for(c=0;s.length()>1;){if(0===s.getByte()){--s.read;break}++c}if(0!==s.getByte()||c!==a-3-s.length())throw new Error("Encryption block is invalid.");return s.getBytes()}function m(t,e,r){"function"==typeof e&&(r=e,e={});var a={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function s(){o(t.pBits,(function(e,n){return e?r(e):(t.p=n,null!==t.q?c(e,t.q):void o(t.qBits,c))}))}function o(t,e){n.prime.generateProbablePrime(t,a,e)}function c(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var a=t.p;t.p=t.q,t.q=a}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void s();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void o(t.qBits,c);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void s();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void o(t.qBits,c);var u=t.e.modInverse(t.phi);t.keys={privateKey:f.rsa.setPrivateKey(t.n,t.e,u,t.p,t.q,u.mod(t.p1),u.mod(t.q1),t.q.modInverse(t.p)),publicKey:f.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(a.prng=e.prng),s()}function v(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function w(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function S(t){return n.util.isNodejs&&"function"==typeof a[t]}function E(t){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[t]}function k(t){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[t]}function A(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i<e.length;++i)r[i]=e.charCodeAt(i);return r}f.rsa.encrypt=function(t,e,r){var a,s=r,o=Math.ceil(e.n.bitLength()/8);!1!==r&&!0!==r?(s=2===r,a=y(t,e,r)):(a=n.util.createBuffer()).putBytes(t);for(var f=new i(a.toHex(),16),c=b(f,e,s).toString(16),u=n.util.createBuffer(),h=o-Math.ceil(c.length/2);h>0;)u.putByte(0),--h;return u.putBytes(n.util.hexToBytes(c)),u.getBytes()},f.rsa.decrypt=function(t,e,r,a){var s=Math.ceil(e.n.bitLength()/8);if(t.length!==s){var o=new Error("Encrypted message length is invalid.");throw o.length=t.length,o.expected=s,o}var f=new i(n.util.createBuffer(t).toHex(),16);if(f.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=b(f,e,r).toString(16),u=n.util.createBuffer(),h=s-Math.ceil(c.length/2);h>0;)u.putByte(0),--h;return u.putBytes(n.util.hexToBytes(c)),!1!==a?g(u.getBytes(),e,r):u.getBytes()},f.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var a,s=(r=r||{}).prng||n.random,o={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}},f=r.algorithm||"PRIMEINC";if("PRIMEINC"!==f)throw new Error("Invalid key generation algorithm: "+f);return(a={algorithm:f,state:0,bits:t,rng:o,eInt:e||65537,e:new i(null),p:null,q:null,qBits:t>>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},f.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,s=function(t,e){return t|e},o=+new Date,u=0;null===t.keys&&(e<=0||u<e);){if(0===t.state){var h=null===t.p?t.pBits:t.qBits,d=h-1;0===t.pqState?(t.num=new i(h,t.rng),t.num.testBit(d)||t.num.bitwiseTo(i.ONE.shiftLeft(d),s,t.num),t.num.dAddOffset(31-t.num.mod(r).byteValue(),0),a=0,++t.pqState):1===t.pqState?t.num.bitLength()>h?t.pqState=0:t.num.isProbablePrime(w(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(c[a++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var l=t.e.modInverse(t.phi);t.keys={privateKey:f.rsa.setPrivateKey(t.n,t.e,l,t.p,t.q,l.mod(t.p1),l.mod(t.q1),t.q.modInverse(t.p)),publicKey:f.rsa.setPublicKey(t.n,t.e)}}u+=(n=+new Date)-o,o=n}return null!==t.keys},f.rsa.generateKeyPair=function(t,e,r,i){if(1===arguments.length?"object"==typeof t?(r=t,t=void 0):"function"==typeof t&&(i=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(i=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(t,e,r){if(t)return i(t);i(null,{privateKey:f.privateKeyFromPem(r),publicKey:f.publicKeyFromPem(e)})}));if(E("generateKey")&&E("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:A(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(t){return o.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)})).then(void 0,(function(t){i(t)})).then((function(t){if(t){var e=f.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(t)));i(null,{privateKey:e,publicKey:f.setRsaPublicKey(e.n,e.e)})}}));if(k("generateKey")&&k("exportKey")){var c=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:A(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(t){var e=t.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=f.privateKeyFromAsn1(s.fromDer(n.util.createBuffer(e)));i(null,{privateKey:r,publicKey:f.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){i(t)}},void(c.onerror=function(t){i(t)})}}else if(S("generateKeyPairSync")){var u=a.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:f.privateKeyFromPem(u.privateKey),publicKey:f.publicKeyFromPem(u.publicKey)}}var h=f.rsa.createKeyPairGenerationState(t,e,r);if(!i)return f.rsa.stepKeyPairGenerationState(h,0),h.keys;m(h,r,i)},f.setRsaPublicKey=f.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return y(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var a=e.encode(t,r,!0);return f.rsa.encrypt(a,r,!0)},verify:function(t,e,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(t,e){return e=g(e,r,!0),t===s.fromDer(e).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(t,e){return t===(e=g(e,r,!0))}});var i=f.rsa.decrypt(e,r,!0,!1);return n.verify(t,i,r.n.bitLength())}};return r},f.setRsaPrivateKey=f.rsa.setPrivateKey=function(t,e,r,i,a,s,o,c){var u={n:t,e:e,d:r,p:i,q:a,dP:s,dQ:o,qInv:c,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=f.rsa.decrypt(t,u,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:g};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,u,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:p},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,u.n.bitLength());return f.rsa.encrypt(n,u,r)}};return u},f.wrapRsaPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(f.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,s.toDer(t).getBytes())])},f.privateKeyFromAsn1=function(t){var e,r,a,o,c,d,l,p,b={},y=[];if(s.validate(t,u,b,y)&&(t=s.fromDer(n.util.createBuffer(b.privateKey))),b={},y=[],!s.validate(t,h,b,y)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=y,g}return e=n.util.createBuffer(b.privateKeyModulus).toHex(),r=n.util.createBuffer(b.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(b.privateKeyPrivateExponent).toHex(),o=n.util.createBuffer(b.privateKeyPrime1).toHex(),c=n.util.createBuffer(b.privateKeyPrime2).toHex(),d=n.util.createBuffer(b.privateKeyExponent1).toHex(),l=n.util.createBuffer(b.privateKeyExponent2).toHex(),p=n.util.createBuffer(b.privateKeyCoefficient).toHex(),f.setRsaPrivateKey(new i(e,16),new i(r,16),new i(a,16),new i(o,16),new i(c,16),new i(d,16),new i(l,16),new i(p,16))},f.privateKeyToAsn1=f.privateKeyToRSAPrivateKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(0).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.e)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.d)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.p)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.q)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.dP)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.dQ)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.qInv))])},f.publicKeyFromAsn1=function(t){var e={},r=[];if(s.validate(t,l,e,r)){var a,o=s.derToOid(e.publicKeyOid);if(o!==f.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=o,a;t=e.rsaPublicKey}if(r=[],!s.validate(t,d,e,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(e.publicKeyModulus).toHex(),u=n.util.createBuffer(e.publicKeyExponent).toHex();return f.setRsaPublicKey(new i(c,16),new i(u,16))},f.publicKeyToAsn1=f.publicKeyToSubjectPublicKeyInfo=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(f.oids.rsaEncryption).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]),s.create(s.Class.UNIVERSAL,s.Type.BITSTRING,!1,[f.publicKeyToRSAPublicKey(t)])])},f.publicKeyToRSAPublicKey=function(t){return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.n)),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,v(t.e))])}},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(89);function a(t,e){if(!e)throw new Error("requires an encoded buffer");const r=s(t),i=n.from(r.code);return function(t,e){s(t).decode(e.toString())}(r.name,e),n.concat([i,e])}function s(t){let e;if(i.names[t])e=i.names[t];else{if(!i.codes[t])throw new Error("Unsupported encoding");e=i.codes[t]}if(!e.isImplemented())throw new Error("Base "+t+" is not implemented yet");return e}(e=t.exports=a).encode=function(t,e){const r=s(t);return a(r.name,n.from(r.encode(e)))},e.decode=function(t){n.isBuffer(t)&&(t=t.toString());const e=t.substring(0,1);"string"==typeof(t=t.substring(1,t.length))&&(t=n.from(t));const r=s(e);return n.from(r.decode(t.toString()))},e.isEncoded=function(t){n.isBuffer(t)&&(t=t.toString());if("[object String]"!==Object.prototype.toString.call(t))return!1;const e=t.substring(0,1);try{return s(e).name}catch(r){return!1}},e.names=Object.freeze(Object.keys(i.names)),e.codes=Object.freeze(Object.keys(i.codes))},function(t,e,r){"use strict";const n=r(95),i=r(5);t.exports=function(t){if(isNaN(t)||t<=0)throw i(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return n(t)}},function(t,e,r){"use strict";const{Buffer:n}=r(1);r(2),r(14);const i=r(0);e.bigIntegerToUintBase64url=(t,r)=>{let i=n.from(t.abs().toByteArray());if(i=0===i[0]?i.slice(1):i,null!=r){if(i.length>r)throw new Error("byte array longer than desired length");i=n.concat([n.alloc(r-i.length),i])}return e.bufferToBase64url(i)},e.bufferToBase64url=t=>t.toString("base64").split("=")[0].replace(/\+/g,"-").replace(/\//g,"_"),e.base64urlToBigInteger=t=>{const r=e.base64urlToBuffer(t);return new i.jsbn.BigInteger(r.toString("hex"),16)},e.base64urlToBuffer=(t,e)=>{t=(t+"===".slice((t.length+3)%4)).replace(/-/g,"+").replace(/_/g,"/");let r=n.from(t,"base64");if(null!=e){if(r.length>e)throw new Error("byte array longer than desired length");r=n.concat([n.alloc(e-r.length),r])}return r}},function(t,e,r){"use strict";var n,i=e,a=r(31),s=r(41),o=r(3).assert;function f(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new f(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=f,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(121)}catch(u){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(t,e,r){"use strict";var n=e;n.utils=r(4),n.common=r(12),n.sha=r(115),n.ripemd=r(119),n.hmac=r(120),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(18),a=r(50),s={SHA1:"SHA-1",SHA256:"SHA-256",SHA512:"SHA-512"};e.create=async function(t,e){const r=s[t],o=await i.get().subtle.importKey("raw",e,{name:"HMAC",hash:{name:r}},!1,["sign"]);return{digest:async t=>(async(t,e)=>n.from(await i.get().subtle.sign({name:"HMAC"},t,e)))(o,t),length:a[t]}}},function(t,e,r){"use strict";var n=r(0);r(2),t.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(t,e){var r=t;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new n.cipher.BlockCipher({algorithm:r,key:e,decrypt:!1})},n.cipher.createDecipher=function(t,e){var r=t;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+t);return new n.cipher.BlockCipher({algorithm:r,key:e,decrypt:!0})},n.cipher.registerAlgorithm=function(t,e){t=t.toUpperCase(),n.cipher.algorithms[t]=e},n.cipher.getAlgorithm=function(t){return(t=t.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[t]:null};var i=n.cipher.BlockCipher=function(t){this.algorithm=t.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=t.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=t.decrypt,this.algorithm.initialize(t)};i.prototype.start=function(t){t=t||{};var e={};for(var r in t)e[r]=t[r];e.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=t.output||n.util.createBuffer(),this.mode.start(e)},i.prototype.update=function(t){for(t&&this._input.putBuffer(t);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(t){!t||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(e){return t(this.blockSize,e,!1)},this.mode.unpad=function(e){return t(this.blockSize,e,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,e)))}},function(t,e,r){"use strict";var n=r(0);r(2),n.cipher=n.cipher||{};var i=t.exports=n.cipher.modes=n.cipher.modes||{};function a(t,e){if("string"==typeof t&&(t=n.util.createBuffer(t)),n.util.isArray(t)&&t.length>4){var r=t;t=n.util.createBuffer();for(var i=0;i<r.length;++i)t.putByte(r[i])}if(t.length()<e)throw new Error("Invalid IV length; got "+t.length()+" bytes and expected "+e+" bytes.");if(!n.util.isArray(t)){var a=[],s=e/4;for(i=0;i<s;++i)a.push(t.getInt32());t=a}return t}function s(t){t[t.length-1]=t[t.length-1]+1&4294967295}function o(t){return[t/4294967296|0,4294967295&t]}i.ecb=function(t){t=t||{},this.name="ECB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(t){},i.ecb.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2)&&(t.truncate(n),!0)},i.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=a(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^t.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(t,e,r){if(t.length()<this.blockSize&&!(r&&t.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=t.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(t,e){var r=t.length()===this.blockSize?this.blockSize:this.blockSize-t.length();return t.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(t,e){if(e.overflow>0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2)&&(t.truncate(n),!0)},i.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=a(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32()^this._outBlock[i],e.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=t.getInt32(),e.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=t.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=a(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0)t.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=a(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)e.putInt32(t.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a>0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}s(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=n.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?n.util.createBuffer(t.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=n.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*i)))}this._inBlock=this._j0.slice(0),s(this._inBlock),this._partialBytes=0,e=n.util.createBuffer(e),this._aDataLength=o(8*e.length());var a=e.length()%this.blockSize;for(a&&e.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^=t.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(t.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),s(this._inBlock)},i.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),s(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)e.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(t,e){var r=!0;e.decrypt&&e.overflow&&t.truncate(this.blockSize-e.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var a=[];this.cipher.encrypt(this._j0,a);for(var s=0;s<this._ints;++s)this.tag.putInt32(this._s[s]^a[s]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(t,e){for(var r=[0,0,0,0],n=e.slice(0),i=0;i<128;++i){t[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(t,e){for(var r=1&t[3],n=3;n>0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)},i.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,a=new Array(i),s=0;s<i;++s){var o=[0,0,0,0],f=(n-1-s%n)*e;o[s/n|0]=1<<e-1<<f,a[s]=this.generateSubHashTable(this.multiply(o,t),e)}return a},i.gcm.prototype.generateSubHashTable=function(t,e){var r=1<<e,n=r>>>1,i=new Array(r);i[n]=t.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var s=1;s<a;++s){var o=i[a],f=i[s];i[a+s]=[o[0]^f[0],o[1]^f[1],o[2]^f[2],o[3]^f[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[t[0]^c[0],t[1]^c[1],t[2]^c[2],t[3]^c[3]]}return i}},function(t,e,r){"use strict";(function(e){var n=r(0);r(73),r(9),r(2);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(25)),t.exports=n.pbkdf2=a.pbkdf2=function(t,r,a,s,o,f){if("function"==typeof o&&(f=o,o=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===o||"object"!=typeof o)&&(i.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),t=e.from(t,"binary"),r=e.from(r,"binary"),f?4===i.pbkdf2Sync.length?i.pbkdf2(t,r,a,s,(function(t,e){if(t)return f(t);f(null,e.toString("binary"))})):i.pbkdf2(t,r,a,s,o,(function(t,e){if(t)return f(t);f(null,e.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(t,r,a,s).toString("binary"):i.pbkdf2Sync(t,r,a,s,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var c=o.digestLength;if(s>4294967295*c){var u=new Error("Derived key is too long.");if(f)return f(u);throw u}var h=Math.ceil(s/c),d=s-(h-1)*c,l=n.hmac.create();l.start(o,t);var p,b,y,g="";if(!f){for(var m=1;m<=h;++m){l.start(null,null),l.update(r),l.update(n.util.int32ToBytes(m)),p=y=l.digest().getBytes();for(var v=2;v<=a;++v)l.start(null,null),l.update(y),b=l.digest().getBytes(),p=n.util.xorBytes(p,b,c),y=b;g+=m<h?p:p.substr(0,d)}return g}m=1;function w(){if(m>h)return f(null,g);l.start(null,null),l.update(r),l.update(n.util.int32ToBytes(m)),p=y=l.digest().getBytes(),v=2,S()}function S(){if(v<=a)return l.start(null,null),l.update(y),b=l.digest().getBytes(),p=n.util.xorBytes(p,b,c),y=b,++v,n.util.setImmediate(S);g+=m<h?p:p.substr(0,d),++m,w()}w()}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=r(85).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),s=a.charCodeAt(0);if(255!==e[s])throw new TypeError(a+" is ambiguous");e[s]=i}var o=t.length,f=t.charAt(0),c=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function h(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);var r=0;if(" "!==t[r]){for(var i=0,a=0;t[r]===f;)i++,r++;for(var s=(t.length-r)*c+1>>>0,u=new Uint8Array(s);t[r];){var h=e[t.charCodeAt(r)];if(255===h)return;for(var d=0,l=s-1;(0!==h||d<a)&&-1!==l;l--,d++)h+=o*u[l]>>>0,u[l]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");a=d,r++}if(" "!==t[r]){for(var p=s-a;p!==s&&0===u[p];)p++;var b=n.allocUnsafe(i+(s-p));b.fill(0,0,i);for(var y=i;p!==s;)b[y++]=u[p++];return b}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,a=0,s=e.length;a!==s&&0===e[a];)a++,r++;for(var c=(s-a)*u+1>>>0,h=new Uint8Array(c);a!==s;){for(var d=e[a],l=0,p=c-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*h[p]>>>0,h[p]=d%o>>>0,d=d/o>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,a++}for(var b=c-i;b!==c&&0===h[b];)b++;for(var y=f.repeat(r);b<c;++b)y+=t.charAt(h[b]);return y},decodeUnsafe:h,decode:function(t){var e=h(t);if(e)return e;throw new Error("Non-base"+o+" character")}}}},function(t,e,r){"use strict";var n=r(0);r(9),r(2);var i=t.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(t){if(o||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),128),f=[[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]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0),void 0===t&&(t="SHA-512"),!(t in c))throw new Error("Invalid SHA-512 algorithm: "+t);for(var e=c[t],r=null,i=n.util.createBuffer(),a=new Array(80),h=0;h<80;++h)a[h]=new Array(2);var d=64;switch(t){case"SHA-384":d=48;break;case"SHA-512/256":d=32;break;case"SHA-512/224":d=28}var l={algorithm:t.replace("-","").toLowerCase(),blockLength:128,digestLength:d,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){l.messageLength=0,l.fullMessageLength=l.messageLength128=[];for(var t=l.messageLengthSize/4,a=0;a<t;++a)l.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(e.length);for(a=0;a<e.length;++a)r[a]=e[a].slice(0);return l}};return l.start(),l.update=function(t,e){"utf8"===e&&(t=n.util.encodeUtf8(t));var s=t.length;l.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var o=l.fullMessageLength.length-1;o>=0;--o)l.fullMessageLength[o]+=s[1],s[1]=s[0]+(l.fullMessageLength[o]/4294967296>>>0),l.fullMessageLength[o]=l.fullMessageLength[o]>>>0,s[0]=s[1]/4294967296>>>0;return i.putBytes(t),u(r,a,i),(i.read>2048||0===i.length())&&i.compact(),l},l.digest=function(){var e=n.util.createBuffer();e.putBytes(i.bytes());var o,f=l.fullMessageLength[l.fullMessageLength.length-1]+l.messageLengthSize&l.blockLength-1;e.putBytes(s.substr(0,l.blockLength-f));for(var c=8*l.fullMessageLength[0],h=0;h<l.fullMessageLength.length-1;++h)c+=(o=8*l.fullMessageLength[h+1])/4294967296>>>0,e.putInt32(c>>>0),c=o>>>0;e.putInt32(c);var d=new Array(r.length);for(h=0;h<r.length;++h)d[h]=r[h].slice(0);u(d,a,e);var p,b=n.util.createBuffer();p="SHA-512"===t?d.length:"SHA-384"===t?d.length-2:d.length-4;for(h=0;h<p;++h)b.putInt32(d[h][0]),h===p-1&&"SHA-512/224"===t||b.putInt32(d[h][1]);return b},l};var s=null,o=!1,f=null,c=null;function u(t,e,r){for(var n,i,a,s,o,c,u,h,d,l,p,b,y,g,m,v,w,S,E,k,A,B,I,T,M,C,_,x,R,P,L,N,K,U=r.length();U>=128;){for(_=0;_<16;++_)e[_][0]=r.getInt32()>>>0,e[_][1]=r.getInt32()>>>0;for(;_<80;++_)n=(((x=(P=e[_-2])[0])>>>19|(R=P[1])<<13)^(R>>>29|x<<3)^x>>>6)>>>0,i=((x<<13|R>>>19)^(R<<3|x>>>29)^(x<<26|R>>>6))>>>0,a=(((x=(N=e[_-15])[0])>>>1|(R=N[1])<<31)^(x>>>8|R<<24)^x>>>7)>>>0,s=((x<<31|R>>>1)^(x<<24|R>>>8)^(x<<25|R>>>7))>>>0,L=e[_-7],K=e[_-16],R=i+L[1]+s+K[1],e[_][0]=n+L[0]+a+K[0]+(R/4294967296>>>0)>>>0,e[_][1]=R>>>0;for(p=t[0][0],b=t[0][1],y=t[1][0],g=t[1][1],m=t[2][0],v=t[2][1],w=t[3][0],S=t[3][1],E=t[4][0],k=t[4][1],A=t[5][0],B=t[5][1],I=t[6][0],T=t[6][1],M=t[7][0],C=t[7][1],_=0;_<80;++_)u=((E>>>14|k<<18)^(E>>>18|k<<14)^(k>>>9|E<<23))>>>0,h=(I^E&(A^I))>>>0,o=((p>>>28|b<<4)^(b>>>2|p<<30)^(b>>>7|p<<25))>>>0,c=((p<<4|b>>>28)^(b<<30|p>>>2)^(b<<25|p>>>7))>>>0,d=(p&y|m&(p^y))>>>0,l=(b&g|v&(b^g))>>>0,R=C+(((E<<18|k>>>14)^(E<<14|k>>>18)^(k<<23|E>>>9))>>>0)+((T^k&(B^T))>>>0)+f[_][1]+e[_][1],n=M+u+h+f[_][0]+e[_][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=o+d+((R=c+l)/4294967296>>>0)>>>0,s=R>>>0,M=I,C=T,I=A,T=B,A=E,B=k,E=w+n+((R=S+i)/4294967296>>>0)>>>0,k=R>>>0,w=m,S=v,m=y,v=g,y=p,g=b,p=n+a+((R=i+s)/4294967296>>>0)>>>0,b=R>>>0;R=t[0][1]+b,t[0][0]=t[0][0]+p+(R/4294967296>>>0)>>>0,t[0][1]=R>>>0,R=t[1][1]+g,t[1][0]=t[1][0]+y+(R/4294967296>>>0)>>>0,t[1][1]=R>>>0,R=t[2][1]+v,t[2][0]=t[2][0]+m+(R/4294967296>>>0)>>>0,t[2][1]=R>>>0,R=t[3][1]+S,t[3][0]=t[3][0]+w+(R/4294967296>>>0)>>>0,t[3][1]=R>>>0,R=t[4][1]+k,t[4][0]=t[4][0]+E+(R/4294967296>>>0)>>>0,t[4][1]=R>>>0,R=t[5][1]+B,t[5][0]=t[5][0]+A+(R/4294967296>>>0)>>>0,t[5][1]=R>>>0,R=t[6][1]+T,t[6][0]=t[6][0]+I+(R/4294967296>>>0)>>>0,t[6][1]=R>>>0,R=t[7][1]+C,t[7][0]=t[7][0]+M+(R/4294967296>>>0)>>>0,t[7][1]=R>>>0,U-=128}}},function(t,e,r){"use strict";(function(e){var n=r(0);r(14),r(11),r(37),r(2);var i=r(98),a=i.publicKeyValidator,s=i.privateKeyValidator;if(void 0===o)var o=n.jsbn.BigInteger;var f=n.util.ByteBuffer,c=void 0===e?Uint8Array:e;n.pki=n.pki||{},t.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var u=n.ed25519;function h(t){var r=t.message;if(r instanceof Uint8Array||r instanceof c)return r;var n=t.encoding;if(void 0===r){if(!t.md)throw new TypeError('"options.message" or "options.md" not specified.');r=t.md.digest().getBytes(),n="binary"}if("string"==typeof r&&!n)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof r){if(void 0!==e)return e.from(r,n);r=new f(r,n)}else if(!(r instanceof f))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new c(r.length()),a=0;a<i.length;++a)i[a]=r.at(a);return i}u.constants={},u.constants.PUBLIC_KEY_BYTE_LENGTH=32,u.constants.PRIVATE_KEY_BYTE_LENGTH=64,u.constants.SEED_BYTE_LENGTH=32,u.constants.SIGN_BYTE_LENGTH=64,u.constants.HASH_BYTE_LENGTH=64,u.generateKeyPair=function(t){var e=(t=t||{}).seed;if(void 0===e)e=n.random.getBytesSync(u.constants.SEED_BYTE_LENGTH);else if("string"==typeof e){if(e.length!==u.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+u.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(e instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');e=h({message:e,encoding:"binary"});for(var r=new c(u.constants.PUBLIC_KEY_BYTE_LENGTH),i=new c(u.constants.PRIVATE_KEY_BYTE_LENGTH),a=0;a<32;++a)i[a]=e[a];return function(t,e){var r,n=[N(),N(),N(),N()],i=w(e,32);for(i[0]&=248,i[31]&=127,i[31]|=64,x(n,i),B(t,n),r=0;r<32;++r)e[r+32]=t[r]}(r,i),{publicKey:r,privateKey:i}},u.privateKeyFromAsn1=function(t){var e={},r=[];if(!n.asn1.validate(t,s,e,r)){var i=new Error("Invalid Key.");throw i.errors=r,i}var a=n.asn1.derToOid(e.privateKeyOid),o=n.oids.EdDSA25519;if(a!==o)throw new Error('Invalid OID "'+a+'"; OID must be "'+o+'".');var f=e.privateKey;return{privateKeyBytes:h({message:n.asn1.fromDer(f).value,encoding:"binary"})}},u.publicKeyFromAsn1=function(t){var e={},r=[];if(!n.asn1.validate(t,a,e,r)){var i=new Error("Invalid Key.");throw i.errors=r,i}var s=n.asn1.derToOid(e.publicKeyOid),o=n.oids.EdDSA25519;if(s!==o)throw new Error('Invalid OID "'+s+'"; OID must be "'+o+'".');var f=e.ed25519PublicKey;if(f.length!==u.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return h({message:f,encoding:"binary"})},u.publicKeyFromPrivateKey=function(t){var e=h({message:(t=t||{}).privateKey,encoding:"binary"});if(e.length!==u.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+u.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new c(u.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=e[32+n];return r},u.sign=function(t){var e=h(t=t||{}),r=h({message:t.privateKey,encoding:"binary"});if(r.length===u.constants.SEED_BYTE_LENGTH)r=u.generateKeyPair({seed:r}).privateKey;else if(r.length!==u.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+u.constants.SEED_BYTE_LENGTH+" or "+u.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new c(u.constants.SIGN_BYTE_LENGTH+e.length);!function(t,e,r,n){var i,a,s=new Float64Array(64),o=[N(),N(),N(),N()],f=w(n,32);f[0]&=248,f[31]&=127,f[31]|=64;var c=r+64;for(i=0;i<r;++i)t[64+i]=e[i];for(i=0;i<32;++i)t[32+i]=f[32+i];var u=w(t.subarray(32),r+32);for(E(u),x(o,u),B(t,o),i=32;i<64;++i)t[i]=n[i];var h=w(t,r+64);for(E(h),i=32;i<64;++i)s[i]=0;for(i=0;i<32;++i)s[i]=u[i];for(i=0;i<32;++i)for(a=0;a<32;a++)s[i+a]+=h[i]*f[a];S(t.subarray(32),s)}(n,e,e.length,r);for(var i=new c(u.constants.SIGN_BYTE_LENGTH),a=0;a<i.length;++a)i[a]=n[a];return i},u.verify=function(t){var e=h(t=t||{});if(void 0===t.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=h({message:t.signature,encoding:"binary"});if(r.length!==u.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+u.constants.SIGN_BYTE_LENGTH);var n=h({message:t.publicKey,encoding:"binary"});if(n.length!==u.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+u.constants.PUBLIC_KEY_BYTE_LENGTH);var i,a=new c(u.constants.SIGN_BYTE_LENGTH+e.length),s=new c(u.constants.SIGN_BYTE_LENGTH+e.length);for(i=0;i<u.constants.SIGN_BYTE_LENGTH;++i)a[i]=r[i];for(i=0;i<e.length;++i)a[i+u.constants.SIGN_BYTE_LENGTH]=e[i];return function(t,e,r,n){var i,a=new c(32),s=[N(),N(),N(),N()],o=[N(),N(),N(),N()];if(-1,r<64)return-1;if(function(t,e){var r=N(),n=N(),i=N(),a=N(),s=N(),o=N(),f=N();R(t[2],l),function(t,e){var r;for(r=0;r<16;++r)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}(t[1],e),D(i,t[1]),O(a,i,p),U(i,i,t[2]),K(a,t[2],a),D(s,a),D(o,s),O(f,o,s),O(r,f,i),O(r,r,a),function(t,e){var r,n=N();for(r=0;r<16;++r)n[r]=e[r];for(r=250;r>=0;--r)D(n,n),1!==r&&O(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(r,r),O(r,r,i),O(r,r,a),O(r,r,a),O(t[0],r,a),D(n,t[0]),O(n,n,a),T(n,i)&&O(t[0],t[0],v);if(D(n,t[0]),O(n,n,a),T(n,i))return-1;C(t[0])===e[31]>>7&&U(t[0],d,t[0]);return O(t[3],t[0],t[1]),0}(o,n))return-1;for(i=0;i<r;++i)t[i]=e[i];for(i=0;i<32;++i)t[i+32]=n[i];var f=w(t,r);if(E(f),_(s,o,f),x(o,e.subarray(32)),k(s,o),B(a,s),r-=64,M(e,0,a,0)){for(i=0;i<r;++i)t[i]=0;return-1}for(i=0;i<r;++i)t[i]=e[i+64];return r}(s,a,a.length,n)>=0};var d=N(),l=N([1]),p=N([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),b=N([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),y=N([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),g=N([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),v=N([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(t,r){var i=n.md.sha512.create(),a=new f(t);i.update(a.getBytes(r),"binary");var s=i.digest().getBytes();if(void 0!==e)return e.from(s,"binary");for(var o=new c(u.constants.HASH_BYTE_LENGTH),h=0;h<64;++h)o[h]=s.charCodeAt(h);return o}function S(t,e){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)e[i]+=r-16*e[n]*m[i-(n-32)],r=e[i]+128>>8,e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;++i)e[i]+=r-(e[31]>>4)*m[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;++i)e[i]-=r*m[i];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function E(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;S(t,e)}function k(t,e){var r=N(),n=N(),i=N(),a=N(),s=N(),o=N(),f=N(),c=N(),u=N();U(r,t[1],t[0]),U(u,e[1],e[0]),O(r,r,u),K(n,t[0],t[1]),K(u,e[0],e[1]),O(n,n,u),O(i,t[3],e[3]),O(i,i,b),O(a,t[2],e[2]),K(a,a,a),U(s,n,r),U(o,a,i),K(f,a,i),K(c,n,r),O(t[0],s,o),O(t[1],c,f),O(t[2],f,o),O(t[3],s,c)}function A(t,e,r){for(var n=0;n<4;++n)L(t[n],e[n],r)}function B(t,e){var r=N(),n=N(),i=N();!function(t,e){var r,n=N();for(r=0;r<16;++r)n[r]=e[r];for(r=253;r>=0;--r)D(n,n),2!==r&&4!==r&&O(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(i,e[2]),O(r,e[0],i),O(n,e[1],i),I(t,n),t[31]^=C(r)<<7}function I(t,e){var r,n,i,a=N(),s=N();for(r=0;r<16;++r)s[r]=e[r];for(P(s),P(s),P(s),n=0;n<2;++n){for(a[0]=s[0]-65517,r=1;r<15;++r)a[r]=s[r]-65535-(a[r-1]>>16&1),a[r-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),i=a[15]>>16&1,a[14]&=65535,L(s,a,1-i)}for(r=0;r<16;r++)t[2*r]=255&s[r],t[2*r+1]=s[r]>>8}function T(t,e){var r=new c(32),n=new c(32);return I(r,t),I(n,e),M(r,0,n,0)}function M(t,e,r,n){return function(t,e,r,n,i){var a,s=0;for(a=0;a<i;++a)s|=t[e+a]^r[n+a];return(1&s-1>>>8)-1}(t,e,r,n,32)}function C(t){var e=new c(32);return I(e,t),1&e[0]}function _(t,e,r){var n,i;for(R(t[0],d),R(t[1],l),R(t[2],l),R(t[3],d),i=255;i>=0;--i)A(t,e,n=r[i/8|0]>>(7&i)&1),k(e,t),k(t,t),A(t,e,n)}function x(t,e){var r=[N(),N(),N(),N()];R(r[0],y),R(r[1],g),R(r[2],l),O(r[3],y,g),_(t,r,e)}function R(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function P(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function L(t,e,r){for(var n,i=~(r-1),a=0;a<16;++a)n=i&(t[a]^e[a]),t[a]^=n,e[a]^=n}function N(t){var e,r=new Float64Array(16);if(t)for(e=0;e<t.length;++e)r[e]=t[e];return r}function K(t,e,r){for(var n=0;n<16;++n)t[n]=e[n]+r[n]}function U(t,e,r){for(var n=0;n<16;++n)t[n]=e[n]-r[n]}function D(t,e){O(t,e,e)}function O(t,e,r){var n,i,a=0,s=0,o=0,f=0,c=0,u=0,h=0,d=0,l=0,p=0,b=0,y=0,g=0,m=0,v=0,w=0,S=0,E=0,k=0,A=0,B=0,I=0,T=0,M=0,C=0,_=0,x=0,R=0,P=0,L=0,N=0,K=r[0],U=r[1],D=r[2],O=r[3],z=r[4],j=r[5],q=r[6],V=r[7],H=r[8],F=r[9],Y=r[10],G=r[11],W=r[12],Q=r[13],Z=r[14],J=r[15];a+=(n=e[0])*K,s+=n*U,o+=n*D,f+=n*O,c+=n*z,u+=n*j,h+=n*q,d+=n*V,l+=n*H,p+=n*F,b+=n*Y,y+=n*G,g+=n*W,m+=n*Q,v+=n*Z,w+=n*J,s+=(n=e[1])*K,o+=n*U,f+=n*D,c+=n*O,u+=n*z,h+=n*j,d+=n*q,l+=n*V,p+=n*H,b+=n*F,y+=n*Y,g+=n*G,m+=n*W,v+=n*Q,w+=n*Z,S+=n*J,o+=(n=e[2])*K,f+=n*U,c+=n*D,u+=n*O,h+=n*z,d+=n*j,l+=n*q,p+=n*V,b+=n*H,y+=n*F,g+=n*Y,m+=n*G,v+=n*W,w+=n*Q,S+=n*Z,E+=n*J,f+=(n=e[3])*K,c+=n*U,u+=n*D,h+=n*O,d+=n*z,l+=n*j,p+=n*q,b+=n*V,y+=n*H,g+=n*F,m+=n*Y,v+=n*G,w+=n*W,S+=n*Q,E+=n*Z,k+=n*J,c+=(n=e[4])*K,u+=n*U,h+=n*D,d+=n*O,l+=n*z,p+=n*j,b+=n*q,y+=n*V,g+=n*H,m+=n*F,v+=n*Y,w+=n*G,S+=n*W,E+=n*Q,k+=n*Z,A+=n*J,u+=(n=e[5])*K,h+=n*U,d+=n*D,l+=n*O,p+=n*z,b+=n*j,y+=n*q,g+=n*V,m+=n*H,v+=n*F,w+=n*Y,S+=n*G,E+=n*W,k+=n*Q,A+=n*Z,B+=n*J,h+=(n=e[6])*K,d+=n*U,l+=n*D,p+=n*O,b+=n*z,y+=n*j,g+=n*q,m+=n*V,v+=n*H,w+=n*F,S+=n*Y,E+=n*G,k+=n*W,A+=n*Q,B+=n*Z,I+=n*J,d+=(n=e[7])*K,l+=n*U,p+=n*D,b+=n*O,y+=n*z,g+=n*j,m+=n*q,v+=n*V,w+=n*H,S+=n*F,E+=n*Y,k+=n*G,A+=n*W,B+=n*Q,I+=n*Z,T+=n*J,l+=(n=e[8])*K,p+=n*U,b+=n*D,y+=n*O,g+=n*z,m+=n*j,v+=n*q,w+=n*V,S+=n*H,E+=n*F,k+=n*Y,A+=n*G,B+=n*W,I+=n*Q,T+=n*Z,M+=n*J,p+=(n=e[9])*K,b+=n*U,y+=n*D,g+=n*O,m+=n*z,v+=n*j,w+=n*q,S+=n*V,E+=n*H,k+=n*F,A+=n*Y,B+=n*G,I+=n*W,T+=n*Q,M+=n*Z,C+=n*J,b+=(n=e[10])*K,y+=n*U,g+=n*D,m+=n*O,v+=n*z,w+=n*j,S+=n*q,E+=n*V,k+=n*H,A+=n*F,B+=n*Y,I+=n*G,T+=n*W,M+=n*Q,C+=n*Z,_+=n*J,y+=(n=e[11])*K,g+=n*U,m+=n*D,v+=n*O,w+=n*z,S+=n*j,E+=n*q,k+=n*V,A+=n*H,B+=n*F,I+=n*Y,T+=n*G,M+=n*W,C+=n*Q,_+=n*Z,x+=n*J,g+=(n=e[12])*K,m+=n*U,v+=n*D,w+=n*O,S+=n*z,E+=n*j,k+=n*q,A+=n*V,B+=n*H,I+=n*F,T+=n*Y,M+=n*G,C+=n*W,_+=n*Q,x+=n*Z,R+=n*J,m+=(n=e[13])*K,v+=n*U,w+=n*D,S+=n*O,E+=n*z,k+=n*j,A+=n*q,B+=n*V,I+=n*H,T+=n*F,M+=n*Y,C+=n*G,_+=n*W,x+=n*Q,R+=n*Z,P+=n*J,v+=(n=e[14])*K,w+=n*U,S+=n*D,E+=n*O,k+=n*z,A+=n*j,B+=n*q,I+=n*V,T+=n*H,M+=n*F,C+=n*Y,_+=n*G,x+=n*W,R+=n*Q,P+=n*Z,L+=n*J,w+=(n=e[15])*K,s+=38*(E+=n*D),o+=38*(k+=n*O),f+=38*(A+=n*z),c+=38*(B+=n*j),u+=38*(I+=n*q),h+=38*(T+=n*V),d+=38*(M+=n*H),l+=38*(C+=n*F),p+=38*(_+=n*Y),b+=38*(x+=n*G),y+=38*(R+=n*W),g+=38*(P+=n*Q),m+=38*(L+=n*Z),v+=38*(N+=n*J),a=(n=(a+=38*(S+=n*U))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),t[0]=a,t[1]=s,t[2]=o,t[3]=f,t[4]=c,t[5]=u,t[6]=h,t[7]=d,t[8]=l,t[9]=p,t[10]=b,t[11]=y,t[12]=g,t[13]=m,t[14]=v,t[15]=w}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=e;function i(t){return 1===t.length?"0"+t:t}function a(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),a=i>>8,s=255&i;a?r.push(a,s):r.push(s)}return r},n.zero2=i,n.toHex=a,n.encode=function(t,e){return"hex"===e?a(t):t}},function(t,e,r){"use strict";var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=r(111);if("function"!=typeof a.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return a.randomBytes(t)}}catch(s){}},function(t,e,r){"use strict";var n=e;n.base=r(16),n.short=r(112),n.mont=r(113),n.edwards=r(114)},function(t,e,r){"use strict";var n=r(4).rotr32;function i(t,e,r){return t&e^~t&r}function a(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?a(e,r,n):void 0},e.ch32=i,e.maj32=a,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(4),i=r(12),a=r(42),s=r(8),o=n.sum32,f=n.sum32_4,c=n.sum32_5,u=a.ch32,h=a.maj32,d=a.s0_256,l=a.s1_256,p=a.g0_256,b=a.g1_256,y=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 m(){if(!(this instanceof m))return new m;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(m,y),t.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=f(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],y=this.h[2],g=this.h[3],m=this.h[4],v=this.h[5],w=this.h[6],S=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=c(S,l(m),u(m,v,w),this.k[n],r[n]),k=o(d(i),h(i,a,y));S=w,w=v,v=m,m=o(g,E),g=y,y=a,a=i,i=o(E,k)}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],a),this.h[2]=o(this.h[2],y),this.h[3]=o(this.h[3],g),this.h[4]=o(this.h[4],m),this.h[5]=o(this.h[5],v),this.h[6]=o(this.h[6],w),this.h[7]=o(this.h[7],S)},m.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(4),i=r(12),a=r(8),s=n.rotr64_hi,o=n.rotr64_lo,f=n.shr64_hi,c=n.shr64_lo,u=n.sum64,h=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,y=n.sum64_5_lo,g=i.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(t,e,r,n,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}function S(t,e,r,n,i,a){var s=e&n^~e&a;return s<0&&(s+=4294967296),s}function E(t,e,r,n,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}function k(t,e,r,n,i,a){var s=e&n^e&a^n&a;return s<0&&(s+=4294967296),s}function A(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function I(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function M(t,e){var r=s(t,e,1)^s(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=o(t,e,1)^o(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function _(t,e){var r=s(t,e,19)^s(e,t,29)^f(t,e,6);return r<0&&(r+=4294967296),r}function x(t,e){var r=o(t,e,19)^o(e,t,29)^c(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=_(r[n-4],r[n-3]),a=x(r[n-4],r[n-3]),s=r[n-14],o=r[n-13],f=M(r[n-30],r[n-29]),c=C(r[n-30],r[n-29]),u=r[n-32],h=r[n-31];r[n]=l(i,a,s,o,f,c,u,h),r[n+1]=p(i,a,s,o,f,c,u,h)}},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],f=this.h[4],c=this.h[5],l=this.h[6],p=this.h[7],g=this.h[8],m=this.h[9],v=this.h[10],M=this.h[11],C=this.h[12],_=this.h[13],x=this.h[14],R=this.h[15];a(this.k.length===r.length);for(var P=0;P<r.length;P+=2){var L=x,N=R,K=I(g,m),U=T(g,m),D=w(g,m,v,M,C),O=S(g,m,v,M,C,_),z=this.k[P],j=this.k[P+1],q=r[P],V=r[P+1],H=b(L,N,K,U,D,O,z,j,q,V),F=y(L,N,K,U,D,O,z,j,q,V);L=A(n,i),N=B(n,i),K=E(n,i,s,o,f),U=k(n,i,s,o,f,c);var Y=h(L,N,K,U),G=d(L,N,K,U);x=C,R=_,C=v,_=M,v=g,M=m,g=h(l,p,H,F),m=d(p,p,H,F),l=f,p=c,f=s,c=o,s=n,o=i,n=h(H,F,Y,G),i=d(H,F,Y,G)}u(this.h,0,n,i),u(this.h,2,s,o),u(this.h,4,f,c),u(this.h,6,l,p),u(this.h,8,g,m),u(this.h,10,v,M),u(this.h,12,C,_),u(this.h,14,x,R)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){t.exports=r(46)},function(t,e,r){"use strict";const n=r(32),i=r(51),a=r(57);e.aes=i,e.hmac=n,e.keys=a,e.randomBytes=r(28),e.pbkdf2=r(133)},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),s=n[0],o=n[1],f=new a(function(t,e,r){return 3*(e+r)/4-r}(0,s,o)),u=0,h=o>0?s-4:s;for(r=0;r<h;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],f[u++]=e>>16&255,f[u++]=e>>8&255,f[u++]=255&e;2===o&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,f[u++]=255&e);1===o&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,f[u++]=e>>8&255,f[u++]=255&e);return f},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],s=0,o=r-i;s<o;s+=16383)a.push(u(t,s,s+16383>o?o:s+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,f=s.length;o<f;++o)n[o]=s[o],i[s.charCodeAt(o)]=o;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var i,a,s=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),s.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e,r){"use strict";e.read=function(t,e,r,n,i){var a,s,o=8*i-n-1,f=(1<<o)-1,c=f>>1,u=-7,h=r?i-1:0,d=r?-1:1,l=t[e+h];for(h+=d,a=l&(1<<-u)-1,l>>=-u,u+=o;u>0;a=256*a+t[e+h],h+=d,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===a)a=1-c;else{if(a===f)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),a-=c}return(l?-1:1)*s*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var s,o,f,c=8*a-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:a-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+h>=1?d/f:d*Math.pow(2,1-h))*f>=2&&(s++,f/=2),s+h>=u?(o=0,s=u):s+h>=1?(o=(e*f-1)*Math.pow(2,i),s+=h):(o=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+l]=255&o,l+=p,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;t[r+l]=255&s,l+=p,s/=256,c-=8);t[r+l-p]|=128*b}},function(t,e,r){"use strict";var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,r){"use strict";t.exports={SHA1:20,SHA256:32,SHA512:64}},function(t,e,r){"use strict";const n=r(52),i=r(56);e.create=async function(t,e){const r=i(t),a=n.createCipheriv(r,t,e),s=n.createDecipheriv(r,t,e);return{encrypt:async t=>a.update(t),decrypt:async t=>s.update(t)}}},function(t,e,r){"use strict";const{Buffer:n}=r(1);r(19);const i=r(0);t.exports={createCipheriv:(t,e,r)=>{const a=i.cipher.createCipher("AES-CTR",e.toString("binary"));return a.start({iv:r.toString("binary")}),{update:t=>(a.update(i.util.createBuffer(t.toString("binary"))),n.from(a.output.getBytes(),"binary"))}},createDecipheriv:(t,e,r)=>{const a=i.cipher.createDecipher("AES-CTR",e.toString("binary"));return a.start({iv:r.toString("binary")}),{update:t=>(a.update(i.util.createBuffer(t.toString("binary"))),n.from(a.output.getBytes(),"binary"))}}}},function(t,e,r){"use strict";(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new a(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new a(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(54),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||void 0,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||void 0}).call(this,r(13))},function(t,e,r){"use strict";(function(t,e){!function(t,r){if(!t.setImmediate){var n,i,a,s,o,f=1,c={},u=!1,h=t.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(t);d=d&&d.setTimeout?d:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){a.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",o=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",o,!1):t.attachEvent("onmessage",o),n=function(e){t.postMessage(s+e,"*")}),d.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r<e.length;r++)e[r]=arguments[r+1];var i={callback:t,args:e};return c[f]=i,n(f),f++},d.clearImmediate=l}function l(t){delete c[t]}function p(t){if(u)setTimeout(p,0,t);else{var e=c[t];if(e){u=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(void 0,r)}}(e)}finally{l(t),u=!1}}}}}("undefined"==typeof self?void 0===t?void 0:t:self)}).call(this,r(13),r(20))},function(t,e,r){"use strict";(function(e){var r={};t.exports=r;var n={};r.encode=function(t,e,r){if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var i=0,a=e.length,s=e.charAt(0),o=[0];for(i=0;i<t.length;++i){for(var f=0,c=t[i];f<o.length;++f)c+=o[f]<<8,o[f]=c%a,c=c/a|0;for(;c>0;)o.push(c%a),c=c/a|0}for(i=0;0===t[i]&&i<t.length-1;++i)n+=s;for(i=o.length-1;i>=0;--i)n+=e[o[i]]}else n=function(t,e){var r=0,n=e.length,i=e.charAt(0),a=[0];for(r=0;r<t.length();++r){for(var s=0,o=t.at(r);s<a.length;++s)o+=a[s]<<8,a[s]=o%n,o=o/n|0;for(;o>0;)a.push(o%n),o=o/n|0}var f="";for(r=0;0===t.at(r)&&r<t.length()-1;++r)f+=i;for(r=a.length-1;r>=0;--r)f+=e[a[r]];return f}(t,e);if(r){var u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join("\r\n")}return n},r.decode=function(t,r){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof r)throw new TypeError('"alphabet" must be a string.');var i=n[r];if(!i){i=n[r]=[];for(var a=0;a<r.length;++a)i[r.charCodeAt(a)]=a}t=t.replace(/\s/g,"");var s=r.length,o=r.charAt(0),f=[0];for(a=0;a<t.length;a++){var c=i[t.charCodeAt(a)];if(void 0===c)return;for(var u=0,h=c;u<f.length;++u)h+=f[u]*s,f[u]=255&h,h>>=8;for(;h>0;)f.push(255&h),h>>=8}for(var d=0;t[d]===o&&d<t.length-1;++d)f.push(0);return void 0!==e?e.from(f.reverse()):new Uint8Array(f.reverse())}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";const n=r(5),i={16:"aes-128-ctr",32:"aes-256-ctr"};t.exports=function(t){const e=i[t.length];if(!e){const e=Object.entries(i).map(([t,e])=>"".concat(t," (").concat(e,")")).join(" / ");throw n(new Error("Invalid key length ".concat(t.length," bytes. Must be ").concat(e)),"ERR_INVALID_KEY_LENGTH")}return e}},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(21)(r(23));r(10),r(71);const a=r(0),s=r(5);e=t.exports;const o={rsa:r(81),ed25519:r(99),secp256k1:r(101)(i,r(28))};e.supportedKeys=o,e.keysPBM=i;const f="secp256k1 support requires libp2p-crypto-secp256k1 package",c="ERR_MISSING_PACKAGE";function u(t){const e=o[t.toLowerCase()];if(!e){const e=Object.keys(o).join(" / ");throw s(new Error("invalid or unsupported key type ".concat(t,". Must be ").concat(e)),"ERR_UNSUPPORTED_KEY_TYPE")}return e}e.keyStretcher=r(129),e.generateEphemeralKeyPair=r(130),e.generateKeyPair=async(t,e)=>u(t).generateKeyPair(e),e.generateKeyPairFromSeed=async(t,e,r)=>{const n=u(t);if("ed25519"!==t.toLowerCase())throw s(new Error("Seed key derivation is unimplemented for RSA or secp256k1"),"ERR_UNSUPPORTED_KEY_DERIVATION_TYPE");return n.generateKeyPairFromSeed(e,r)},e.unmarshalPublicKey=t=>{const e=i.PublicKey.decode(t),r=e.Data;switch(e.Type){case i.KeyType.RSA:return o.rsa.unmarshalRsaPublicKey(r);case i.KeyType.Ed25519:return o.ed25519.unmarshalEd25519PublicKey(r);case i.KeyType.Secp256k1:if(o.secp256k1)return o.secp256k1.unmarshalSecp256k1PublicKey(r);throw s(new Error(f),c);default:u(e.Type)}},e.marshalPublicKey=(t,e)=>(u(e=(e||"rsa").toLowerCase()),t.bytes),e.unmarshalPrivateKey=async t=>{const e=i.PrivateKey.decode(t),r=e.Data;switch(e.Type){case i.KeyType.RSA:return o.rsa.unmarshalRsaPrivateKey(r);case i.KeyType.Ed25519:return o.ed25519.unmarshalEd25519PrivateKey(r);case i.KeyType.Secp256k1:if(o.secp256k1)return o.secp256k1.unmarshalSecp256k1PrivateKey(r);throw s(new Error(f),c);default:u(e.Type)}},e.marshalPrivateKey=(t,e)=>(u(e=(e||"rsa").toLowerCase()),t.bytes),e.import=async(t,e)=>{const r=a.pki.decryptRsaPrivateKey(t,e);if(null===r)throw s(new Error("Cannot read the key, most likely the password is wrong or not a RSA key"),"ERR_CANNOT_DECRYPT_PEM");let i=a.asn1.toDer(a.pki.privateKeyToAsn1(r));return i=n.from(i.getBytes(),"binary"),o.rsa.unmarshalRsaPrivateKey(i)}},function(t,e,r){"use strict";var n=r(59),i=r(61);t.exports=n,t.exports.parse=n,t.exports.stringify=i},function(t,e,r){"use strict";var n=r(60),i=["int32","int64","uint32","uint64","sint32","sint64","bool","fixed64","sfixed64","double","fixed32","sfixed32","float"],a=function(t){for(var e={};t.length;)switch(t[0]){case"[":case",":t.shift();var r=t.shift();if("("===r&&(r=t.shift(),t.shift()),"="!==t[0])throw new Error("Unexpected token in field options: "+t[0]);if(t.shift(),"]"===t[0])throw new Error("Unexpected ] in field option");e[r]=t.shift();break;case"]":return t.shift(),e;default:throw new Error("Unexpected token in field options: "+t[0])}throw new Error("No closing tag for field options")},s=function(t){for(var e={name:null,type:null,tag:-1,map:null,oneof:null,required:!1,repeated:!1,options:{}};t.length;)switch(t[0]){case"=":t.shift(),e.tag=Number(t.shift());break;case"map":if(e.type="map",e.map={from:null,to:null},t.shift(),"<"!==t[0])throw new Error("Unexpected token in map type: "+t[0]);if(t.shift(),e.map.from=t.shift(),","!==t[0])throw new Error("Unexpected token in map type: "+t[0]);if(t.shift(),e.map.to=t.shift(),">"!==t[0])throw new Error("Unexpected token in map type: "+t[0]);t.shift(),e.name=t.shift();break;case"repeated":case"required":case"optional":var r=t.shift();e.required="required"===r,e.repeated="repeated"===r,e.type=t.shift(),e.name=t.shift();break;case"[":e.options=a(t);break;case";":if(null===e.name)throw new Error("Missing field name");if(null===e.type)throw new Error("Missing type in message field: "+e.name);if(-1===e.tag)throw new Error("Missing tag number in message field: "+e.name);return t.shift(),e;default:throw new Error("Unexpected token in message field: "+t[0])}throw new Error("No ; found for message field")},o=function(t){for(var e={enums:[],options:{},messages:[],fields:[],extends:[],extensions:null};t.length;)switch(t[0]){case"map":case"repeated":case"optional":case"required":e.fields.push(s(t));break;case"enum":e.enums.push(p(t));break;case"message":e.messages.push(u(t));break;case"extensions":e.extensions=c(t);break;case"oneof":t.shift();var r=t.shift();if("{"!==t[0])throw new Error("Unexpected token in oneof: "+t[0]);for(t.shift();"}"!==t[0];){t.unshift("optional");var n=s(t);n.oneof=r,e.fields.push(n)}t.shift();break;case"extend":e.extends.push(f(t));break;case";":t.shift();break;case"reserved":for(t.shift();";"!==t[0];)t.shift();break;case"option":var i=b(t);if(void 0!==e.options[i.name])throw new Error("Duplicate option "+i.name);e.options[i.name]=i.value;break;default:t.unshift("optional"),e.fields.push(s(t))}return e},f=function(t){return{name:t[1],message:u(t)}},c=function(t){t.shift();var e=Number(t.shift());if(isNaN(e))throw new Error("Invalid from in extensions definition");if("to"!==t.shift())throw new Error("Expected keyword 'to' in extensions definition");var r=t.shift();if("max"===r&&(r=536870911),r=Number(r),isNaN(r))throw new Error("Invalid to in extensions definition");if(";"!==t.shift())throw new Error("Missing ; in extensions definition");return{from:e,to:r}},u=function(t){t.shift();var e=1,r=[],n={name:t.shift(),options:{},enums:[],extends:[],messages:[],fields:[]};if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("{"===t[0]?e++:"}"===t[0]&&e--,!e)return t.shift(),r=o(r),n.enums=r.enums,n.messages=r.messages,n.fields=r.fields,n.extends=r.extends,n.extensions=r.extensions,n.options=r.options,n;r.push(t.shift())}if(e)throw new Error("No closing tag for message")},h=function(t){t.shift();var e=t.shift();if(";"!==t[0])throw new Error("Expected ; but found "+t[0]);return t.shift(),e},d=function(t){if(t.shift(),"="!==t[0])throw new Error("Expected = but found "+t[0]);t.shift();var e=t.shift();switch(e){case'"proto2"':e=2;break;case'"proto3"':e=3;break;default:throw new Error("Expected protobuf syntax version but found "+e)}if(";"!==t[0])throw new Error("Expected ; but found "+t[0]);return t.shift(),e},l=function(t){if(t.length<4)throw new Error("Invalid enum value: "+t.slice(0,3).join(" "));if("="!==t[1])throw new Error("Expected = but found "+t[1]);if(";"!==t[3]&&"["!==t[3])throw new Error("Expected ; or [ but found "+t[1]);var e=t.shift();t.shift();var r={value:null,options:{}};return r.value=Number(t.shift()),"["===t[0]&&(r.options=a(t)),t.shift(),{name:e,val:r}},p=function(t){t.shift();var e={},r={name:t.shift(),values:{},options:{}};if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("}"===t[0])return t.shift(),";"===t[0]&&t.shift(),r;if("option"!==t[0]){var n=l(t);r.values[n.name]=n.val}else e=b(t),r.options[e.name]=e.value}throw new Error("No closing tag for enum")},b=function(t){for(var e=null,r=null,n=function(t){return"true"===t||"false"!==t&&t.replace(/^"+|"+$/gm,"")};t.length;){if(";"===t[0])return t.shift(),{name:e,value:r};switch(t[0]){case"option":t.shift();var i="("===t[0];if(i&&t.shift(),e=t.shift(),i){if(")"!==t[0])throw new Error("Expected ) but found "+t[0]);t.shift()}"."===t[0][0]&&(e+=t.shift());break;case"=":if(t.shift(),null===e)throw new Error("Expected key for option with value: "+t[0]);if(r=n(t.shift()),"optimize_for"===e&&!/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(r))throw new Error("Unexpected value for option optimize_for: "+r);"{"===r&&(r=y(t));break;default:throw new Error("Unexpected token in option: "+t[0])}}},y=function t(e){for(var r=function(t){return"true"===t||"false"!==t&&t.replace(/^"+|"+$/gm,"")},n={};e.length;){if("}"===e[0])return e.shift(),n;var i="("===e[0];i&&e.shift();var a=e.shift();if(i){if(")"!==e[0])throw new Error("Expected ) but found "+e[0]);e.shift()}var s=null;switch(e[0]){case":":if(void 0!==n[a])throw new Error("Duplicate option map key "+a);e.shift(),"{"===(s=r(e.shift()))&&(s=t(e)),n[a]=s,";"===e[0]&&e.shift();break;case"{":if(e.shift(),s=t(e),void 0===n[a]&&(n[a]=[]),!Array.isArray(n[a]))throw new Error("Duplicate option map key "+a);n[a].push(s);break;default:throw new Error("Unexpected token in option map: "+e[0])}}throw new Error("No closing tag for option map")},g=function(t){t.shift();var e=t.shift().replace(/^"+|"+$/gm,"");if(";"!==t[0])throw new Error("Unexpected token: "+t[0]+'. Expected ";"');return t.shift(),e},m=function(t){t.shift();var e={name:t.shift(),methods:[],options:{}};if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("}"===t[0])return t.shift(),";"===t[0]&&t.shift(),e;switch(t[0]){case"option":var r=b(t);if(void 0!==e.options[r.name])throw new Error("Duplicate option "+r.name);e.options[r.name]=r.value;break;case"rpc":e.methods.push(v(t));break;default:throw new Error("Unexpected token in service: "+t[0])}}throw new Error("No closing tag for service")},v=function(t){t.shift();var e={name:t.shift(),input_type:null,output_type:null,client_streaming:!1,server_streaming:!1,options:{}};if("("!==t[0])throw new Error("Expected ( but found "+t[0]);if(t.shift(),"stream"===t[0]&&(t.shift(),e.client_streaming=!0),e.input_type=t.shift(),")"!==t[0])throw new Error("Expected ) but found "+t[0]);if(t.shift(),"returns"!==t[0])throw new Error("Expected returns but found "+t[0]);if(t.shift(),"("!==t[0])throw new Error("Expected ( but found "+t[0]);if(t.shift(),"stream"===t[0]&&(t.shift(),e.server_streaming=!0),e.output_type=t.shift(),")"!==t[0])throw new Error("Expected ) but found "+t[0]);if(t.shift(),";"===t[0])return t.shift(),e;if("{"!==t[0])throw new Error("Expected { but found "+t[0]);for(t.shift();t.length;){if("}"===t[0])return t.shift(),";"===t[0]&&t.shift(),e;if("option"!==t[0])throw new Error("Unexpected token in rpc options: "+t[0]);var r=b(t);if(void 0!==e.options[r.name])throw new Error("Duplicate option "+r.name);e.options[r.name]=r.value}throw new Error("No closing tag for rpc")};t.exports=function(t){for(var e=n(t.toString()),r=0;r<e.length;r++){var a;if(/^("|')([^'"]*)$/.test(e[r]))for(a=1===e[r].length?r+1:r;a<e.length;a++)if(/^[^'"\\]*(?:\\.[^'"\\]*)*("|')$/.test(e[a])){e=e.slice(0,r).concat(e.slice(r,a+1).join("")).concat(e.slice(a+1));break}}for(var s={syntax:3,package:null,imports:[],enums:[],messages:[],options:{},extends:[]},o=!0;e.length;){switch(e[0]){case"package":s.package=h(e);break;case"syntax":if(!o)throw new Error("Protobuf syntax version should be first thing in file");s.syntax=d(e);break;case"message":s.messages.push(u(e));break;case"enum":s.enums.push(p(e));break;case"option":var c=b(e);if(s.options[c.name])throw new Error("Duplicate option "+c.name);s.options[c.name]=c.value;break;case"import":s.imports.push(g(e));break;case"extend":s.extends.push(f(e));break;case"service":s.services||(s.services=[]),s.services.push(m(e));break;default:throw new Error("Unexpected token: "+e[0])}o=!1}return s.extends.forEach((function(t){s.messages.forEach((function(e){e.name===t.name&&t.message.fields.forEach((function(t){if(!e.extensions||t.tag<e.extensions.from||t.tag>e.extensions.to)throw new Error(e.name+" does not declare "+t.tag+" as an extension number");e.fields.push(t)}))}))})),s.messages.forEach((function(t){t.fields.forEach((function(e){var r,n,a,o;if(e.options&&"true"===e.options.packed&&-1===i.indexOf(e.type)){if(-1===e.type.indexOf(".")){if(t.enums&&t.enums.some((function(t){return t.name===e.type})))return}else{if((r=e.type.split(".")).length>2)throw new Error("what is this?");if(n=r[0],a=r[1],s.messages.some((function(t){if(t.name===n)return o=t,t})),o&&o.enums&&o.enums.some((function(t){return t.name===a})))return}throw new Error("Fields of type "+e.type+' cannot be declared [packed=true]. Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared "packed". See https://developers.google.com/protocol-buffers/docs/encoding#optional')}}))})),s}},function(t,e,r){"use strict";t.exports=function(t){var e,r=function(t){return t.trim()};return t.replace(/([;,{}()=:[\]<>]|\/\*|\*\/)/g," $1 ").split(/\n/).map(r).filter(Boolean).map((function(t){var e=t.indexOf("//");return e>-1?t.slice(0,e):t})).map(r).filter(Boolean).join("\n").split(/\s+|\n+/gm).filter((e=!1,function(t){return"/*"===t?(e=!0,!1):"*/"===t?(e=!1,!1):!e}))}},function(t,e,r){"use strict";var n=function(t,e){var r=t.repeated?"repeated":t.required?"required":"optional";"map"===t.type&&(r="map<"+t.map.from+","+t.map.to+">"),t.oneof&&(r="");var n=Object.keys(t.options||{}).map((function(e){return e+" = "+t.options[e]})).join(",");return n&&(n=" ["+n+"]"),e.push((r?r+" ":"")+("map"===t.map?"":t.type+" ")+t.name+" = "+t.tag+n+";"),e},i=function(t,e){e.push("enum "+t.name+" {"),t.options||(t.options={});var r=s(t.options,[]);return r.length>1&&e.push(r.slice(0,-1)),Object.keys(t.values).map((function(r){var n=a(t.values[r]);e.push([r+" = "+n+";"])})),e.push("}",""),e},a=function(t,e){var r=Object.keys(t.options||{}).map((function(e){return e+" = "+t.options[e]})).join(",");return r&&(r=" ["+r+"]"),t.value+r},s=function(t,e){var r=Object.keys(t);return r.forEach((function(r){var n=t[r];~r.indexOf(".")&&(r="("+r+")");var i=typeof n;"object"===i?(n=o(n,[])).length&&e.push("option "+r+" = {",n,"};"):("string"===i&&"optimize_for"!==r&&(n='"'+n+'"'),e.push("option "+r+" = "+n+";"))})),r.length>0&&e.push(""),e},o=function t(e,r){return Object.keys(e).forEach((function(n){var i=e[n],a=typeof i;"object"===a?Array.isArray(i)?i.forEach((function(e){(e=t(e,[])).length&&r.push(n+" {",e,"}")})):(i=t(i,[])).length&&r.push(n+" {",i,"}"):("string"===a&&(i='"'+i+'"'),r.push(n+": "+i))})),r},f=function(t,e){var r="rpc "+t.name+"(";t.client_streaming&&(r+="stream "),r+=t.input_type+") returns (",t.server_streaming&&(r+="stream "),r+=t.output_type+")",t.options||(t.options={});var n=s(t.options,[]);return n.length>1?e.push(r+" {",n.slice(0,-1),"}"):e.push(r+";"),e};t.exports=function(t){var e=[];return e.push('syntax = "proto'+t.syntax+'";',""),t.package&&e.push("package "+t.package+";",""),t.options||(t.options={}),s(t.options,e),t.enums||(t.enums=[]),t.enums.forEach((function(t){i(t,e)})),t.messages||(t.messages=[]),t.messages.forEach((function(t){!function t(e,r){r.push("message "+e.name+" {"),e.options||(e.options={}),s(e.options,r),e.enums||(e.enums=[]),e.enums.forEach((function(t){r.push(i(t,[]))})),e.messages||(e.messages=[]),e.messages.forEach((function(e){r.push(t(e,[]))}));var a={};return e.fields||(e.fields=[]),e.fields.forEach((function(t){t.oneof?(a[t.oneof]||(a[t.oneof]=[]),a[t.oneof].push(n(t,[]))):r.push(n(t,[]))})),Object.keys(a).forEach((function(t){a[t].unshift("oneof "+t+" {"),a[t].push("}"),r.push(a[t])})),r.push("}",""),r}(t,e)})),t.services&&t.services.forEach((function(t){!function(t,e){e.push("service "+t.name+" {"),t.options||(t.options={}),s(t.options,e),t.methods||(t.methods=[]),t.methods.forEach((function(t){e.push(f(t,[]))})),e.push("}","")}(t,e)})),e.map(function t(e){return function(r){return Array.isArray(r)?r.map(t(e+"  ")).join("\n"):e+r}}("")).join("\n")}},function(t,e,r){"use strict";var n=r(63),i=r(68),a=r(69),s=r(70),o=r(7);t.exports=function(t,e){var r={},f={},c={};!function t(e,n){e.enums&&e.enums.forEach((function(e){e.id=n+(n?".":"")+e.name,f[e.id]=e,t(e,e.id)})),e.messages&&e.messages.forEach((function(i){i.id=n+(n?".":"")+i.name,r[i.id]=i,i.fields.forEach((function(t){if(t.map){var i="Map_"+t.map.from+"_"+t.map.to,a={name:i,enums:[],messages:[],fields:[{name:"key",type:t.map.from,tag:1,repeated:!1,required:!0},{name:"value",type:t.map.to,tag:2,repeated:!1,required:!1}],extensions:null,id:n+(n?".":"")+i};r[a.id]||(r[a.id]=a,e.messages.push(a)),t.type=i,t.repeated=!0}})),t(i,i.id)}))}(t,"");var u=function(t,e){t.messages.forEach((function(r){e[r.name]=h(r.name,t.id)})),t.enums.forEach((function(t){e[t.name]=function(t){if(!t)return null;var e={};return Object.keys(t).forEach((function(r){e[r]=t[r].value})),e}(t.values)})),e.type=2,e.message=!0,e.name=t.name;var r={};t.fields.forEach((function(t){t.oneof&&(r[t.oneof]||(r[t.oneof]=[]),r[t.oneof].push(t.name))}));var n=t.fields.map((function(e){return h(e.type,t.id)})),o=s(t,n,r),f=a(t,h,n,r,o),c=i(t,h,n);return f.bytes=c.bytes=0,e.buffer=!0,e.encode=f,e.decode=c,e.encodingLength=o,e},h=function(t,i,a){if(e&&e[t])return e[t];if(n[t])return n[t];var s,h,d=(i?i+"."+t:t).split(".").map((function(e,r,n){return n.slice(0,r).concat(t).join(".")})).reverse().reduce((function(t,e){return t||r[e]||f[e]}),null);if(!1===a)return d;if(!d)throw new Error("Could not resolve "+t);return d.values?(s=d,h=Object.keys(s.values||[]).map((function(t){return parseInt(s.values[t].value,10)})),n.make(0,(function t(e,r,n){if(!h.length||-1===h.indexOf(e))throw new Error("Invalid enum value: "+e);return o.encode(e,r,n),t.bytes=o.encode.bytes,r}),(function t(e,r){var n=o.decode(e,r);if(!h.length||-1===h.indexOf(n))throw new Error("Invalid enum value: "+n);return t.bytes=o.decode.bytes,n}),o.encodingLength)):c[d.id]||u(d,c[d.id]={})};return(t.enums||[]).concat((t.messages||[]).map((function(t){return h(t.id)})))}},function(t,e,r){"use strict";var n=r(7),i=r(67);const{Buffer:a}=r(1);var s,o=function(t,e,r,n){return e.bytes=r.bytes=0,{type:t,encode:e,decode:r,encodingLength:n}};e.make=o,e.bytes=(s=function(t){return a.isBuffer(t)?t.length:a.byteLength(t)},o(2,(function t(e,r,i){var a=i,o=s(e);return n.encode(o,r,i),i+=n.encode.bytes,e instanceof Uint8Array?r.set(e,i):r.write(e,i,o),t.bytes=(i+=o)-a,r}),(function t(e,r){var i=r,a=n.decode(e,r);r+=n.decode.bytes;var s=e.slice(r,r+a);return r+=s.length,t.bytes=r-i,s}),(function(t){var e=s(t);return n.encodingLength(e)+e}))),e.string=o(2,(function t(e,r,i){var s=i,o=a.byteLength(e);return n.encode(o,r,i,"utf-8"),i+=n.encode.bytes,r.write(e,i,o),t.bytes=(i+=o)-s,r}),(function t(e,r){var i=r,a=n.decode(e,r);r+=n.decode.bytes;var s=e.toString("utf-8",r,r+a);return t.bytes=(r+=a)-i,s}),(function(t){var e=a.byteLength(t);return n.encodingLength(e)+e})),e.bool=o(0,(function t(e,r,n){return r[n]=e?1:0,t.bytes=1,r}),(function t(e,r){var n=e[r]>0;return t.bytes=1,n}),(function(t){return 1})),e.int32=o(0,(function t(e,r,i){return n.encode(e<0?e+4294967296:e,r,i),t.bytes=n.encode.bytes,r}),(function t(e,r){var i=n.decode(e,r);return t.bytes=n.decode.bytes,i>2147483647?i-4294967296:i}),(function(t){return n.encodingLength(t<0?t+4294967296:t)})),e.int64=o(0,(function t(e,r,i){if(e<0){var a=i+9;for(n.encode(-1*e,r,i),r[i+=n.encode.bytes-1]=128|r[i];i<a-1;)r[++i]=255;r[a]=1,t.bytes=10}else n.encode(e,r,i),t.bytes=n.encode.bytes;return r}),(function t(e,r){var i=n.decode(e,r);if(i>=Math.pow(2,63)){for(var s=9;255===e[r+s-1];)s--;s=s||9;var o=a.allocUnsafe(s);e.copy(o,0,r,r+s),o[s-1]=127&o[s-1],i=-1*n.decode(o,0),t.bytes=10}else t.bytes=n.decode.bytes;return i}),(function(t){return t<0?10:n.encodingLength(t)})),e.sint32=e.sint64=o(0,i.encode,i.decode,i.encodingLength),e.uint32=e.uint64=e.enum=e.varint=o(0,n.encode,n.decode,n.encodingLength),e.fixed64=e.sfixed64=o(1,(function t(e,r,n){return r.set(e,n),t.bytes=8,r}),(function t(e,r){var n=e.slice(r,r+8);return t.bytes=8,n}),(function(t){return 8})),e.double=o(1,(function t(e,r,n){return r.writeDoubleLE(e,n),t.bytes=8,r}),(function t(e,r){var n=e.readDoubleLE(r);return t.bytes=8,n}),(function(t){return 8})),e.fixed32=o(5,(function t(e,r,n){return r.writeUInt32LE(e,n),t.bytes=4,r}),(function t(e,r){var n=e.readUInt32LE(r);return t.bytes=4,n}),(function(t){return 4})),e.sfixed32=o(5,(function t(e,r,n){return r.writeInt32LE(e,n),t.bytes=4,r}),(function t(e,r){var n=e.readInt32LE(r);return t.bytes=4,n}),(function(t){return 4})),e.float=o(5,(function t(e,r,n){return r.writeFloatLE(e,n),t.bytes=4,r}),(function t(e,r){var n=e.readFloatLE(r);return t.bytes=4,n}),(function(t){return 4}))},function(t,e,r){"use strict";t.exports=function t(e,r,i){r=r||[];var a=i=i||0;for(;e>=n;)r[i++]=255&e|128,e/=128;for(;-128&e;)r[i++]=255&e|128,e>>>=7;return r[i]=0|e,t.bytes=i-a+1,r};var n=Math.pow(2,31)},function(t,e,r){"use strict";t.exports=function t(e,r){var n,i=0,a=0,s=r=r||0,o=e.length;do{if(s>=o)throw t.bytes=0,new RangeError("Could not decode varint");n=e[s++],i+=a<28?(127&n)<<a:(127&n)*Math.pow(2,a),a+=7}while(n>=128);return t.bytes=s-r,i}},function(t,e,r){"use strict";var n=Math.pow(2,7),i=Math.pow(2,14),a=Math.pow(2,21),s=Math.pow(2,28),o=Math.pow(2,35),f=Math.pow(2,42),c=Math.pow(2,49),u=Math.pow(2,56),h=Math.pow(2,63);t.exports=function(t){return t<n?1:t<i?2:t<a?3:t<s?4:t<o?5:t<f?6:t<c?7:t<u?8:t<h?9:10}},function(t,e,r){"use strict";var n=r(7);e.encode=function t(e,r,i){e=e>=0?2*e:-2*e-1;var a=n.encode(e,r,i);return t.bytes=n.encode.bytes,a},e.decode=function t(e,r){var i=n.decode(e,r);return t.bytes=n.decode.bytes,1&i?(i+1)/-2:i/2},e.encodingLength=function(t){return n.encodingLength(t>=0?2*t:-2*t-1)}},function(t,e,r){"use strict";var n=r(7),i=r(22).defined;function a(t){return"".concat(t.substring(0,1).toUpperCase()).concat(t.substring(1))}function s(t,e,r,n){if(Object.prototype.hasOwnProperty.call(t,e))return;const i=a(e);Object.defineProperties(t,{[e]:{enumerable:!0,configurable:!0,set:t=>{r=t},get:()=>void 0===r?n:r},["has".concat(i)]:{configurable:!0,value:()=>void 0!==r},["set".concat(i)]:{configurable:!0,value:t=>{r=t}},["get".concat(i)]:{configurable:!0,value:()=>r},["clear".concat(i)]:{configurable:!0,value:()=>{r=void 0,t[e]=void 0}}})}var o=function(t,e,r){switch(t){case 0:return n.decode(e,r),r+n.decode.bytes;case 1:return r+8;case 2:var i=n.decode(e,r);return r+n.decode.bytes+i;case 3:case 4:throw new Error("Groups are not supported");case 5:return r+4;default:throw new Error("Unknown wire type: "+t)}},f=function(t){if(t.map)return{};if(t.repeated)return[];switch(t.type){case"string":return"";case"bool":return!1;case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return 0;default:return null}},c=function(t,e){if(void 0===e)return e;switch(t.type){case"bool":return"true"===e;case"float":case"double":case"sfixed32":case"fixed32":case"varint":case"enum":case"uint64":case"uint32":case"int64":case"int32":case"sint64":case"sint32":return parseInt(e,10);default:return e}};t.exports=function(t,e,r){for(var u=[],h={},d=[],l=[],p=0;p<r.length;p++){var b=t.fields[p];h[b.tag]=p;var y=b.options&&b.options.default,g=e(b.type,t.id,!1);l[p]=[y,g&&g.values],t.fields[p].packed=b.repeated&&b.options&&b.options.packed&&"false"!==b.options.packed,b.required&&u.push(b.name),b.oneof&&d.push(b.name)}function m(t,e,r,i,o,f){var c=e.name;if(e.oneof)for(var u=Object.keys(r),h=0;h<u.length;h++)if(d.indexOf(u[h])>-1){const t=a(u[h]);delete r["has".concat(t)],delete r["get".concat(t)],delete r["set".concat(t)],delete r["clear".concat(t)],delete r[u[h]]}let l;if(t.message){var p=n.decode(i,o);o+=n.decode.bytes;var b=t.decode(i,o,o+p);e.map?(l=r[c]||{},l[b.key]=b.value):e.repeated?(l=r[c]||[],l.push(b)):l=b}else e.repeated?(l=r[c]||[],l.push(t.decode(i,o))):l=t.decode(i,o);return s(r,c,l),o+=t.decode.bytes}return function e(a,p,b){if(null==p&&(p=0),null==b&&(b=a.length),!(b<=a.length&&p<=a.length))throw new Error("Decoded message is not valid");for(var y,g=p,v={};;){if(b<=p){var w,S,E="",k=0;for(k=0;k<u.length;k++)if(E=u[k],!i(v[E]))throw new Error("Decoded message is not valid, missing required field: "+E);for(k=0;k<r.length;k++){let e;if(y=t.fields[k],S=l[k][0],w=l[k][1],E=y.name,!Object.prototype.hasOwnProperty.call(v,E)){var A=!1;if(y.oneof)for(var B=Object.keys(v),I=0;I<B.length;I++)if(d.indexOf(B[I])>-1){A=!0;break}A||(w?y.repeated?S=[]:(S=S&&w[S]?w[S].value:w[Object.keys(w)[0]].value,S=parseInt(S||0,10)):(e=f(y),S=c(y,S)),s(v,E,S,e))}}return e.bytes=p-g,v}var T=n.decode(a,p);p+=n.decode.bytes;var M=h[T>>3];if(null!=M){var C=r[M];if((y=t.fields[M]).packed){var _=n.decode(a,p);for(_+=p+=n.decode.bytes;p<_;)p=m(C,y,v,a,p)}else p=m(C,y,v,a,p)}else p=o(7&T,a,p)}}}},function(t,e,r){"use strict";const{Buffer:n}=r(1);var i=r(22).defined,a=r(7);t.exports=function(t,e,r,s,o){for(var f=Object.keys(s),c=r.length,u={},h=0;h<c;h++){u[h]={p:a.encode(t.fields[h].tag<<3|2),h:a.encode(t.fields[h].tag<<3|r[h].type)};var d=t.fields[h];t.fields[h].packed=d.repeated&&d.options&&d.options.packed&&"false"!==d.options.packed}function l(t,e,r,n,i,s){var o=0;if(!i)for(o=0;o<r.length;o++)t[e++]=r[o];return n.message&&(a.encode(n.encodingLength(s),t,e),e+=a.encode.bytes),n.encode(s,t,e),e+n.encode.bytes}return function e(h,d,p){null==p&&(p=0),null==d&&(d=n.allocUnsafe(o(h)));var b=p,y=Object.keys(h),g=0,m=!1;for(g=0;g<f.length;g++){var v=f[g],w=s[g];if(y.indexOf(w)>-1){if(m)throw new Error("only one of the properties defined in oneof "+v+" can be set");m=!0}}for(g=0;g<c;g++){var S=r[g],E=t.fields[g],k=h[E.name],A=0;if(i(k)){var B,I=u[g].p,T=u[g].h,M=E.packed;if(E.map){var C=Object.keys(k);for(A=0;A<C.length;A++)C[A]={key:C[A],value:k[C[A]]};k=C}if(M){var _=0;for(A=0;A<k.length;A++)Object.prototype.hasOwnProperty.call(k,A)&&(_+=S.encodingLength(k[A]));if(_){for(A=0;A<T.length;A++)d[p++]=I[A];a.encode(_,d,p),p+=a.encode.bytes}}if(E.repeated)for(A=0;A<k.length;A++)B=k[A],i(B)&&(p=l(d,p,T,S,M,B));else p=l(d,p,T,S,M,k)}else if(E.required)throw new Error(E.name+" is required")}return e.bytes=p-b,d}}},function(t,e,r){"use strict";var n=r(22).defined,i=r(7);t.exports=function(t,e,r){for(var a=Object.keys(r),s=e.length,o=new Array(s),f=0;f<t.fields.length;f++){o[f]=i.encodingLength(t.fields[f].tag<<3|e[f].type);var c=t.fields[f];t.fields[f].packed=c.repeated&&c.options&&c.options.packed&&"false"!==c.options.packed}return function(f){var c=0,u=0,h=0;for(u=0;u<a.length;u++){var d=a[u],l=r[d],p=!1;for(h=0;h<l.length;h++)if(n(f[l[h]])){if(p)throw new Error("only one of the properties defined in oneof "+d+" can be set");p=!0}}for(u=0;u<s;u++){var b,y=e[u],g=t.fields[u],m=f[g.name],v=o[u];if(n(m)){if(g.map){var w=Object.keys(m);for(h=0;h<w.length;h++)w[h]={key:w[h],value:m[w[h]]};m=w}if(g.packed){var S=0;for(h=0;h<m.length;h++)n(m[h])&&(S+=b=y.encodingLength(m[h]),y.message&&(S+=i.encodingLength(b)));S&&(c+=v+S+i.encodingLength(S))}else if(g.repeated)for(h=0;h<m.length;h++)n(m[h])&&(c+=v+(b=y.encodingLength(m[h]))+(y.message?i.encodingLength(b):0));else c+=v+(b=y.encodingLength(m))+(y.message?i.encodingLength(b):0)}else if(g.required)throw new Error(g.name+" is required")}return c}}},function(t,e,r){"use strict";var n=r(0);if(r(19),r(10),r(72),r(9),r(24),r(35),r(74),r(11),r(77),r(26),r(2),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,s=n.pki=n.pki||{};t.exports=s.pbe=n.pbe=n.pbe||{};var o=s.oids,f={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},u={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(t,e){return t.start().update(e).digest().getBytes()}function d(t){var e;if(t){if(!(e=s.oids[a.derToOid(t)])){var r=new Error("Unsupported PRF OID.");throw r.oid=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else e="hmacWithSHA1";return l(e)}function l(t){var e=n.md;switch(t){case"hmacWithSHA224":e=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":t=t.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=t,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!e||!(t in e))throw new Error("Unknown hash algorithm: "+t);return e[t].create()}s.encryptPrivateKeyInfo=function(t,e,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,f,c,u=n.random.getBytesSync(r.saltSize),h=r.count,d=a.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,b,y;switch(r.algorithm){case"aes128":i=16,p=16,b=o["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,b=o["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,b=o["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,b=o.desCBC,y=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),m=l(g),v=n.pkcs5.pbkdf2(e,u,h,i,m),w=n.random.getBytesSync(p);(k=y(v)).start(w),k.update(a.toDer(t)),k.finish(),c=k.output.getBytes();var S=function(t,e,r,i){var o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,t),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,e.getBytes())]);"hmacWithSHA1"!==i&&o.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]));return o}(u,d,i,g);f=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(b).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,w)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var k,A=new n.util.ByteBuffer(u);v=s.pbe.generatePkcs12Key(e,A,1,h,i),w=s.pbe.generatePkcs12Key(e,A,2,h,i);(k=n.des.createEncryptionCipher(v)).start(w),k.update(a.toDer(t)),k.finish(),c=k.output.getBytes(),f=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,u),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,d.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[f,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c)])},s.decryptPrivateKeyInfo=function(t,e){var r=null,i={},o=[];if(!a.validate(t,f,i,o)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=o,c}var u=a.derToOid(i.encryptionOid),h=s.pbe.getCipher(u,i.encryptionParams,e),d=n.util.createBuffer(i.encryptedData);return h.update(d),h.finish()&&(r=a.fromDer(h.output)),r},s.encryptedPrivateKeyToPem=function(t,e){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(t).getBytes()};return n.pem.encode(r,{maxline:e})},s.encryptedPrivateKeyFromPem=function(t){var e=n.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==e.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=e.type,r}if(e.procType&&"ENCRYPTED"===e.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(e.body)},s.encryptRsaPrivateKey=function(t,e,r){if(!(r=r||{}).legacy){var i=s.wrapRsaPrivateKey(s.privateKeyToAsn1(t));return i=s.encryptPrivateKeyInfo(i,e,r),s.encryptedPrivateKeyToPem(i)}var o,f,c,u;switch(r.algorithm){case"aes128":o="AES-128-CBC",c=16,f=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",c=24,f=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",c=32,f=n.random.getBytesSync(16),u=n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",c=24,f=n.random.getBytesSync(8),u=n.des.createEncryptionCipher;break;case"des":o="DES-CBC",c=8,f=n.random.getBytesSync(8),u=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var d=u(n.pbe.opensslDeriveBytes(e,f.substr(0,8),c));d.start(f),d.update(a.toDer(s.privateKeyToAsn1(t))),d.finish();var l={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:n.util.bytesToHex(f).toUpperCase()},body:d.output.getBytes()};return n.pem.encode(l)},s.decryptRsaPrivateKey=function(t,e){var r=null,i=n.pem.decode(t)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var o,f;switch(i.dekInfo.algorithm){case"DES-CBC":o=8,f=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":o=24,f=n.des.createDecryptionCipher;break;case"AES-128-CBC":o=16,f=n.aes.createDecryptionCipher;break;case"AES-192-CBC":o=24,f=n.aes.createDecryptionCipher;break;case"AES-256-CBC":o=32,f=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":o=5,f=function(t){return n.rc2.createDecryptionCipher(t,40)};break;case"RC2-64-CBC":o=8,f=function(t){return n.rc2.createDecryptionCipher(t,64)};break;case"RC2-128-CBC":o=16,f=function(t){return n.rc2.createDecryptionCipher(t,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var u=n.util.hexToBytes(i.dekInfo.parameters),h=f(n.pbe.opensslDeriveBytes(e,u.substr(0,8),o));if(h.start(u),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?s.decryptPrivateKeyInfo(a.fromDer(r),e):a.fromDer(r))&&(r=s.privateKeyFromAsn1(r)),r},s.pbe.generatePkcs12Key=function(t,e,r,i,a,s){var o,f;if(null==s){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');s=n.md.sha1.create()}var c=s.digestLength,u=s.blockLength,h=new n.util.ByteBuffer,d=new n.util.ByteBuffer;if(null!=t){for(f=0;f<t.length;f++)d.putInt16(t.charCodeAt(f));d.putInt16(0)}var l=d.length(),p=e.length(),b=new n.util.ByteBuffer;b.fillWithByte(r,u);var y=u*Math.ceil(p/u),g=new n.util.ByteBuffer;for(f=0;f<y;f++)g.putByte(e.at(f%p));var m=u*Math.ceil(l/u),v=new n.util.ByteBuffer;for(f=0;f<m;f++)v.putByte(d.at(f%l));var w=g;w.putBuffer(v);for(var S=Math.ceil(a/c),E=1;E<=S;E++){var k=new n.util.ByteBuffer;k.putBytes(b.bytes()),k.putBytes(w.bytes());for(var A=0;A<i;A++)s.start(),s.update(k.getBytes()),k=s.digest();var B=new n.util.ByteBuffer;for(f=0;f<u;f++)B.putByte(k.at(f%c));var I=Math.ceil(p/u)+Math.ceil(l/u),T=new n.util.ByteBuffer;for(o=0;o<I;o++){var M=new n.util.ByteBuffer(w.getBytes(u)),C=511;for(f=B.length()-1;f>=0;f--)C>>=8,C+=B.at(f)+M.at(f),M.setAt(f,255&C);T.putBuffer(M)}w=T,h.putBuffer(k)}return h.truncate(h.length()-a),h},s.pbe.getCipher=function(t,e,r){switch(t){case s.oids.pkcs5PBES2:return s.pbe.getCipherForPBES2(t,e,r);case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case s.oids["pbewithSHAAnd40BitRC2-CBC"]:return s.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},s.pbe.getCipherForPBES2=function(t,e,r){var i,o={},f=[];if(!a.validate(e,c,o,f))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=f,i;if((t=a.derToOid(o.kdfOid))!==s.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,i.supportedOids=["pkcs5PBKDF2"],i;if((t=a.derToOid(o.encOid))!==s.oids["aes128-CBC"]&&t!==s.oids["aes192-CBC"]&&t!==s.oids["aes256-CBC"]&&t!==s.oids["des-EDE3-CBC"]&&t!==s.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var u,h,l=o.kdfSalt,p=n.util.createBuffer(o.kdfIterationCount);switch(p=p.getInt(p.length()<<3),s.oids[t]){case"aes128-CBC":u=16,h=n.aes.createDecryptionCipher;break;case"aes192-CBC":u=24,h=n.aes.createDecryptionCipher;break;case"aes256-CBC":u=32,h=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":u=24,h=n.des.createDecryptionCipher;break;case"desCBC":u=8,h=n.des.createDecryptionCipher}var b=d(o.prfOid),y=n.pkcs5.pbkdf2(r,l,p,u,b),g=o.encIv,m=h(y);return m.start(g),m},s.pbe.getCipherForPKCS12PBE=function(t,e,r){var i={},o=[];if(!a.validate(e,u,i,o))throw(b=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,b;var f,c,h,l=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),t){case s.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:f=24,c=8,h=n.des.startDecrypting;break;case s.oids["pbewithSHAAnd40BitRC2-CBC"]:f=5,c=8,h=function(t,e){var r=n.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var b;throw(b=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,b}var y=d(i.prfOid),g=s.pbe.generatePkcs12Key(r,l,1,p,f,y);return y.start(),h(g,s.pbe.generatePkcs12Key(r,l,2,p,c,y))},s.pbe.opensslDeriveBytes=function(t,e,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===e&&(e="");for(var a=[h(i,t+e)],s=16,o=1;s<r;++o,s+=16)a.push(h(i,a[o-1]+t+e));return a.join("").substr(0,r)}},function(t,e,r){"use strict";var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,(function(){return new n.des.Algorithm(t,e)}))}r(33),r(34),r(2),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return l(r._keys,t,e,!1)},decrypt:function(t,e){return l(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],s=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],f=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],u=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],l=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],b=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=t.length()>8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],v=0,w=0;w<y;w++){var S=t.getInt32(),E=t.getInt32();S^=(e=252645135&(S>>>4^E))<<4,S^=e=65535&((E^=e)>>>-16^S),S^=(e=858993459&(S>>>2^(E^=e<<-16)))<<2,S^=e=65535&((E^=e)>>>-16^S),S^=(e=1431655765&(S>>>1^(E^=e<<-16)))<<1,S^=e=16711935&((E^=e)>>>8^S),e=(S^=(e=1431655765&(S>>>1^(E^=e<<8)))<<1)<<8|(E^=e)>>>20&240,S=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=e;for(var k=0;k<m.length;++k){m[k]?(S=S<<2|S>>>26,E=E<<2|E>>>26):(S=S<<1|S>>>27,E=E<<1|E>>>27);var A=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|s[S>>>12&15]|o[S>>>8&15]|f[S>>>4&15],B=c[(E&=-15)>>>28]|u[E>>>24&15]|h[E>>>20&15]|d[E>>>16&15]|l[E>>>12&15]|p[E>>>8&15]|b[E>>>4&15];e=65535&(B>>>16^A),g[v++]=A^e,g[v++]=B^e<<16}}return g}(e),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],s=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],f=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],u=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function l(t,e,r,n){var i,l,p=32===t.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var b=e[0],y=e[1];b^=(l=252645135&(b>>>4^y))<<4,b^=(l=65535&(b>>>16^(y^=l)))<<16,b^=l=858993459&((y^=l)>>>2^b),b^=l=16711935&((y^=l<<2)>>>8^b),b=(b^=(l=1431655765&(b>>>1^(y^=l<<8)))<<1)<<1|b>>>31,y=(y^=l)<<1|y>>>31;for(var g=0;g<p;g+=3){for(var m=i[g+1],v=i[g+2],w=i[g];w!=m;w+=v){var S=y^t[w],E=(y>>>4|y<<28)^t[w+1];l=b,b=y,y=l^(s[S>>>24&63]|f[S>>>16&63]|u[S>>>8&63]|d[63&S]|a[E>>>24&63]|o[E>>>16&63]|c[E>>>8&63]|h[63&E])}l=b,b=y,y=l}y=y>>>1|y<<31,y^=l=1431655765&((b=b>>>1|b<<31)>>>1^y),y^=(l=16711935&(y>>>8^(b^=l<<1)))<<8,y^=(l=858993459&(y>>>2^(b^=l)))<<2,y^=l=65535&((b^=l)>>>16^y),y^=l=252645135&((b^=l<<16)>>>4^y),b^=l<<4,r[0]=b,r[1]=y}function p(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=t,i.call(e,r)},e}},function(t,e,r){"use strict";var n=r(0);r(9),r(2),(t.exports=n.hmac=n.hmac||{}).create=function(){var t=null,e=null,r=null,i=null,a={start:function(a,s){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');e=n.md.algorithms[a].create()}else e=a;if(null===s)s=t;else{if("string"==typeof s)s=n.util.createBuffer(s);else if(n.util.isArray(s)){var o=s;s=n.util.createBuffer();for(var f=0;f<o.length;++f)s.putByte(o[f])}var c=s.length();c>e.blockLength&&(e.start(),e.update(s.bytes()),s=e.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=s.length();for(f=0;f<c;++f){o=s.at(f);r.putByte(54^o),i.putByte(92^o)}if(c<e.blockLength)for(o=e.blockLength-c,f=0;f<o;++f)r.putByte(54),i.putByte(92);t=s,r=r.bytes(),i=i.bytes()}e.start(),e.update(r)},update:function(t){e.update(t)},getMac:function(){var t=e.digest().bytes();return e.start(),e.update(i),e.update(t),e.digest()}};return a.digest=a.getMac,a}},function(t,e,r){"use strict";var n=r(0);r(2);var i=t.exports=n.pem=n.pem||{};function a(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i<t.values.length;++i)r.push(t.values[i].replace(/^(\S+\r\n)/,n));e+=r.join(",")+"\r\n";var a=0,s=-1;for(i=0;i<e.length;++i,++a)if(a>65&&-1!==s){var o=e[s];","===o?(++s,e=e.substr(0,s)+"\r\n "+e.substr(s)):e=e.substr(0,s)+"\r\n"+o+e.substr(s+1),a=i-s-1,s=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(s=i);return e}function s(t){return t.replace(/^\s+/,"")}i.encode=function(t,e){e=e||{};var r,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=a(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=a(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),i+=a(r)),t.headers)for(var s=0;s<t.headers.length;++s)i+=a(t.headers[s]);return t.procType&&(i+="\r\n"),i+=n.util.encode64(t.body,e.maxline||64)+"\r\n",i+="-----END "+t.type+"-----\r\n"},i.decode=function(t){for(var e,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/;e=i.exec(t);){var f={type:e[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(e[3])};if(r.push(f),e[2]){for(var c=e[2].split(o),u=0;e&&u<c.length;){for(var h=c[u].replace(/\s+$/,""),d=u+1;d<c.length;++d){var l=c[d];if(!/\s/.test(l[0]))break;h+=l,u=d}if(e=h.match(a)){for(var p={name:e[1],values:[]},b=e[2].split(","),y=0;y<b.length;++y)p.values.push(s(b[y]));if(f.procType)if(f.contentDomain||"Content-Domain"!==p.name)if(f.dekInfo||"DEK-Info"!==p.name)f.headers.push(p);else{if(0===p.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');f.dekInfo={algorithm:b[0],parameters:b[1]||null}}else f.contentDomain=b[0]||"";else{if("Proc-Type"!==p.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==p.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');f.procType={version:b[0],type:b[1]}}}++u}if("ENCRYPTED"===f.procType&&!f.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},function(t,e,r){"use strict";var n=r(0);r(9),r(2);var i=t.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=!0);var t=null,e=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return e=n.util.createBuffer(),t={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var o=a.length;i.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=o[1],o[1]=o[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return e.putBytes(a),f(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(e.bytes());var o,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-c));for(var u=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)u+=(o=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(u>>>0),u=o>>>0;s.putInt32(u);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};f(d,r,s);var l=n.util.createBuffer();return l.putInt32(d.h0),l.putInt32(d.h1),l.putInt32(d.h2),l.putInt32(d.h3),l.putInt32(d.h4),l.putInt32(d.h5),l.putInt32(d.h6),l.putInt32(d.h7),l},i};var a=null,s=!1,o=null;function f(t,e,r){for(var n,i,a,s,f,c,u,h,d,l,p,b,y,g=r.length();g>=64;){for(f=0;f<16;++f)e[f]=r.getInt32();for(;f<64;++f)n=((n=e[f-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=e[f-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[f]=n+e[f-7]+i+e[f-16]|0;for(c=t.h0,u=t.h1,h=t.h2,d=t.h3,l=t.h4,p=t.h5,b=t.h6,y=t.h7,f=0;f<64;++f)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),s=c&u|h&(c^u),n=y+((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(b^l&(p^b))+o[f]+e[f],y=b,b=p,p=l,l=d+n>>>0,d=h,h=u,u=c,c=n+(i=a+s)>>>0;t.h0=t.h0+c|0,t.h1=t.h1+u|0,t.h2=t.h2+h|0,t.h3=t.h3+d|0,t.h4=t.h4+l|0,t.h5=t.h5+p|0,t.h6=t.h6+b|0,t.h7=t.h7+y|0,g-=64}}},function(t,e,r){"use strict";(function(e){var n=r(0);r(2);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||e.versions["node-webkit"]||(i=r(25)),(t.exports=n.prng=n.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,a=new Array(32),s=0;s<32;++s)a[s]=r.create();function o(){if(e.pools[0].messageLength>=32)return f();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),f()}function f(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,n=0;n<32;++n)e.reseeds%r==0&&(t.update(e.pools[n].digest().getBytes()),e.pools[n].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var i=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(i),e.generated=0}function c(t){var e=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(e=function(t){return i.getRandomValues(t)});var a=n.util.createBuffer();if(e)for(;a.length()<t;){var s=Math.max(1,Math.min(t-a.length(),65536)/4),o=new Uint32Array(Math.floor(s));try{e(o);for(var f=0;f<o.length;++f)a.putInt32(o[f])}catch(l){if(!("undefined"!=typeof QuotaExceededError&&l instanceof QuotaExceededError))throw l}}if(a.length()<t)for(var c,u,h,d=Math.floor(65536*Math.random());a.length()<t;){u=16807*(65535&d),u+=(32767&(c=16807*(d>>16)))<<16,d=4294967295&(u=(2147483647&(u+=c>>15))+(u>>31));for(f=0;f<3;++f)h=d>>>(f<<3),h^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&h))}return a.getBytes(t)}return e.pools=a,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var i=e.plugin.cipher,a=e.plugin.increment,s=e.plugin.formatKey,o=e.plugin.formatSeed,c=n.util.createBuffer();e.key=null,function u(h){if(h)return r(h);if(c.length()>=t)return r(null,c.getBytes(t));e.generated>1048575&&(e.key=null);if(null===e.key)return n.util.nextTick((function(){!function(t){if(e.pools[0].messageLength>=32)return f(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,(function(r,n){if(r)return t(r);e.collect(n),f(),t()}))}(u)}));var d=i(e.key,e.seed);e.generated+=d.length,c.putBytes(d),e.key=s(i(e.key,a(e.seed))),e.seed=o(i(e.key,e.seed)),n.util.setImmediate(u)}()},e.generateSync=function(t){var r=e.plugin.cipher,i=e.plugin.increment,a=e.plugin.formatKey,s=e.plugin.formatSeed;e.key=null;for(var f=n.util.createBuffer();f.length()<t;){e.generated>1048575&&(e.key=null),null===e.key&&o();var c=r(e.key,e.seed);e.generated+=c.length,f.putBytes(c),e.key=a(r(e.key,i(e.seed))),e.seed=s(r(e.key,e.seed))}return f.getBytes(t)},i?(e.seedFile=function(t,e){i.randomBytes(t,(function(t,r){if(t)return e(t);e(null,r.toString())}))},e.seedFileSync=function(t){return i.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,c(t))}catch(r){e(r)}},e.seedFileSync=c),e.collect=function(t){for(var r=t.length,n=0;n<r;++n)e.pools[e.pool].update(t.substr(n,1)),e.pool=31===e.pool?0:e.pool+1},e.collectInt=function(t,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(t>>i&255);e.collect(n)},e.registerWorker=function(t){if(t===self)e.seedFile=function(t,e){self.addEventListener("message",(function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:t}}})};else{t.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&e.seedFile(n.forge.prng.needed,(function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})}))}))}},e}}).call(this,r(20))},function(t,e,r){"use strict";var n=r(0);r(2);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],s=function(t,e){return t<<e&65535|(65535&t)>>16-e},o=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(t,e){"string"==typeof t&&(t=n.util.createBuffer(t)),e=e||128;var r,a=t,s=t.length(),o=e,f=Math.ceil(o/8),c=255>>(7&o);for(r=s;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-s)&255]);for(a.setAt(128-f,i[a.at(128-f)&c]),r=127-f;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+f)]);return a};var f=function(t,e,r){var i,f,c,u,h=!1,d=null,l=null,p=null,b=[];for(t=n.rc2.expandKey(t,e),c=0;c<64;c++)b.push(t.getInt16Le());r?(i=function(t){for(c=0;c<4;c++)t[c]+=b[u]+(t[(c+3)%4]&t[(c+2)%4])+(~t[(c+3)%4]&t[(c+1)%4]),t[c]=s(t[c],a[c]),u++},f=function(t){for(c=0;c<4;c++)t[c]+=b[63&t[(c+3)%4]]}):(i=function(t){for(c=3;c>=0;c--)t[c]=o(t[c],a[c]),t[c]-=b[u]+(t[(c+3)%4]&t[(c+2)%4])+(~t[(c+3)%4]&t[(c+1)%4]),u--},f=function(t){for(c=3;c>=0;c--)t[c]-=b[63&t[(c+3)%4]]});var y=function(t){var e=[];for(c=0;c<4;c++){var n=d.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),e.push(65535&n)}u=r?0:63;for(var i=0;i<t.length;i++)for(var a=0;a<t[i][0];a++)t[i][1](e);for(c=0;c<4;c++)null!==p&&(r?p.putInt16Le(e[c]):e[c]^=p.getInt16Le()),l.putInt16Le(e[c])},g=null;return g={start:function(t,e){t&&"string"==typeof t&&(t=n.util.createBuffer(t)),h=!1,d=n.util.createBuffer(),l=e||new n.util.createBuffer,p=t,g.output=l},update:function(t){for(h||d.putBuffer(t);d.length()>=8;)y([[5,i],[1,f],[6,i],[1,f],[5,i]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,d,!r);else{var n=8===d.length()?8:8-d.length();d.fillWithByte(n,n)}if(e&&(h=!0,g.update()),!r&&(e=0===d.length()))if(t)e=t(8,l,!r);else{var i=l.length(),a=l.at(i-1);a>i?e=!1:l.truncate(a)}return e}}};n.rc2.startEncrypting=function(t,e,r){var i=n.rc2.createEncryptionCipher(t,128);return i.start(e,r),i},n.rc2.createEncryptionCipher=function(t,e){return f(t,e,!0)},n.rc2.startDecrypting=function(t,e,r){var i=n.rc2.createDecryptionCipher(t,128);return i.start(e,r),i},n.rc2.createDecryptionCipher=function(t,e){return f(t,e,!1)}},function(t,e,r){"use strict";var n=r(0);r(2),r(11),r(79);var i=t.exports=n.pkcs1=n.pkcs1||{};function a(t,e,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(e/r.digestLength),s=0;s<a;++s){var o=String.fromCharCode(s>>24&255,s>>16&255,s>>8&255,255&s);r.start(),r.update(t+o),i+=r.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,r){var i,s,o,f;"string"==typeof r?(i=r,s=arguments[3]||void 0,o=arguments[4]||void 0):r&&(i=r.label||void 0,s=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(f=r.mgf1.md)),o?o.start():o=n.md.sha1.create(),f||(f=o);var c=Math.ceil(t.n.bitLength()/8),u=c-2*o.digestLength-2;if(e.length>u)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=e.length,y.maxLength=u,y;i||(i=""),o.update(i,"raw");for(var h=o.digest(),d="",l=u-e.length,p=0;p<l;p++)d+="\0";var b=h.getBytes()+d+""+e;if(s){if(s.length!==o.digestLength){var y;throw(y=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=s.length,y.digestLength=o.digestLength,y}}else s=n.random.getBytes(o.digestLength);var g=a(s,c-o.digestLength-1,f),m=n.util.xorBytes(b,g,b.length),v=a(m,o.digestLength,f),w=n.util.xorBytes(s,v,s.length);return"\0"+w+m},i.decode_rsa_oaep=function(t,e,r){var i,s,o;"string"==typeof r?(i=r,s=arguments[3]||void 0):r&&(i=r.label||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var f=Math.ceil(t.n.bitLength()/8);if(e.length!==f)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=e.length,m.expectedLength=f,m;if(void 0===s?s=n.md.sha1.create():s.start(),o||(o=s),f<2*s.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),s.update(i,"raw");for(var c=s.digest().getBytes(),u=e.charAt(0),h=e.substring(1,s.digestLength+1),d=e.substring(1+s.digestLength),l=a(d,s.digestLength,o),p=n.util.xorBytes(h,l,h.length),b=a(p,f-s.digestLength-1,o),y=n.util.xorBytes(d,b,d.length),g=y.substring(0,s.digestLength),m="\0"!==u,v=0;v<s.digestLength;++v)m|=c.charAt(v)!==g.charAt(v);for(var w=1,S=s.digestLength,E=s.digestLength;E<y.length;E++){var k=y.charCodeAt(E),A=1&k^1,B=w?65534:0;m|=k&B,S+=w&=A}if(m||1!==y.charCodeAt(S))throw new Error("Invalid RSAES-OAEP padding.");return y.substring(S+1)}},function(t,e,r){"use strict";var n=r(0);r(9),r(2);var i=t.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=!0);var t=null,e=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return e=n.util.createBuffer(),t={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(a,s){"utf8"===s&&(a=n.util.encodeUtf8(a));var f=a.length;i.messageLength+=f,f=[f/4294967296>>>0,f>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=f[1],f[1]=f[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,f[0]=f[1]/4294967296>>>0;return e.putBytes(a),o(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var s=n.util.createBuffer();s.putBytes(e.bytes());var f,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;s.putBytes(a.substr(0,i.blockLength-c));for(var u=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)u+=(f=8*i.fullMessageLength[h+1])/4294967296>>>0,s.putInt32(u>>>0),u=f>>>0;s.putInt32(u);var d={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};o(d,r,s);var l=n.util.createBuffer();return l.putInt32(d.h0),l.putInt32(d.h1),l.putInt32(d.h2),l.putInt32(d.h3),l.putInt32(d.h4),l},i};var a=null,s=!1;function o(t,e,r){for(var n,i,a,s,o,f,c,u=r.length();u>=64;){for(i=t.h0,a=t.h1,s=t.h2,o=t.h3,f=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+f+1518500249+n,f=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(o^a&(s^o))+f+1518500249+n,f=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(a^s^o)+f+1859775393+n,f=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(a^s^o)+f+1859775393+n,f=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(a&s|o&(a^s))+f+2400959708+n,f=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(a^s^o)+f+3395469782+n,f=o,o=s,s=(a<<30|a>>>2)>>>0,a=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+a|0,t.h2=t.h2+s|0,t.h3=t.h3+o|0,t.h4=t.h4+f|0,u-=64}}},function(t,e,r){"use strict";var n=r(0);r(2),r(14),r(11),function(){if(n.prime)t.exports=n.prime;else{var e=t.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var s=function(t,e){return t|e};e.generateProbablePrime=function(t,e,i){"function"==typeof e&&(i=e,e={});var a=(e=e||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var s=e.prng||n.random,c={nextBytes:function(t){for(var e=s.getBytesSync(t.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r)}};if("PRIMEINC"===a.name)return function(t,e,i,a){if("workers"in i)return function(t,e,i,a){if("undefined"==typeof Worker)return o(t,e,i,a);var s=f(t,e),c=i.workers,u=i.workLoad||100,h=30*u/8,d=i.workerScript||"forge/prime.worker.js";if(-1===c)return n.util.estimateCores((function(t,e){t&&(e=2),c=e-1,l()}));function l(){c=Math.max(1,c);for(var n=[],i=0;i<c;++i)n[i]=new Worker(d);for(i=0;i<c;++i)n[i].addEventListener("message",l);var o=!1;function l(i){if(!o){0;var c=i.data;if(c.found){for(var d=0;d<n.length;++d)n[d].terminate();return o=!0,a(null,new r(c.prime,16))}s.bitLength()>t&&(s=f(t,e));var l=s.toString(16);i.target.postMessage({hex:l,workLoad:u}),s.dAddOffset(h,0)}}}l()}(t,e,i,a);return o(t,e,i,a)}(t,c,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function o(t,e,r,a){var s=f(t,e),o=function(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}(s.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var c=10;"maxBlockTime"in r&&(c=r.maxBlockTime),function t(e,r,a,s,o,c,u){var h=+new Date;do{if(e.bitLength()>r&&(e=f(r,a)),e.isProbablePrime(o))return u(null,e);e.dAddOffset(i[s++%8],0)}while(c<0||+new Date-h<c);n.util.setImmediate((function(){t(e,r,a,s,o,c,u)}))}(s,t,e,0,o,c,a)}function f(t,e){var n=new r(t,e),i=t-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),s,n),n.dAddOffset(31-n.mod(a).byteValue(),0),n}}()},function(t,e,r){"use strict";const n=r(15),i=r(21),a=r(27),s=r(5),o=r(94),f=i(r(23));r(37),r(38);const c=r(0);class u{constructor(t){this._key=t}async verify(t,e){return o.hashAndVerify(this._key,e,t)}marshal(){return o.utils.jwkToPkix(this._key)}get bytes(){return f.PublicKey.encode({Type:f.KeyType.RSA,Data:this.marshal()})}encrypt(t){return o.encrypt(this._key,t)}equals(t){return this.bytes.equals(t.bytes)}async hash(){return n.multihashing(this.bytes,"sha2-256")}}class h{constructor(t,e){this._key=t,this._publicKey=e}genSecret(){return o.getRandomValues(16)}async sign(t){return o.hashAndSign(this._key,t)}get public(){if(!this._publicKey)throw s(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new u(this._publicKey)}decrypt(t){return o.decrypt(this._key,t)}marshal(){return o.utils.jwkToPkcs1(this._key)}get bytes(){return f.PrivateKey.encode({Type:f.KeyType.RSA,Data:this.marshal()})}equals(t){return this.bytes.equals(t.bytes)}async hash(){return n.multihashing(this.bytes,"sha2-256")}async id(){const t=await this.public.hash();return a.encode("base58btc",t).toString().slice(1)}async export(t,e="pkcs-8"){let r=null;const n=new c.util.ByteBuffer(this.marshal()),i=c.asn1.fromDer(n),a=c.pki.privateKeyFromAsn1(i);if("pkcs-8"!==e)throw s(new Error("Unknown export format '".concat(e,"'. Must be pkcs-8")),"ERR_INVALID_EXPORT_FORMAT");{const e={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"};r=c.pki.encryptRsaPrivateKey(a,t,e)}return r}}t.exports={RsaPublicKey:u,RsaPrivateKey:h,unmarshalRsaPublicKey:function(t){const e=o.utils.pkixToJwk(t);return new u(e)},unmarshalRsaPrivateKey:async function(t){const e=o.utils.pkcs1ToJwk(t),r=await o.unmarshalPrivateKey(e);return new h(r.privateKey,r.publicKey)},generateKeyPair:async function(t){const e=await o.generateKey(t);return new h(e.privateKey,e.publicKey)},fromJwk:async function(t){const e=await o.unmarshalPrivateKey(t);return new h(e.privateKey,e.publicKey)}}},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(83),a=r(7),{names:s}=r(88),o={};for(const c in s)o[s[c]]=c;function f(t){e.decode(t)}e.names=s,e.codes=Object.freeze(o),e.toHexString=function(t){if(!n.isBuffer(t))throw new Error("must be passed a buffer");return t.toString("hex")},e.fromHexString=function(t){return n.from(t,"hex")},e.toB58String=function(t){if(!n.isBuffer(t))throw new Error("must be passed a buffer");return i.encode("base58btc",t).toString().slice(1)},e.fromB58String=function(t){let e=t;return n.isBuffer(t)&&(e=t.toString()),i.decode("z"+e)},e.decode=function(t){if(!n.isBuffer(t))throw new Error("multihash must be a Buffer");if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");const r=a.decode(t);if(!e.isValidCode(r))throw new Error("multihash unknown function code: 0x".concat(r.toString(16)));t=t.slice(a.decode.bytes);const i=a.decode(t);if(i<0)throw new Error("multihash invalid length: ".concat(i));if((t=t.slice(a.decode.bytes)).length!==i)throw new Error("multihash length inconsistent: 0x".concat(t.toString("hex")));return{code:r,name:o[r],length:i,digest:t}},e.encode=function(t,r,i){if(!t||void 0===r)throw new Error("multihash encode requires at least two args: digest, code");const s=e.coerceCode(r);if(!n.isBuffer(t))throw new Error("digest should be a Buffer");if(null==i&&(i=t.length),i&&t.length!==i)throw new Error("digest length should be equal to specified length.");return n.concat([n.from(a.encode(s)),n.from(a.encode(i)),t])},e.coerceCode=function(t){let r=t;if("string"==typeof t){if(void 0===s[t])throw new Error("Unrecognized hash function named: ".concat(t));r=s[t]}if("number"!=typeof r)throw new Error("Hash function code should be a number. Got: ".concat(r));if(void 0===o[r]&&!e.isAppCode(r))throw new Error("Unrecognized function code: ".concat(r));return r},e.isAppCode=function(t){return t>0&&t<16},e.isValidCode=function(t){return!!e.isAppCode(t)||!!o[t]},e.validate=f,e.prefix=function(t){return f(t),t.slice(0,2)}},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(84);function a(t){if(i.names[t])return i.names[t];if(i.codes[t])return i.codes[t];throw new Error("Unsupported encoding: ".concat(t))}(e=t.exports=function(t,e){if(!e)throw new Error("requires an encoded buffer");const r=a(t);return function(t,e){a(t).decode(e.toString())}(r.name,e),n.concat([r.codeBuf,e])}).encode=function(t,e){const r=a(t);return n.concat([r.codeBuf,n.from(r.encode(e))])},e.decode=function(t){n.isBuffer(t)&&(t=t.toString());const e=t[0];["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase());const r=a(t[0]);return n.from(r.decode(t.substring(1)))},e.isEncoded=function(t){if(n.isBuffer(t)&&(t=t.toString()),"[object String]"!==Object.prototype.toString.call(t))return!1;try{return a(t[0]).name}catch(e){return!1}},e.encoding=a,e.encodingFromData=function(t){return n.isBuffer(t)&&(t=t.toString()),a(t[0])},e.names=Object.freeze(i.names),e.codes=Object.freeze(i.codes)},function(t,e,r){"use strict";const n=r(36),{Buffer:i}=r(1),a=r(86),s=r(87),o=[["identity","\0",()=>({encode:t=>i.from(t).toString(),decode:t=>i.from(t)}),""],["base2","0",s(1),"01"],["base8","7",s(3),"01234567"],["base10","9",n,"0123456789"],["base16","f",s(4),"0123456789abcdef"],["base16upper","F",s(4),"0123456789ABCDEF"],["base32hex","v",s(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",s(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",s(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",s(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",s(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",s(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",s(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",s(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",s(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",n,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",n,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],f=o.reduce((t,e)=>(t[e[0]]=new a(e[0],e[1],e[2],e[3]),t),{}),c=o.reduce((t,e)=>(t[e[1]]=f[e[0]],t),{});t.exports={names:f,codes:c}},function(t,e,r){"use strict";var n=r(1),i=n.Buffer;function a(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(a(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),a(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";const{Buffer:n}=r(1);t.exports=class{constructor(t,e,r,i){this.name=t,this.code=e,this.codeBuf=n.from(this.code),this.alphabet=i,this.engine=r(i)}encode(t){return this.engine.encode(t)}decode(t){for(const e of t)if(this.alphabet&&this.alphabet.indexOf(e)<0)throw new Error("invalid character '".concat(e,"' in '").concat(t,"'"));return this.engine.decode(t)}}},function(t,e,r){"use strict";t.exports=t=>e=>({encode:r=>((t,e,r)=>{const n="="===e[e.length-1],i=(1<<r)-1;let a="",s=0,o=0;for(let f=0;f<t.length;++f)for(o=o<<8|t[f],s+=8;s>r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<<r-s]),n)for(;a.length*r&7;)a+="=";return a})(r,e,t),decode:r=>((t,e,r)=>{const n={};for(let c=0;c<e.length;++c)n[e[c]]=c;let i=t.length;for(;"="===t[i-1];)--i;const a=new Uint8Array(i*r/8|0);let s=0,o=0,f=0;for(let c=0;c<i;++c){const e=n[t[c]];if(void 0===e)throw new SyntaxError("Invalid character "+t[c]);o=o<<r|e,s+=r,s>=8&&(s-=8,a[f++]=255&o>>s)}if(s>=r||255&o<<8-s)throw new SyntaxError("Unexpected end of data");return a})(r,e,t)})},function(t,e,r){"use strict";const n=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});t.exports={names:n}},function(t,e,r){"use strict";const n=r(90),i=r(36),a=r(91),s=r(92),o=r(93),f=[["base1","1","","1"],["base2","0",i,"01"],["base8","7",i,"01234567"],["base10","9",i,"0123456789"],["base16","f",a,"0123456789abcdef"],["base32","b",s,"abcdefghijklmnopqrstuvwxyz234567"],["base32pad","c",s,"abcdefghijklmnopqrstuvwxyz234567="],["base32hex","v",s,"0123456789abcdefghijklmnopqrstuv"],["base32hexpad","t",s,"0123456789abcdefghijklmnopqrstuv="],["base32z","h",s,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",i,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",i,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",o,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",o,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",o,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",o,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=f.reduce((t,e)=>(t[e[0]]=new n(e[0],e[1],e[2],e[3]),t),{}),u=f.reduce((t,e)=>(t[e[1]]=c[e[0]],t),{});t.exports={names:c,codes:u}},function(t,e,r){"use strict";t.exports=class{constructor(t,e,r,n){this.name=t,this.code=e,this.alphabet=n,r&&n&&(this.engine=r(n))}encode(t){return this.engine.encode(t)}decode(t){return this.engine.decode(t)}isImplemented(){return this.engine}}},function(t,e,r){"use strict";const{Buffer:n}=r(1);t.exports=function(t){return{encode:t=>"string"==typeof t?n.from(t).toString("hex"):t.toString("hex"),decode(e){for(const r of e)if(t.indexOf(r)<0)throw new Error("invalid base16 character");return n.from(e,"hex")}}}},function(t,e,r){"use strict";function n(t,e){const r=t.byteLength,n=new Uint8Array(t),i=e.indexOf("=")===e.length-1;i&&(e=e.substring(0,e.length-1));let a=0,s=0,o="";for(let f=0;f<r;f++)for(s=s<<8|n[f],a+=8;a>=5;)o+=e[s>>>a-5&31],a-=5;if(a>0&&(o+=e[s<<5-a&31]),i)for(;o.length%8!=0;)o+="=";return o}t.exports=function(t){return{encode:e=>n("string"==typeof e?Uint8Array.from(e):e,t),decode(e){for(const r of e)if(t.indexOf(r)<0)throw new Error("invalid base32 character");return function(t,e){const r=(t=t.replace(new RegExp("=","g"),"")).length;let n=0,i=0,a=0;const s=new Uint8Array(5*r/8|0);for(let o=0;o<r;o++)i=i<<5|e.indexOf(t[o]),n+=5,n>=8&&(s[a++]=i>>>n-8&255,n-=8);return s.buffer}(e,t)}}}},function(t,e,r){"use strict";const{Buffer:n}=r(1);t.exports=function(t){const e=t.indexOf("=")>-1,r=t.indexOf("-")>-1&&t.indexOf("_")>-1;return{encode(t){let i="";i="string"==typeof t?n.from(t).toString("base64"):t.toString("base64"),r&&(i=i.replace(/\+/g,"-").replace(/\//g,"_"));const a=i.indexOf("=");return a>0&&!e&&(i=i.substring(0,a)),i},decode(e){for(const r of e)if(t.indexOf(r)<0)throw new Error("invalid base64 character");return n.from(e,"base64")}}}},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(18),a=r(28);function s(t){return Promise.all([i.get().subtle.exportKey("jwk",t.privateKey),i.get().subtle.exportKey("jwk",t.publicKey)])}e.utils=r(96),e.generateKey=async function(t){const e=await i.get().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]),r=await s(e);return{privateKey:r[0],publicKey:r[1]}},e.unmarshalPrivateKey=async function(t){const e=[await i.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]),await(r=t,i.get().subtle.importKey("jwk",{kty:r.kty,n:r.n,e:r.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"]))];var r;const n=await s({privateKey:e[0],publicKey:e[1]});return{privateKey:n[0],publicKey:n[1]}},e.getRandomValues=a,e.hashAndSign=async function(t,e){const r=await i.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]),a=await i.get().subtle.sign({name:"RSASSA-PKCS1-v1_5"},r,Uint8Array.from(e));return n.from(a)},e.hashAndVerify=async function(t,e,r){const n=await i.get().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);return i.get().subtle.verify({name:"RSASSA-PKCS1-v1_5"},n,e,r)};const{jwk2pub:o,jwk2priv:f}=r(97);function c(t,e,r,i){const a=e?o(t):f(t),s=i(n.from(r).toString("binary"),a);return n.from(s,"binary")}e.encrypt=function(t,e){return c(t,!0,e,(t,e)=>e.encrypt(t))},e.decrypt=function(t,e){return c(t,!1,e,(t,e)=>e.decrypt(t))}},function(t,e,r){"use strict";const n=self.crypto||self.msCrypto,{Buffer:i}=r(1);n&&n.getRandomValues?t.exports=function(t){const e=new Uint8Array(t);let r=0;if(t>0)if(t>65536)for(;r<t;)r+65536>t?(n.getRandomValues(e.subarray(r,r+(t-r))),r+=t-r):(n.getRandomValues(e.subarray(r,r+65536)),r+=65536);else n.getRandomValues(e);return i.from(e)}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},function(t,e,r){"use strict";const{Buffer:n}=r(1);r(10),r(26);const i=r(0),{bigIntegerToUintBase64url:a,base64urlToBigInteger:s}=r(29);e.pkcs1ToJwk=function(t){const e=i.asn1.fromDer(t.toString("binary")),r=i.pki.privateKeyFromAsn1(e);return{kty:"RSA",n:a(r.n),e:a(r.e),d:a(r.d),p:a(r.p),q:a(r.q),dp:a(r.dP),dq:a(r.dQ),qi:a(r.qInv),alg:"RS256",kid:"2011-04-29"}},e.jwkToPkcs1=function(t){const e=i.pki.privateKeyToAsn1({n:s(t.n),e:s(t.e),d:s(t.d),p:s(t.p),q:s(t.q),dP:s(t.dp),dQ:s(t.dq),qInv:s(t.qi)});return n.from(i.asn1.toDer(e).getBytes(),"binary")},e.pkixToJwk=function(t){const e=i.asn1.fromDer(t.toString("binary")),r=i.pki.publicKeyFromAsn1(e);return{kty:"RSA",n:a(r.n),e:a(r.e),alg:"RS256",kid:"2011-04-29"}},e.jwkToPkix=function(t){const e=i.pki.publicKeyToAsn1({n:s(t.n),e:s(t.e)});return n.from(i.asn1.toDer(e).getBytes(),"binary")}},function(t,e,r){"use strict";r(26);const n=r(0),{base64urlToBigInteger:i}=r(29);function a(t,e){return e.map(e=>i(t[e]))}t.exports={jwk2pub:function(t){return n.pki.setRsaPublicKey(...a(t,["n","e"]))},jwk2priv:function(t){return n.pki.setRsaPrivateKey(...a(t,["n","e","d","p","q","dp","dq","qi"]))}}},function(t,e,r){"use strict";var n=r(0);r(10);var i=n.asn1;e.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},e.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(15),a=r(21),s=r(27),o=r(5),f=r(100),c=a(r(23));class u{constructor(t){this._key=d(t,f.publicKeyLength)}async verify(t,e){return f.hashAndVerify(this._key,e,t)}marshal(){return n.from(this._key)}get bytes(){return c.PublicKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()})}equals(t){return this.bytes.equals(t.bytes)}async hash(){return i.multihashing(this.bytes,"sha2-256")}}class h{constructor(t,e){this._key=d(t,f.privateKeyLength),this._publicKey=d(e,f.publicKeyLength)}async sign(t){return f.hashAndSign(this._key,t)}get public(){return new u(this._publicKey)}marshal(){return n.concat([n.from(this._key),n.from(this._publicKey)])}get bytes(){return c.PrivateKey.encode({Type:c.KeyType.Ed25519,Data:this.marshal()})}equals(t){return this.bytes.equals(t.bytes)}async hash(){return i.multihashing(this.bytes,"sha2-256")}async id(){const t=await this.public.hash();return s.encode("base58btc",t).toString().slice(1)}}function d(t,e){if((t=Uint8Array.from(t||[])).length!==e)throw o(new Error("Key must be a Uint8Array or Buffer of length ".concat(e,", got ").concat(t.length)),"ERR_INVALID_KEY_TYPE");return t}t.exports={Ed25519PublicKey:u,Ed25519PrivateKey:h,unmarshalEd25519PrivateKey:function(t){if(t.length>f.privateKeyLength){const e=(t=d(t,f.privateKeyLength+f.publicKeyLength)).slice(0,f.privateKeyLength),r=t.slice(f.privateKeyLength,t.length);return new h(e,r)}const e=(t=d(t,f.privateKeyLength)).slice(0,f.privateKeyLength),r=t.slice(f.publicKeyLength);return new h(e,r)},unmarshalEd25519PublicKey:function(t){return t=d(t,f.publicKeyLength),new u(t)},generateKeyPair:async function(){const{privateKey:t,publicKey:e}=await f.generateKey();return new h(t,e)},generateKeyPairFromSeed:async function(t){const{privateKey:e,publicKey:r}=await f.generateKeyFromSeed(t);return new h(e,r)}}},function(t,e,r){"use strict";r(38);const n=r(0);e.publicKeyLength=n.pki.ed25519.constants.PUBLIC_KEY_BYTE_LENGTH,e.privateKeyLength=n.pki.ed25519.constants.PRIVATE_KEY_BYTE_LENGTH,e.generateKey=async function(){return n.pki.ed25519.generateKeyPair()},e.generateKeyFromSeed=async function(t){return n.pki.ed25519.generateKeyPair({seed:t})},e.hashAndSign=async function(t,e){return n.pki.ed25519.sign({message:e,privateKey:t})},e.hashAndVerify=async function(t,e,r){return n.pki.ed25519.verify({signature:e,message:r,publicKey:t})}},function(t,e,r){"use strict";const n=r(27),i=r(15);t.exports=(t,e,a)=>{a=a||r(102)(e);class s{constructor(t){a.validatePublicKey(t),this._key=t}verify(t,e){return a.hashAndVerify(this._key,e,t)}marshal(){return a.compressPublicKey(this._key)}get bytes(){return t.PublicKey.encode({Type:t.KeyType.Secp256k1,Data:this.marshal()})}equals(t){return this.bytes.equals(t.bytes)}hash(){return i.multihashing(this.bytes,"sha2-256")}}class o{constructor(t,e){this._key=t,this._publicKey=e||a.computePublicKey(t),a.validatePrivateKey(this._key),a.validatePublicKey(this._publicKey)}sign(t){return a.hashAndSign(this._key,t)}get public(){return new s(this._publicKey)}marshal(){return this._key}get bytes(){return t.PrivateKey.encode({Type:t.KeyType.Secp256k1,Data:this.marshal()})}equals(t){return this.bytes.equals(t.bytes)}hash(){return i.multihashing(this.bytes,"sha2-256")}async id(){const t=await this.public.hash();return n.encode("base58btc",t).toString().slice(1)}}return{Secp256k1PublicKey:s,Secp256k1PrivateKey:o,unmarshalSecp256k1PrivateKey:function(t){return new o(t)},unmarshalSecp256k1PublicKey:function(t){return new s(t)},generateKeyPair:async function(){const t=await a.generateKey();return new o(t)}}}},function(t,e,r){"use strict";const{Buffer:n}=r(1);var i=r(103).strict;const a=r(104),s=r(15);function o(t){if(i(t)){var e=n.from(t.buffer);return t.byteLength!==t.buffer.byteLength&&(e=e.slice(t.byteOffset,t.byteOffset+t.byteLength)),e}return n.from(t)}t.exports=t=>{function e(t){if(!a.privateKeyVerify(t))throw new Error("Invalid private key")}return{generateKey:function(){let e;do{e=t(32)}while(!a.privateKeyVerify(e));return e},privateKeyLength:32,hashAndSign:async function(t,e){const r=await s.digest(e,"sha2-256"),n=a.ecdsaSign(r,t);return o(a.signatureExport(n.signature))},hashAndVerify:async function(t,e,r){const n=await s.digest(r,"sha2-256");return e=o(a.signatureImport(e)),a.ecdsaVerify(e,n,t)},compressPublicKey:function(t){if(!a.publicKeyVerify(t))throw new Error("Invalid public key");return o(a.publicKeyConvert(t,!0))},decompressPublicKey:function(t){return o(a.publicKeyConvert(t,!1))},validatePrivateKey:e,validatePublicKey:function(t){if(!a.publicKeyVerify(t))throw new Error("Invalid public key")},computePublicKey:function(t){return e(t),o(a.publicKeyCreate(t))}}}},function(t,e,r){"use strict";t.exports=a,a.strict=s,a.loose=o;var n=Object.prototype.toString,i={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function a(t){return s(t)||o(t)}function s(t){return t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array}function o(t){return i[n.call(t)]}},function(t,e,r){"use strict";t.exports=r(105)(r(106))},function(t,e,r){"use strict";const n="Impossible case. Please create issue.",i="The tweak was out of range or the resulted private key is invalid",a="The tweak was out of range or equal to zero",s="Unknow error on context randomization",o="Private Key is invalid",f="Public Key could not be parsed",c="Public Key serialization error",u="The sum of the public keys is not valid",h="Signature could not be parsed",d="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",p="Scalar was invalid (zero or overflow)";function b(t,e){if(!t)throw new Error(e)}function y(t,e,r){if(b(e instanceof Uint8Array,"Expected ".concat(t," to be an Uint8Array")),void 0!==r)if(Array.isArray(r)){const n=r.join(", "),i="Expected ".concat(t," to be an Uint8Array with length [").concat(n,"]");b(r.includes(e.length),i)}else{const n="Expected ".concat(t," to be an Uint8Array with length ").concat(r);b(e.length===r,n)}}function g(t){b("Boolean"===v(t),"Expected compressed to be a Boolean")}function m(t=(t=>new Uint8Array(t)),e){return"function"==typeof t&&(t=t(e)),y("output",t,e),t}function v(t){return Object.prototype.toString.call(t).slice(8,-1)}t.exports=t=>({contextRandomize(e){switch(b(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&y("seed",e,32),t.contextRandomize(e)){case 1:throw new Error(s)}},privateKeyVerify:e=>(y("private key",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(e){switch(y("private key",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error(n)}},privateKeyTweakAdd(e,r){switch(y("private key",e,32),y("tweak",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(i)}},privateKeyTweakMul(e,r){switch(y("private key",e,32),y("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(a)}},publicKeyVerify:e=>(y("public key",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e,r=!0,n){switch(y("private key",e,32),g(r),n=m(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(o);case 2:throw new Error(c)}},publicKeyConvert(e,r=!0,n){switch(y("public key",e,[33,65]),g(r),n=m(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(f);case 2:throw new Error(c)}},publicKeyNegate(e,r=!0,i){switch(y("public key",e,[33,65]),g(r),i=m(i,r?33:65),t.publicKeyNegate(i,e)){case 0:return i;case 1:throw new Error(f);case 2:throw new Error(n);case 3:throw new Error(c)}},publicKeyCombine(e,r=!0,n){b(Array.isArray(e),"Expected public keys to be an Array"),b(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)y("public key",t,[33,65]);switch(g(r),n=m(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(f);case 2:throw new Error(u);case 3:throw new Error(c)}},publicKeyTweakAdd(e,r,n=!0,a){switch(y("public key",e,[33,65]),y("tweak",r,32),g(n),a=m(a,n?33:65),t.publicKeyTweakAdd(a,e,r)){case 0:return a;case 1:throw new Error(f);case 2:throw new Error(i)}},publicKeyTweakMul(e,r,n=!0,i){switch(y("public key",e,[33,65]),y("tweak",r,32),g(n),i=m(i,n?33:65),t.publicKeyTweakMul(i,e,r)){case 0:return i;case 1:throw new Error(f);case 2:throw new Error(a)}},signatureNormalize(e){switch(y("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(h)}},signatureExport(e,r){y("signature",e,64);const i={output:r=m(r,72),outputlen:72};switch(t.signatureExport(i,e)){case 0:return r.slice(0,i.outputlen);case 1:throw new Error(h);case 2:throw new Error(n)}},signatureImport(e,r){switch(y("signature",e),r=m(r,64),t.signatureImport(r,e)){case 0:return r;case 1:throw new Error(h);case 2:throw new Error(n)}},ecdsaSign(e,r,i={},a){y("message",e,32),y("private key",r,32),b("Object"===v(i),"Expected options to be an Object"),void 0!==i.data&&y("options.data",i.data),void 0!==i.noncefn&&b("Function"===v(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:a=m(a,64),recid:null};switch(t.ecdsaSign(s,e,r,i.data,i.noncefn)){case 0:return s;case 1:throw new Error(d);case 2:throw new Error(n)}},ecdsaVerify(e,r,n){switch(y("signature",e,64),y("message",r,32),y("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(h);case 2:throw new Error(f)}},ecdsaRecover(e,r,i,a=!0,s){switch(y("signature",e,64),b("Number"===v(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),y("message",i,32),g(a),s=m(s,a?33:65),t.ecdsaRecover(s,e,r,i)){case 0:return s;case 1:throw new Error(h);case 2:throw new Error(l);case 3:throw new Error(n)}},ecdh(e,r,n={},i){switch(y("public key",e,[33,65]),y("private key",r,32),b("Object"===v(n),"Expected options to be an Object"),void 0!==n.data&&y("options.data",n.data),void 0!==n.hashfn?(b("Function"===v(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&y("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&y("options.ybuf",n.ybuf,32),y("output",i)):i=m(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(f);case 2:throw new Error(p)}}})},function(t,e,r){"use strict";const n=new(0,r(107).ec)("secp256k1"),i=n.curve,a=i.n.constructor;function s(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new a(e);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let s=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let s=new a(e),o=new a(r);if(s.cmp(i.p)>=0||o.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),o=o.toRed(i.red),(6===t||7===t)&&o.isOdd()!==(7===t))return null;const f=s.redSqr().redIMul(s);return o.redSqr().redISub(f.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:o}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function o(t,e){const r=e.encode(null,33===t.length);for(let n=0;n<t.length;++n)t[n]=r[n]}t.exports={contextRandomize:()=>0,privateKeyVerify(t){const e=new a(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new a(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new a(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new a(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new a(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new a(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:t=>null===s(t)?1:0,publicKeyCreate(t,e){const r=new a(e);if(r.cmp(i.n)>=0||r.isZero())return 1;return o(t,n.keyFromPrivate(e).getPublic()),0},publicKeyConvert(t,e){const r=s(e);if(null===r)return 1;return o(t,r.getPublic()),0},publicKeyNegate(t,e){const r=s(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),o(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let i=0;i<e.length;++i)if(r[i]=s(e[i]),null===r[i])return 1;let n=r[0].getPublic();for(let i=1;i<r.length;++i)n=n.add(r[i].pub);return n.isInfinity()?2:(o(t,n),0)},publicKeyTweakAdd(t,e,r){const n=s(e);if(null===n)return 1;if((r=new a(r)).cmp(i.n)>=0)return 2;const f=n.getPublic().add(i.g.mul(r));return f.isInfinity()?2:(o(t,f),0)},publicKeyTweakMul(t,e,r){const n=s(e);if(null===n)return 1;if((r=new a(r)).cmp(i.n)>=0||r.isZero())return 2;return o(t,n.getPublic().mul(r)),0},signatureNormalize(t){const e=new a(t.subarray(0,32)),r=new a(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new a(r).cmp(i.n)>=0)return 1;if(new a(n).cmp(i.n)>=0)return 1;const{output:s}=t;let o=s.subarray(4,37);o[0]=0,o.set(r,1);let f=33,c=0;for(;f>1&&0===o[c]&&!(128&o[c+1]);--f,++c);if(o=o.subarray(c),128&o[0])return 1;if(f>1&&0===o[0]&&!(128&o[1]))return 1;let u=s.subarray(39,72);u[0]=0,u.set(n,1);let h=33,d=0;for(;h>1&&0===u[d]&&!(128&u[d+1]);--h,++d);return u=u.subarray(d),128&u[0]||h>1&&0===u[0]&&!(128&u[1])?1:(t.outputlen=6+f+h,s[0]=48,s[1]=t.outputlen-2,s[2]=2,s[3]=o.length,s.set(o,4),s[4+f]=2,s[5+f]=u.length,s.set(u,6+f),0)},signatureImport(t,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;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let s=e.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let o=e.subarray(6+r);if(33===o.length&&0===o[0]&&(o=o.slice(1)),o.length>32)throw new Error("S length is too long");let f=new a(s);f.cmp(i.n)>=0&&(f=new a(0));let c=new a(e.subarray(6+r));return c.cmp(i.n)>=0&&(c=new a(0)),t.set(f.toArrayLike(Uint8Array,"be",32),0),t.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,s,o){if(o){const t=o;o=n=>{const i=t(e,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new a(i)}}const f=new a(r);if(f.cmp(i.n)>=0||f.isZero())return 1;let c;try{c=n.sign(e,r,{canonical:!0,k:o,pers:s})}catch(u){return 1}return t.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),t.recid=c.recoveryParam,0},ecdsaVerify(t,e,r){const o={r:t.subarray(0,32),s:t.subarray(32,64)},f=new a(o.r),c=new a(o.s);if(f.cmp(i.n)>=0||c.cmp(i.n)>=0)return 1;if(1===c.cmp(n.nh)||f.isZero()||c.isZero())return 3;const u=s(r);if(null===u)return 2;const h=u.getPublic();return n.verify(e,o,h)?0:3},ecdsaRecover(t,e,r,s){const f={r:e.slice(0,32),s:e.slice(32,64)},c=new a(f.r),u=new a(f.s);if(c.cmp(i.n)>=0||u.cmp(i.n)>=0)return 1;if(c.isZero()||u.isZero())return 2;let h;try{h=n.recoverPubKey(s,f,r)}catch(d){return 2}return o(t,h),0},ecdh(t,e,r,o,f,c,u){const h=s(e);if(null===h)return 1;const d=new a(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const l=h.getPublic().mul(d);if(void 0===f){const e=l.encode(null,!0),r=n.hash().update(e).digest();for(let n=0;n<32;++n)t[n]=r[n]}else{c||(c=new Uint8Array(32));const e=l.getX().toArray("be",32);for(let t=0;t<32;++t)c[t]=e[t];u||(u=new Uint8Array(32));const r=l.getY().toArray("be",32);for(let t=0;t<32;++t)u[t]=r[t];const n=f(c,u,o);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},function(t,e,r){"use strict";var n=e;n.version=r(108).version,n.utils=r(3),n.rand=r(40),n.curve=r(41),n.curves=r(30),n.ec=r(122),n.eddsa=r(126)},function(t){t.exports=JSON.parse('{"_from":"elliptic@^6.5.2","_id":"elliptic@6.5.3","_inBundle":false,"_integrity":"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"elliptic@^6.5.2","name":"elliptic","escapedName":"elliptic","rawSpec":"^6.5.2","saveSpec":null,"fetchSpec":"^6.5.2"},"_requiredBy":["/browserify-sign","/create-ecdh","/secp256k1"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz","_shasum":"cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6","_spec":"elliptic@^6.5.2","_where":"/Users/jacobheun/git/libp2p/crypto/node_modules/secp256k1","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"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"},"deprecated":false,"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.8","grunt":"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.10.3","mocha":"^6.2.2"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.5.3"}')},function(t,e,r){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e){},function(t,e,r){"use strict";var n=r(3),i=r(6),a=r(17),s=r(16),o=n.assert;function f(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(f,s),t.exports=f,f.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(e))?r=a[0]:(r=a[1],o(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),a=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},f.prototype._getEndoBasis=function(t){for(var e,r,n,a,s,o,f,c,u,h=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),g=new i(1),m=0;0!==d.cmpn(0);){var v=l.div(d);c=l.sub(v.mul(d)),u=y.sub(v.mul(p));var w=g.sub(v.mul(b));if(!n&&c.cmp(h)<0)e=f.neg(),r=p,n=c.neg(),a=u;else if(n&&2==++m)break;f=c,l=d,d=c,y=p,p=u,g=b,b=w}s=c.neg(),o=u;var S=n.sqr().add(a.sqr());return s.sqr().add(o.sqr()).cmp(S)>=0&&(s=e,o=r),n.negative&&(n=n.neg(),a=a.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:a},{a:s,b:o}]},f.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),a=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),o=a.mul(n.a),f=i.mul(r.b),c=a.mul(n.b);return{k1:t.sub(s).sub(o),k2:f.add(c).neg()}},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var a=n.fromRed().isOdd();return(e&&!a||!e&&a)&&(n=n.redNeg()),this.point(t,n)},f.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},f.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<t.length;a++){var s=this._endoSplit(e[a]),o=t[a],f=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),f=f.neg(!0)),n[2*a]=o,n[2*a+1]=f,i[2*a]=s.k1,i[2*a+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*a,r),u=0;u<2*a;u++)n[u]=null,i[u]=null;return c},a(c,s.BasePoint),f.prototype.point=function(t,e,r){return new c(this,t,e,r)},f.prototype.pointFromJSON=function(t,e){return c.fromJSON(this,t,e)},c.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var a=e[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},c.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(u,s.BasePoint),f.prototype.jpoint=function(t,e,r){return new u(this,t,e,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),a=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),o=n.redSub(i),f=a.redSub(s);if(0===o.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),h=n.redMul(c),d=f.redSqr().redIAdd(u).redISub(h).redISub(h),l=f.redMul(h.redISub(d)).redISub(a.redMul(u)),p=this.z.redMul(t.z).redMul(o);return this.curve.jpoint(d,l,p)},u.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,a=t.y.redMul(e).redMul(this.z),s=r.redSub(n),o=i.redSub(a);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),u=r.redMul(f),h=o.redSqr().redIAdd(c).redISub(u).redISub(u),d=o.redMul(u.redISub(h)).redISub(i.redMul(c)),l=this.z.redMul(s);return this.curve.jpoint(h,d,l)},u.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}var n=this.curve.a,i=this.curve.tinv,a=this.x,s=this.y,o=this.z,f=o.redSqr().redSqr(),c=s.redAdd(s);for(r=0;r<t;r++){var u=a.redSqr(),h=c.redSqr(),d=h.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(f)),p=a.redMul(h),b=l.redSqr().redISub(p.redAdd(p)),y=p.redISub(b),g=l.redMul(y);g=g.redIAdd(g).redISub(d);var m=c.redMul(o);r+1<t&&(f=f.redMul(d)),a=b,o=m,c=g}return this.curve.jpoint(a,c.redMul(i),o)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n),f=o.redSqr().redISub(s).redISub(s),c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),t=f,e=o.redMul(s.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),l=this.x.redAdd(h).redSqr().redISub(u).redISub(d);l=l.redIAdd(l);var p=u.redAdd(u).redIAdd(u),b=p.redSqr(),y=d.redIAdd(d);y=(y=y.redIAdd(y)).redIAdd(y),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},u.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(a);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),f=o.redSqr().redISub(s).redISub(s);t=f;var c=a.redIAdd(a);c=(c=c.redIAdd(c)).redIAdd(c),e=o.redMul(s.redISub(f)).redISub(c),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(u);var y=h.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),e=l.redMul(p.redISub(t)).redISub(y)}return this.curve.jpoint(t,e,r)},u.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=e.redSqr(),s=r.redSqr(),o=a.redAdd(a).redIAdd(a).redIAdd(t.redMul(i)),f=e.redAdd(e),c=(f=f.redIAdd(f)).redMul(s),u=o.redSqr().redISub(c.redAdd(c)),h=c.redISub(u),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=o.redMul(h).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(u,l,p)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),a=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(a)).redSqr(),f=n.redIAdd(n);f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var c=i.redIAdd(s).redSqr().redISub(a).redISub(o).redISub(f),u=e.redMul(c);u=(u=u.redIAdd(u)).redIAdd(u);var h=this.x.redMul(o).redISub(u);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(c.redMul(f.redISub(c)).redISub(s.redMul(o)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(h,d,l)},u.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},u.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},u.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(t,e,r){"use strict";var n=r(6),i=r(17),a=r(16),s=r(3);function o(t){a.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(t,e,r){a.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(o,a),t.exports=o,o.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(f,a.BasePoint),o.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},o.prototype.point=function(t,e){return new f(this,t,e)},o.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(t,e){return new f(t,e[0],e[1]||t.one)},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),a=t.x.redSub(t.z).redMul(r),s=i.redMul(n),o=e.z.redMul(a.redAdd(s).redSqr()),f=e.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,f)},f.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(t,e,r){"use strict";var n=r(3),i=r(6),a=r(17),s=r(16),o=n.assert;function f(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function c(t,e,r,n,a){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=a&&new i(a,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(f,s),t.exports=f,f.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},f.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},f.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},f.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),a=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(a.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var f=o.fromRed().isOdd();return(e&&!f||!e&&f)&&(o=o.redNeg()),this.point(t,o)},f.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),a=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(a.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==e&&(o=o.redNeg()),this.point(o,t)},f.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},a(c,s.BasePoint),f.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},f.prototype.point=function(t,e,r,n){return new c(this,t,e,r,n)},c.fromJSON=function(t,e){return new c(t,e[0],e[1],e[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),a=n.redAdd(e),s=a.redSub(r),o=n.redSub(e),f=i.redMul(s),c=a.redMul(o),u=i.redMul(o),h=s.redMul(a);return this.curve.point(f,c,h,u)},c.prototype._projDbl=function(){var t,e,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),a=this.y.redSqr();if(this.curve.twisted){var s=(c=this.curve._mulA(i)).redAdd(a);if(this.zOne)t=n.redSub(i).redSub(a).redMul(s.redSub(this.curve.two)),e=s.redMul(c.redSub(a)),r=s.redSqr().redSub(s).redSub(s);else{var o=this.z.redSqr(),f=s.redSub(o).redISub(o);t=n.redSub(i).redISub(a).redMul(f),e=s.redMul(c.redSub(a)),r=s.redMul(f)}}else{var c=i.redAdd(a);o=this.curve._mulC(this.z).redSqr(),f=c.redSub(o).redSub(o);t=this.curve._mulC(n.redISub(c)).redMul(f),e=this.curve._mulC(c).redMul(i.redISub(a)),r=c.redMul(f)}return this.curve.point(t,e,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),a=r.redSub(e),s=i.redSub(n),o=i.redAdd(n),f=r.redAdd(e),c=a.redMul(s),u=o.redMul(f),h=a.redMul(f),d=s.redMul(o);return this.curve.point(c,u,d,h)},c.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),a=this.x.redMul(t.x),s=this.y.redMul(t.y),o=this.curve.d.redMul(a).redMul(s),f=i.redSub(o),c=i.redAdd(o),u=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(a).redISub(s),h=n.redMul(f).redMul(u);return this.curve.twisted?(e=n.redMul(c).redMul(s.redSub(this.curve._mulA(a))),r=f.redMul(c)):(e=n.redMul(c).redMul(s.redSub(a)),r=this.curve._mulC(f).redMul(c)),this.curve.point(h,e,r)},c.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},c.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},c.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},c.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},c.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(t,e,r){"use strict";e.sha1=r(116),e.sha224=r(117),e.sha256=r(43),e.sha384=r(118),e.sha512=r(44)},function(t,e,r){"use strict";var n=r(4),i=r(12),a=r(42),s=n.rotl32,o=n.sum32,f=n.sum32_5,c=a.ft_1,u=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,u),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],u=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=f(s(i,5),c(p,a,u,d),l,r[n],h[p]);l=d,d=u,u=s(a,30),a=i,i=b}this.h[0]=o(this.h[0],i),this.h[1]=o(this.h[1],a),this.h[2]=o(this.h[2],u),this.h[3]=o(this.h[3],d),this.h[4]=o(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(t,e,r){"use strict";var n=r(4),i=r(43);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),t.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(t,e,r){"use strict";var n=r(4),i=r(44);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),t.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(t,e,r){"use strict";var n=r(4),i=r(12),a=n.rotl32,s=n.sum32,o=n.sum32_3,f=n.sum32_4,c=i.BlockHash;function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(u,c),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],u=this.h[4],m=r,v=n,w=i,S=c,E=u,k=0;k<80;k++){var A=s(a(f(r,h(k,n,i,c),t[p[k]+e],d(k)),y[k]),u);r=u,u=c,c=a(i,10),i=n,n=A,A=s(a(f(m,h(79-k,v,w,S),t[b[k]+e],l(k)),g[k]),E),m=E,E=S,S=a(w,10),w=v,v=A}A=o(this.h[1],i,S),this.h[1]=o(this.h[2],c,E),this.h[2]=o(this.h[3],u,m),this.h[3]=o(this.h[4],r,v),this.h[4]=o(this.h[0],n,w),this.h[0]=A},u.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],y=[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],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(t,e,r){"use strict";var n=r(4),i=r(8);function a(t,e,r){if(!(this instanceof a))return new a(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=a,a.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},a.prototype.update=function(t,e){return this.inner.update(t,e),this},a.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},function(t,e,r){"use strict";t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(t,e,r){"use strict";var n=r(6),i=r(123),a=r(3),s=r(30),o=r(40),f=a.assert,c=r(124),u=r(125);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(f(s.hasOwnProperty(t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new c(this,t)},h.prototype.keyFromPrivate=function(t,e){return c.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return c.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,a){"object"==typeof r&&(a=r,r=null),a||(a={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),o=e.getPrivate().toArray("be",s),f=t.toArray("be",s),c=new i({hash:this.hash,entropy:o,nonce:f,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new n(1)),d=0;;d++){var l=a.k?a.k(d):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(h)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var g=l.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return a.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new u({r:y,s:g,recoveryParam:m})}}}}}},h.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var a=(e=new u(e,"hex")).r,s=e.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,f=s.invm(this.n),c=f.mul(t).umod(this.n),h=f.mul(a).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(c,r.getPublic(),h)).isInfinity()&&o.eqXToP(a):!(o=this.g.mulAdd(c,r.getPublic(),h)).isInfinity()&&0===o.getX().umod(this.n).cmp(a)},h.prototype.recoverPubKey=function(t,e,r,i){f((3&r)===r,"The recovery param is more than two bits"),e=new u(e,i);var a=this.n,s=new n(t),o=e.r,c=e.s,h=1&r,d=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");o=d?this.curve.pointFromX(o.add(this.curve.n),h):this.curve.pointFromX(o,h);var l=e.r.invm(a),p=a.sub(s).mul(l).umod(a),b=c.mul(l).umod(a);return this.g.mulAdd(p,o,b)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new u(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch(t){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(t,e,r){"use strict";var n=r(31),i=r(39),a=r(8);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length<t;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var s=a.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},function(t,e,r){"use strict";var n=r(6),i=r(3).assert;function a(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=a,a.fromPublic=function(t,e,r){return e instanceof a?e:new a(t,{pub:e,pubEnc:r})},a.fromPrivate=function(t,e,r){return e instanceof a?e:new a(t,{priv:e,privEnc:r})},a.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},a.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},a.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},a.prototype.derive=function(t){return t.mul(this.priv).getX()},a.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},a.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},a.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(t,e,r){"use strict";var n=r(6),i=r(3),a=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(a(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function o(){this.place=0}function f(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,a=0,s=e.place;a<n;a++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function c(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function u(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new o;if(48!==t[r.place++])return!1;var a=f(t,r);if(!1===a)return!1;if(a+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=f(t,r);if(!1===s)return!1;var c=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var u=f(t,r);if(!1===u)return!1;if(t.length!==u+r.place)return!1;var h=t.slice(r.place,u+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(c),this.s=new n(h),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=c(e),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];u(n,e.length),(n=n.concat(e)).push(2),u(n,r.length);var a=n.concat(r),s=[48];return u(s,a.length),s=s.concat(a),i.encode(s,t)}},function(t,e,r){"use strict";var n=r(31),i=r(30),a=r(3),s=a.assert,o=a.parseBytes,f=r(127),c=r(128);function u(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof u))return new u(t);t=i[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=u,u.prototype.sign=function(t,e){t=o(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),a=this.encodePoint(i),s=this.hashInt(a,r.pubBytes(),t).mul(r.priv()),f=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:a})},u.prototype.verify=function(t,e,r){t=o(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),a=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(a)},u.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return a.intFromLE(t.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(t){return f.fromPublic(this,t)},u.prototype.keyFromSecret=function(t){return f.fromSecret(this,t)},u.prototype.makeSignature=function(t){return t instanceof c?t:new c(this,t)},u.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},u.prototype.decodePoint=function(t){var e=(t=a.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=a.intFromLE(r);return this.curve.pointFromY(i,n)},u.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(t){return a.intFromLE(t)},u.prototype.isPoint=function(t){return t instanceof this.pointClass}},function(t,e,r){"use strict";var n=r(3),i=n.assert,a=n.parseBytes,s=n.cachedProperty;function o(t,e){this.eddsa=t,this._secret=a(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=a(e.pub)}o.fromPublic=function(t,e){return e instanceof o?e:new o(t,{pub:e})},o.fromSecret=function(t,e){return e instanceof o?e:new o(t,{secret:e})},o.prototype.secret=function(){return this._secret},s(o,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(o,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(o,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(o,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(o,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(o,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),o.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},o.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},o.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},o.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=o},function(t,e,r){"use strict";var n=r(6),i=r(3),a=i.assert,s=i.cachedProperty,o=i.parseBytes;function f(t,e){this.eddsa=t,"object"!=typeof e&&(e=o(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),a(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(f,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(f,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(f,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(f,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),f.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},f.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=f},function(t,e,r){"use strict";const{Buffer:n}=r(1),i=r(5),a=r(32),s={"AES-128":{ivSize:16,keySize:16},"AES-256":{ivSize:16,keySize:32},Blowfish:{ivSize:8,cipherKeySize:32}};t.exports=async(t,e,r)=>{const o=s[t];if(!o){const e=Object.keys(s).join(" / ");throw i(new Error("unknown cipher type '".concat(t,"'. Must be ").concat(e)),"ERR_INVALID_CIPHER_TYPE")}if(!e)throw i(new Error("missing hash type"),"ERR_MISSING_HASH_TYPE");const f=o.keySize,c=o.ivSize,u=n.from("key expansion"),h=2*(c+f+20),d=await a.create(e,r);let l=await d.digest(u);const p=[];let b=0;for(;b<h;){const t=await d.digest(n.concat([l,u]));let e=t.length;b+e>h&&(e=h-b),p.push(t),b+=e,l=await d.digest(l)}const y=h/2,g=n.concat(p),m=g.slice(0,y),v=g.slice(y,h),w=t=>({iv:t.slice(0,c),cipherKey:t.slice(c,c+f),macKey:t.slice(c+f)});return{k1:w(m),k2:w(v)}}},function(t,e,r){"use strict";const n=r(131);t.exports=async t=>n.generateEphmeralKeyPair(t)},function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const s=r(5),{Buffer:o}=r(1),f=r(18),{bufferToBase64url:c,base64urlToBuffer:u}=r(29),h=r(132),d={"P-256":256,"P-384":384,"P-521":521};e.generateEphmeralKeyPair=async function(t){h(Object.keys(d),t);const e=await f.get().subtle.generateKey({name:"ECDH",namedCurve:t},!0,["deriveBits"]);return{key:p(await f.get().subtle.exportKey("jwk",e.publicKey)),genSharedKey:async(r,n)=>{let i;i=n?await f.get().subtle.importKey("jwk",y(t,n),{name:"ECDH",namedCurve:t},!1,["deriveBits"]):e.privateKey;const a=[await f.get().subtle.importKey("jwk",b(t,r),{name:"ECDH",namedCurve:t},!1,[]),i];return o.from(await f.get().subtle.deriveBits({name:"ECDH",namedCurve:t,public:a[0]},a[1],d[t]))}}};const l={"P-256":32,"P-384":48,"P-521":66};function p(t){const e=l[t.crv];return o.concat([o.from([4]),u(t.x,e),u(t.y,e)],1+2*e)}function b(t,e){const r=l[t];if(!e.slice(0,1).equals(o.from([4])))throw s(new Error("Cannot unmarshal public key - invalid key format"),"ERR_INVALID_KEY_FORMAT");return{kty:"EC",crv:t,x:c(e.slice(1,r+1),r),y:c(e.slice(1+r),r),ext:!0}}const y=(t,e)=>i(i({},b(t,e.public)),{},{d:c(e.private)})},function(t,e,r){"use strict";const n=r(5);t.exports=function(t,e){if(!t.includes(e)){const r=t.join(" / ");throw n(new Error("Unknown curve: ".concat(e,". Must be ").concat(r)),"ERR_INVALID_CURVE")}}},function(t,e,r){"use strict";const n=r(35),i=r(2),a=r(5),s={sha1:"sha1","sha2-256":"sha256","sha2-512":"sha512"};t.exports=function(t,e,r,o,f){const c=s[f];if(!c){const t=Object.keys(s).join(" / ");throw a(new Error("Hash '".concat(f,"' is unknown or not supported. Must be ").concat(t)),"ERR_UNSUPPORTED_HASH_TYPE")}const u=n(t,e,r,o,c);return i.encode64(u)}}])}));