Skip to content

Instantly share code, notes, and snippets.

@icidasset
Created August 1, 2019 14:18
Show Gist options
  • Save icidasset/a888e02d7441aeb2af99263a3add0f73 to your computer and use it in GitHub Desktop.
Save icidasset/a888e02d7441aeb2af99263a3add0f73 to your computer and use it in GitHub Desktop.
Blockstack v19.2.2 with support for asynchronous `SessionStore`s
This file has been truncated, but you can view the full file.
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.blockstack=t():e.blockstack=t()}(this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=231)}([function(e,t,r){"use strict";(function(e){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var n=r(233),i=r(234),o=r(138);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=s(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|d(t.length);return 0===(e=s(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(f(t),e=s(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|d(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return z(e).length;t=(""+t).toLowerCase(),n=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){l=!1;break}if(l)return o}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function _(e,t,r,n){return H(z(t,e.length-r),e,r,n)}function w(e,t,r,n){return H(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return w(e,t,r,n)}function k(e,t,r,n){return H(q(t),e,r,n)}function E(e,t,r,n){return H(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function x(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return f(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)b(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)b(this,t,t+7),b(this,t+1,t+6),b(this,t+2,t+5),b(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):y.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(n,i),f=e.slice(t,r),l=0;l<s;++l)if(c[l]!==f[l]){o=c[l],a=f[l];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return k(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function I(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=L(e[o]);return i}function j(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function D(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return o||D(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function R(e,t,r,n,o){return o||D(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||M(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||B(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);B(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);B(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=u.isBuffer(e)?e:z(new u(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(6))},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!("string"==typeof e||e instanceof String)){var t;throw t=null===e?"null":"object"===(t=i(e))&&e.constructor&&e.constructor.hasOwnProperty("name")?e.constructor.name:"a ".concat(t),new TypeError("Expected string but received ".concat(t,"."))}},e.exports=t.default,e.exports.default=t.default},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(286),i=r(287),o=r(25),a=r(155),s=r(34),u=r(288),c=r(8);t.OPS=r(97);var f=r(289),l=t.OPS.OP_RESERVED;function h(e){return o.Buffer(e)||function(e){return o.Number(e)&&(e===t.OPS.OP_0||e>=t.OPS.OP_1&&e<=t.OPS.OP_16||e===t.OPS.OP_1NEGATE)}(e)}function d(e){return o.Array(e)&&e.every(h)}function p(e){return 0===e.length?t.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?l+e[0]:129===e[0]?t.OPS.OP_1NEGATE:void 0:void 0}function y(t){return e.isBuffer(t)}function b(t){return e.isBuffer(t)}function m(t){if(y(t))return t;c(o.Array,t);var r=t.reduce(function(e,t){return b(t)?1===t.length&&void 0!==p(t)?e+1:e+u.encodingLength(t.length)+t.length:e+1},0),n=e.allocUnsafe(r),i=0;if(t.forEach(function(e){if(b(e)){var t=p(e);if(void 0!==t)return n.writeUInt8(t,i),void(i+=1);i+=u.encode(n,e.length,i),e.copy(n,i),i+=e.length}else n.writeUInt8(e,i),i+=1}),i!==n.length)throw new Error("Could not decode chunks");return n}function g(e){if(r=e,o.Array(r))return e;var r;c(o.Buffer,e);for(var n=[],i=0;i<e.length;){var a=e[i];if(a>t.OPS.OP_0&&a<=t.OPS.OP_PUSHDATA4){var s=u.decode(e,i);if(null===s)return null;if((i+=s.size)+s.number>e.length)return null;var f=e.slice(i,i+s.number);i+=s.number;var l=p(f);void 0!==l?n.push(l):n.push(f)}else n.push(a),i+=1}return n}function v(e){var t=-129&e;return t>0&&t<4}t.isPushOnly=d,t.compile=m,t.decompile=g,t.toASM=function(e){return y(e)&&(e=g(e)),e.map(function(e){if(b(e)){var t=p(e);if(void 0===t)return e.toString("hex");e=t}return f[e]}).join(" ")},t.fromASM=function(r){return c(o.String,r),m(r.split(" ").map(function(r){return void 0!==t.OPS[r]?t.OPS[r]:(c(o.Hex,r),e.from(r,"hex"))}))},t.toStack=function(r){return r=g(r),c(d,r),r.map(function(r){return b(r)?r:r===t.OPS.OP_0?e.allocUnsafe(0):n.encode(r-l)})},t.isCanonicalPubKey=function(e){return s.isPoint(e)},t.isDefinedHashType=v,t.isCanonicalScriptSignature=function(t){return!!e.isBuffer(t)&&!!v(t[t.length-1])&&a.check(t.slice(0,-1))},t.number=n,t.signature=i}).call(this,r(0).Buffer)},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"===t(e)?e.exports=a:n.BN=a,a.BN=a,a.wordSize=26;try{s=r(263).Buffer}catch(e){}function u(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o<i;o++){var a=e.charCodeAt(o)-48;n<<=4,n|=a>=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===t(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&o++,16===r?this._parseHex(e,o):this._parseBase(e,r,o),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),r,n)},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},a.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=e.length-6,n=0;r>=t;r-=6)i=u(e,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=u(e,t,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f<s;f+=n)u=c(e,f,f+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var l=1;for(u=c(e,f,e.length,t),f=0;f<a;f++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)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 f=["","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"],l=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var f=u>>>26,l=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);r=0!==(o=s>>>24-n&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=l[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?y+r:f[c-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return i(void 0!==s),this.toArrayLike(s,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-n;s++)c[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[o-s-1]=a}return c},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).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(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,f=0|a[0],l=8191&f,h=f>>>13,d=0|a[1],p=8191&d,y=d>>>13,b=0|a[2],m=8191&b,g=b>>>13,v=0|a[3],_=8191&v,w=v>>>13,S=0|a[4],k=8191&S,E=S>>>13,x=0|a[5],A=8191&x,O=x>>>13,P=0|a[6],T=8191&P,I=P>>>13,j=0|a[7],M=8191&j,B=j>>>13,N=0|a[8],C=8191&N,D=N>>>13,U=0|a[9],R=8191&U,F=U>>>13,L=0|s[0],z=8191&L,q=L>>>13,H=0|s[1],K=8191&H,$=H>>>13,V=0|s[2],G=8191&V,W=V>>>13,X=0|s[3],J=8191&X,Z=X>>>13,Y=0|s[4],Q=8191&Y,ee=Y>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,he=fe>>>13,de=0|s[9],pe=8191&de,ye=de>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(c+(n=Math.imul(l,z))|0)+((8191&(i=(i=Math.imul(l,q))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,q))+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(p,z),i=(i=Math.imul(p,q))+Math.imul(y,z)|0,o=Math.imul(y,q);var me=(c+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,z),i=(i=Math.imul(m,q))+Math.imul(g,z)|0,o=Math.imul(g,q),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,$)|0;var ge=(c+(n=n+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(_,z),i=(i=Math.imul(_,q))+Math.imul(w,z)|0,o=Math.imul(w,q),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,W)|0;var ve=(c+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,Z)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(k,z),i=(i=Math.imul(k,q))+Math.imul(E,z)|0,o=Math.imul(E,q),n=n+Math.imul(_,K)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,$)|0,n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Z)|0;var _e=(c+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(A,z),i=(i=Math.imul(A,q))+Math.imul(O,z)|0,o=Math.imul(O,q),n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(E,K)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(m,J)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,Z)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0;var we=(c+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,z),i=(i=Math.imul(T,q))+Math.imul(I,z)|0,o=Math.imul(I,q),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(E,G)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,J)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,Z)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0;var Se=(c+(n=n+Math.imul(l,oe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(M,z),i=(i=Math.imul(M,q))+Math.imul(B,z)|0,o=Math.imul(B,q),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Z)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0;var ke=(c+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(C,z),i=(i=Math.imul(C,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Z)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0;var Ee=(c+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(R,z),i=(i=Math.imul(R,q))+Math.imul(F,z)|0,o=Math.imul(F,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,$)|0,n=n+Math.imul(M,G)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Z)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Z)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(y,le)|0,o=o+Math.imul(y,he)|0;var xe=(c+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(R,K),i=(i=Math.imul(R,$))+Math.imul(F,K)|0,o=Math.imul(F,$),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Z)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,Z)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,ae)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,he)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,he)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(R,G),i=(i=Math.imul(R,W))+Math.imul(F,G)|0,o=Math.imul(F,W),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,Z)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,n=n+Math.imul(_,le)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(w,le)|0,o=o+Math.imul(w,he)|0;var Oe=(c+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(R,J),i=(i=Math.imul(R,Z))+Math.imul(F,J)|0,o=Math.imul(F,Z),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(E,le)|0,o=o+Math.imul(E,he)|0;var Pe=(c+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,ye)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,ye)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(R,Q),i=(i=Math.imul(R,ee))+Math.imul(F,Q)|0,o=Math.imul(F,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(A,le)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,he)|0;var Te=(c+(n=n+Math.imul(k,pe)|0)|0)+((8191&(i=(i=i+Math.imul(k,ye)|0)+Math.imul(E,pe)|0))<<13)|0;c=((o=o+Math.imul(E,ye)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(R,re),i=(i=Math.imul(R,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,ce)|0,n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(I,le)|0,o=o+Math.imul(I,he)|0;var Ie=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ye)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ye)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(R,oe),i=(i=Math.imul(R,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(M,le)|0,i=(i=i+Math.imul(M,he)|0)+Math.imul(B,le)|0,o=o+Math.imul(B,he)|0;var je=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(R,ue),i=(i=Math.imul(R,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(D,le)|0,o=o+Math.imul(D,he)|0;var Me=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ye)|0)+Math.imul(B,pe)|0))<<13)|0;c=((o=o+Math.imul(B,ye)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,le),i=(i=Math.imul(R,he))+Math.imul(F,le)|0,o=Math.imul(F,he);var Be=(c+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ye)|0)+Math.imul(D,pe)|0))<<13)|0;c=((o=o+Math.imul(D,ye)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Ne=(c+(n=Math.imul(R,pe))|0)+((8191&(i=(i=Math.imul(R,ye))+Math.imul(F,pe)|0))<<13)|0;return c=((o=Math.imul(F,ye))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=be,u[1]=me,u[2]=ge,u[3]=ve,u[4]=_e,u[5]=we,u[6]=Se,u[7]=ke,u[8]=Ee,u[9]=xe,u[10]=Ae,u[11]=Oe,u[12]=Pe,u[13]=Te,u[14]=Ie,u[15]=je,u[16]=Me,u[17]=Be,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(p=d),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var f=o-c,l=(0|e.words[f])*(0|t.words[c]),h=67108863&l;s=67108863&(h=h+s|0),i+=(a=(a=a+(l/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),f=0;f<i;f+=s)for(var l=u,h=c,d=0;d<a;d++){var p=r[f+d],y=n[f+d],b=r[f+d+a],m=n[f+d+a],g=l*b-h*m;m=l*m+h*b,b=g,r[f+d]=p+b,n[f+d]=y+m,r[f+d+a]=p-b,n[f+d+a]=y-m,d!==s&&(g=u*l-c*h,h=u*h+c*l,l=g)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,n){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<n;++a)r[a]=0;i(0===o),i(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),l=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,f,l,n,i);for(var d=0;d<n;d++){var p=s[d]*f[d]-u[d]*l[d];u[d]=s[d]*l[d]+u[d]*f[d],s[d]=p}return this.conjugate(s,u,n),this.transform(s,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},a.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(n-=a,n=Math.max(0,n),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=n);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},a.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var n,o,a=e.length+r;this._expand(a);var s=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+s;var u=(0|e.words[n])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},a.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),o=new a(0),s=new a(0),u=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=t.clone();!t.isZero();){for(var h=0,d=1;0==(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(l)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(u)):(r.isub(t),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(c)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(n=0===t.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){k.call(this,e),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 e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},o(v,g),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(_,g),o(w,g),o(S,g),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new _;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return m[e]=t,t},k.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var s=new a(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new a(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,n),h=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),p=o;0!==d.cmp(s);){for(var y=d,b=0;0!==y.cmp(s);b++)y=y.redSqr();i(b<p);var m=this.pow(l,new a(1).iushln(p-b-1));h=h.redMul(m),l=m.redSqr(),d=d.redMul(l),p=b}return h},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new E(e)},o(E,k),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(22)(e))},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":r(window))&&(n=window)}e.exports=n},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}(function(){var i,o,a,s,u;u=r(15),o=function(e){var t,r,n,i;for(r=new Uint8Array(e.length),t=n=0,i=e.length;0<=i?n<i:n>i;t=0<=i?++n:--n)r[t]=e.readUInt8(t);return r},s=function(t){var r,n,i,o;for(n=new e(t.length),r=i=0,o=t.length;0<=o?i<o:i>o;r=0<=o?++i:--i)n.writeUInt8(t[r],r);return n},a=function(e){return e>>>24&255|(e>>>16&255)<<8|(e>>>8&255)<<16|(255&e)<<24},t.WordArray=i=function(){function t(e,t){this.words=e||[],this.sigBytes=null!=t?t:4*this.words.length}return t.prototype.concat=function(e){var t,r,n,i,o;if(i=e.words,n=e.sigBytes,this.clamp(),this.sigBytes%4)for(t=o=0;0<=n?o<n:o>n;t=0<=n?++o:--o)r=i[t>>>2]>>>24-t%4*8&255,this.words[this.sigBytes+t>>>2]|=r<<24-(this.sigBytes+t)%4*8;else this.words=this.words.concat(i);return this.sigBytes+=n,this},t.prototype.clamp=function(){return this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this},t.prototype.clone=function(){return new t(this.words.slice(0),this.sigBytes)},t.prototype.to_buffer=function(){var t,r,n,i,o,a,s;for(r=new e(this.sigBytes),n=0,o=0,a=(s=this.words).length;o<a;o++)i=s[o],this.sigBytes-n>=4&&(i=u.fixup_uint32(i),r.writeUInt32BE(i,n),n+=4);for(;n<this.sigBytes;)t=this.words[n>>>2]>>>24-n%4*8&255,r.writeUInt8(t,n),n++;return r},t.prototype.endian_reverse=function(){var e,t,r,n,i;for(e=r=0,n=(i=this.words).length;r<n;e=++r)t=i[e],this.words[e]=a(t);return this},t.prototype.split=function(e){var r,n;if(this.sigBytes%4!=0||this.words.length%e!=0)throw new Error("bad key alignment");return n=this.words.length/e,function(){var e,i,o;for(o=[],r=e=0,i=this.words.length;n>0?e<i:e>i;r=e+=n)o.push(new t(this.words.slice(r,r+n)));return o}.call(this)},t.prototype.to_utf8=function(){return this.to_buffer().toString("utf8")},t.prototype.to_hex=function(){return this.to_buffer().toString("hex")},t.prototype.to_ui8a=function(){return o(this.to_buffer())},t.alloc=function(r){return e.isBuffer(r)?t.from_buffer(r):"object"===n(r)&&r instanceof t?r:"string"==typeof r?t.from_hex(r):null},t.from_buffer=function(e){var r,n,i;for(i=[],n=0;e.length-n>=4;)i.push(e.readUInt32BE(n)),n+=4;if(n<e.length){for(r=0;n<e.length;)r|=e.readUInt8(n)<<24-n%4*8,n++;r=u.fixup_uint32(r),i.push(r)}return new t(i,e.length)},t.from_buffer_le=function(e){var r,n,i;for(i=[],n=0;e.length-n>=4;)i.push(e.readUInt32LE(n)),n+=4;if(n<e.length){for(r=0;n<e.length;)r|=e.readUInt8(n)<<n%4*8,n++;r=u.fixup_uint32(r),i.push(r)}return new t(i,e.length)},t.from_utf8=function(r){return t.from_buffer(new e(r,"utf8"))},t.from_utf8_le=function(r){return t.from_buffer_le(new e(r,"utf8"))},t.from_hex=function(r){return t.from_buffer(new e(r,"hex"))},t.from_hex_le=function(r){return t.from_buffer_le(new e(r,"hex"))},t.from_ui8a=function(e){return t.from_buffer(s(e))},t.from_i32a=function(e){return new t(Array.apply([],e))},t.prototype.equal=function(e){var t,r,n,i,o,a;if(r=!0,e.sigBytes!==this.sigBytes)r=!1;else for(t=i=0,o=(a=this.words).length;i<o;t=++i)n=a[t],u.fixup_uint32(n)!==u.fixup_uint32(e.words[t])&&(r=!1);return r},t.prototype.xor=function(e,t){var r,n,i,o,a,s;if((r=t.dst_offset)||(r=0),(o=t.src_offset)||(o=0),null==(i=t.n_words)&&(i=e.words.length-o),this.words.length<r+i)throw new Error("dest range exceeded ("+this.words.length+" < "+(r+i)+")");if(e.words.length<o+i)throw new Error("source range exceeded");for(n=s=0;0<=i?s<i:s>i;n=0<=i?++s:--s)a=this.words[r+n]^e.words[o+n],this.words[r+n]=u.fixup_uint32(a);return this},t.prototype.truncate=function(e){var r;if(!(e<=this.sigBytes))throw new Error("Cannot truncate: "+e+" > "+this.sigBytes);return r=Math.ceil(e/4),new t(this.words.slice(0,r),e)},t.prototype.unshift=function(e){var r;return this.words.length>=e?(r=this.words.splice(0,e),this.sigBytes-=4*e,new t(r)):null},t.prototype.is_scrubbed=function(){var e,t,r;for(e=0,t=(r=this.words).length;e<t;e++)if(0!==r[e])return!1;return!0},t.prototype.scrub=function(){return u.scrub_vec(this.words)},t.prototype.cmp_ule=function(e){return u.buffer_cmp_ule(this.to_buffer(),e.to_buffer())},t.prototype.slice=function(e,r){var n,i;if(n=this.words.length,!(e<r&&r<=n))throw new Error("Bad WordArray slice ["+e+","+r+")] when only "+n+" avail");return i=4*(r-e),r===n&&(i-=4*n-this.sigBytes),new t(this.words.slice(e,r),i)},t}(),t.X64Word=function(){function e(e,t){this.high=e,this.low=t}return e.prototype.clone=function(){return new e(this.high,this.low)},e}(),t.X64WordArray=function(){function e(e,t){this.sigBytes=t,this.words=e||[],this.sigBytes||(this.sigBytes=8*this.words.length)}return e.prototype.toX32=function(){var e,t,r,n,o;for(e=[],r=0,n=(o=this.words).length;r<n;r++)t=o[r],e.push(t.high),e.push(t.low);return new i(e,this.sigBytes)},e.prototype.clone=function(){var t;return new e(function(){var e,r,n,i;for(i=[],e=0,r=(n=this.words).length;e<r;e++)t=n[e],i.push(t.clone());return i}.call(this),this.sigBytes)},e}(),t.buffer_to_ui8a=o,t.ui8a_to_buffer=s,t.endian_reverse=a}).call(this)}).call(this,r(0).Buffer)},function(e,t,r){var n=r(153),i=r(95),o=n.tfJSON,a=n.TfTypeError,s=n.TfPropertyTypeError,u=n.tfSubError,c=n.getValueTypeName,f={arrayOf:function(e,t){function r(r,n){return!!i.Array(r)&&(!i.Nil(r)&&(!(void 0!==t.minLength&&r.length<t.minLength)&&(!(void 0!==t.maxLength&&r.length>t.maxLength)&&((void 0===t.length||r.length===t.length)&&r.every(function(t,r){try{return h(e,t,n)}catch(e){throw u(e,r)}})))))}return e=l(e),t=t||{},r.toJSON=function(){var r="["+o(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,n){return i.Nil(r)||t(r,n,e)}return t=l(t),r.toJSON=function(){return"?"+o(t)},r},map:function(e,t){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{t&&h(t,o,n)}catch(e){throw u(e,o,"key")}try{var a=r[o];h(e,a,n)}catch(e){throw u(e,o)}}return!0}return e=l(e),t&&(t=l(t)),r.toJSON=t?function(){return"{"+o(t)+": "+o(e)+"}"}:function(){return"{"+o(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=l(e[r]);function n(e,r){if(!i.Object(e))return!1;if(i.Nil(e))return!1;var n;try{for(n in t){h(t[n],e[n],r)}}catch(e){throw u(e,n)}if(r)for(n in e)if(!t[n])throw new s(void 0,n);return!0}return n.toJSON=function(){return o(t)},n},anyOf:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return e.some(function(e){try{return h(e,t,r)}catch(e){return!1}})}return t.toJSON=function(){return e.map(o).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return e.every(function(e){try{return h(e,t,r)}catch(e){return!1}})}return t.toJSON=function(){return e.map(o).join(" & ")},t},quacksLike:function(e){function t(t){return e===c(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(l);function t(t,r){return!i.Nil(t)&&(!i.Nil(t.length)&&((!r||t.length===e.length)&&e.every(function(e,n){try{return h(e,t[n],r)}catch(e){throw u(e,n)}})))}return t.toJSON=function(){return"("+e.map(o).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function l(e){if(i.String(e))return"?"===e[0]?f.maybe(e.slice(1)):i[e]||f.quacksLike(e);if(e&&i.Object(e)){if(i.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return f.arrayOf(e[0])}return f.object(e)}return i.Function(e)?e:f.value(e)}function h(e,t,r,n){if(i.Function(e)){if(e(t,r))return!0;throw new a(n||e,t)}return h(l(e),t,r)}for(var d in f.oneOf=f.anyOf,i)h[d]=i[d];for(d in f)h[d]=f[d];var p=r(284);for(d in p)h[d]=p[d];h.compile=l,h.TfTypeError=a,h.TfPropertyTypeError=s,e.exports=h},function(e,t,r){"use strict";(function(e,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(r(235)),a=r(23),s=r(27),u=r(20);function c(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("Unexpected runtime environment - no supported global scope (`window`, `self`, `global`) available")}function f(e,t,r){return r?`Use of '${r}' requires \`${t}\` which is unavailable on the '${e}' object within the currently executing environment.`:`\`${t}\` is unavailable on the '${e}' object within the currently executing environment.`}t.BLOCKSTACK_HANDLER="blockstack",t.nextYear=function(){return new Date((new Date).setFullYear((new Date).getFullYear()+1))},t.nextMonth=function(){return new Date((new Date).setMonth((new Date).getMonth()+1))},t.nextHour=function(){return new Date((new Date).setHours((new Date).getHours()+1))},t.updateQueryStringParameter=function(e,t,r){const n=new RegExp(`([?&])${t}=.*?(&|$)`,"i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(n)?e.replace(n,`$1${t}=${r}$2`):`${e}${i}${t}=${r}`},t.isLaterVersion=function(e,t){void 0===e&&(e="0.0.0"),void 0===t&&(t="0.0.0");const r=e.split(".").map(e=>parseInt(e,10)),n=t.split(".").map(e=>parseInt(e,10));for(let i=0;i<t.length;i++)if(i>=e.length&&n.push(0),r[i]<n[i])return!1;return!0},t.hexStringToECPair=function(t){const r={network:s.config.network.layer1,compressed:!0};if(66===t.length){if("01"!==t.slice(64))throw new Error("Improperly formatted private-key hex string. 66-length hex usually indicates compressed key, but last byte must be == 1");return a.ECPair.fromPrivateKey(e.from(t.slice(0,64),"hex"),r)}if(64===t.length)return r.compressed=!1,a.ECPair.fromPrivateKey(e.from(t,"hex"),r);throw new Error("Improperly formatted private-key hex string: length should be 64 or 66.")},t.ecPairToHexString=function(e){const t=e.privateKey.toString("hex");return e.compressed?`${t}01`:t},t.ecPairToAddress=function(e){return a.address.toBase58Check(a.crypto.hash160(e.publicKey),e.network.pubKeyHash)},t.makeUUID4=function(){let e=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)})},t.isSameOriginAbsoluteUrl=function(e,t){const r=o.default.parse(e),n=o.default.parse(t),i=0|parseInt(r.port||"0",10)||("https:"===r.protocol?443:80),a=0|parseInt(n.port||"0",10)||("https:"===n.protocol?443:80),s={scheme:r.protocol===n.protocol,hostname:r.hostname===n.hostname,port:i===a,absolute:(e.includes("http://")||e.includes("https://"))&&(t.includes("http://")||t.includes("https://"))};return s.scheme&&s.hostname&&s.port&&s.absolute},t.getGlobalObject=function(e,{throwIfUnavailable:t,usageDesc:r,returnEmptyObject:n}={}){let i;try{if(i=c()){const t=i[e];if(t)return t}}catch(t){u.Logger.error(`Error getting object '${e}' from global scope '${i}': ${t}`)}if(t){const t=f(i,e,r);throw u.Logger.error(t),new Error(t)}if(n)return{}},t.getGlobalObjects=function(e,{throwIfUnavailable:t,usageDesc:r,returnEmptyObject:n}={}){let i;try{i=c()}catch(o){if(u.Logger.error(`Error getting global scope: ${o}`),t){const t=f(i,e[0],r);throw u.Logger.error(t),t}n&&(i={})}const o={};for(let a=0;a<e.length;a++){const s=e[a];try{if(i){const e=i[s];if(e)o[s]=e;else{if(t){const e=f(i,s,r);throw u.Logger.error(e),new Error(e)}n&&(o[s]={})}}}catch(e){if(t){const e=f(i,s,r);throw u.Logger.error(e),new Error(e)}}}return o}}).call(this,r(0).Buffer,r(6))},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){(function(){var e,n,i,o,a,s;for(t.const=r(129),a=0,s=(i=[r(227),r(533)]).length;a<s;a++)for(e in n=i[a])o=n[e],t[e]=o}).call(this)},function(e,t,r){"use strict";var n=t,i=r(5),o=r(10),a=r(148);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t){for(var r=[],n=1<<t+1,i=e.clone();i.cmpn(1)>=0;){var o;if(i.isOdd()){var a=i.andln(n-1);o=a>(n>>1)-1?(n>>1)-a:a,i.isubn(o)}else o=0;r.push(o);for(var s=0!==i.cmpn(0)&&0===i.andln(n-1)?t+1:1,u=1;u<s;u++)r.push(0);i.iushrn(s)}return r},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,a,s,u=e.andln(3)+n&3,c=t.andln(3)+i&3;3===u&&(u=-1),3===c&&(c=-1),o=0==(1&u)?0:3!=(s=e.andln(7)+n&7)&&5!==s||2!==c?u:-u,r[0].push(o),a=0==(1&c)?0:3!=(s=t.andln(7)+i&7)&&5!==s||2!==u?c:-c,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.UNSIGNED_TX=0]="UNSIGNED_TX",e[e.GLOBAL_XPUB=1]="GLOBAL_XPUB"}(t.GlobalTypes||(t.GlobalTypes={})),t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],function(e){e[e.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",e[e.WITNESS_UTXO=1]="WITNESS_UTXO",e[e.PARTIAL_SIG=2]="PARTIAL_SIG",e[e.SIGHASH_TYPE=3]="SIGHASH_TYPE",e[e.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=6]="BIP32_DERIVATION",e[e.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",e[e.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",e[e.POR_COMMITMENT=9]="POR_COMMITMENT"}(t.InputTypes||(t.InputTypes={})),t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],function(e){e[e.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",e[e.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",e[e.BIP32_DERIVATION=2]="BIP32_DERIVATION"}(t.OutputTypes||(t.OutputTypes={})),t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]},function(e,t,r){(function(e,n){(function(){var i,o,a;o=r(11),a=Math.pow(2,32),t.fixup_uint32=function(e){var t;return e>a||e<0?(t=Math.abs(e)%a,e<0?a-t:t):e},t.scrub_buffer=function(e){var t,r;for(r=e.length>>2,t=0;t<r;)e.writeUInt32LE(0,t),t+=4;for(;t<e.length;)e.writeUInt8(0,t),t++;return!1},t.copy_buffer=function(t){var r,n,i,o;for(n=new e(t.length),r=i=0,o=t.length;0<=o?i<o:i>o;r=0<=o?++i:--i)n.writeUInt8(t.readUInt8(r),r);return n},t.scrub_vec=function(e){var t,r,n;for(t=r=0,n=e.length;0<=n?r<n:r>n;t=0<=n?++r:--r)e[t]=0;return!1},t.default_delay=i=function(e,t,r){var i,a;i=o.findDeferral(arguments),function(e){null!=n?function(e){a=new o.Deferrals(e,{parent:i,filename:"/Users/max/src/keybase/triplesec/src/util.iced"}),n(a.defer({lineno:45})),a._fulfill()}(e):function(e){a=new o.Deferrals(e,{parent:i,filename:"/Users/max/src/keybase/triplesec/src/util.iced"}),setTimeout(a.defer({lineno:47}),1),a._fulfill()}(e)}(function(){return r()})},t.buffer_cmp_ule=function(e,t){var r,n,i,o,a,s;for(i=o=0,r=e.length,n=t.length;i<r&&0===e.readUInt8(i);)i++;for(;o<n&&0===t.readUInt8(o);)o++;if(r-i>n-o)return 1;if(n-o>r-i)return-1;for(;i<r;){if((a=e.readUInt8(i))<(s=t.readUInt8(o)))return-1;if(s<a)return 1;i++,o++}return 0},t.bulk=function(e,t,r){var n,a,s,u,c,f,l,h,d,p,y,b,m,g,v,_;v=o.findDeferral(arguments),m=t.update,c=t.finalize,s=t.default_n,u=r.delay,h=r.n,a=r.cb,g=r.what,p=r.progress_hook,f=0,l=0,b=Math.ceil(e/4),u||(u=i),h||(h=s),(n=function(e){return"function"==typeof p?p({what:g,i:e,total:b}):void 0})(0),function(e){var t;(t=function(e){var r;if(r=function(){return o.trampoline(function(){return t(e)})},!((l=b-f)>0))return e();d=Math.min(h,l),m(f,f+d),n(f),_=new o.Deferrals(function(){return r(f+=d)},{parent:v,filename:"/Users/max/src/keybase/triplesec/src/util.iced",funcname:"bulk"}),u(f,b,_.defer({lineno:105})),_._fulfill()})(e)}(function(){return n(b),y=c(),a(y)})}}).call(this)}).call(this,r(0).Buffer,r(90).setImmediate)},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||f||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchPrivate=function(e,t){return(t=t||{}).referrerPolicy="no-referrer",fetch(e,t)}},function(e,t,r){"use strict";var n=r(10),i=r(2);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=u(i.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var f=0,l=t;return f+=(l=l+n>>>0)<t?1:0,f+=(l=l+o>>>0)<o?1:0,f+=(l=l+s>>>0)<s?1:0,e+r+i+a+u+(f+=(l=l+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERROR_CODES={MISSING_PARAMETER:"missing_parameter",REMOTE_SERVICE_ERROR:"remote_service_error",INVALID_STATE:"invalid_state",NO_SESSION_DATA:"no_session_data",UNKNOWN:"unknown"},Object.freeze(t.ERROR_CODES);class n extends Error{constructor(e){super(e.message),this.message=e.message,this.code=e.code,this.parameter=e.parameter?e.parameter:null}toString(){return`${super.toString()}\n code: ${this.code} param: ${this.parameter?this.parameter:"n/a"}`}}t.BlockstackError=n;t.FileNotFound=class extends n{constructor(e){super({message:e,code:"file_not_found"}),this.name="FileNotFound"}};t.InvalidParameterError=class extends n{constructor(e,t=""){super({code:"missing_parameter",message:t,parameter:""}),this.name="MissingParametersError"}};t.MissingParameterError=class extends n{constructor(e,r=""){super({code:t.ERROR_CODES.MISSING_PARAMETER,message:r,parameter:e}),this.name="MissingParametersError"}};t.RemoteServiceError=class extends n{constructor(e,r=""){super({code:t.ERROR_CODES.REMOTE_SERVICE_ERROR,message:r}),this.response=e}};t.InvalidDIDError=class extends n{constructor(e=""){super({code:"invalid_did_error",message:e}),this.name="InvalidDIDError"}};t.NotEnoughFundsError=class extends n{constructor(e){const t=`Not enough UTXOs to fund. Left to fund: ${e}`;super({code:"not_enough_error",message:t}),this.leftToFund=e,this.name="NotEnoughFundsError",this.message=t}};t.InvalidAmountError=class extends n{constructor(e,t){const r=`Not enough coin to fund fees transaction fees. Fees would be ${e},`+` specified spend is ${t}`;super({code:"invalid_amount_error",message:r}),this.specifiedAmount=t,this.fees=e,this.name="InvalidAmountError",this.message=r}};t.LoginFailedError=class extends n{constructor(e){const t=`Failed to login: ${e}`;super({code:"login_failed",message:t}),this.message=t,this.name="LoginFailedError"}};t.SignatureVerificationError=class extends n{constructor(e){const t=`Failed to verify signature: ${e}`;super({code:"signature_verification_failure",message:t}),this.message=t,this.name="SignatureVerificationError"}};t.InvalidStateError=class extends n{constructor(e){super({code:t.ERROR_CODES.INVALID_STATE,message:e}),this.message=e,this.name="InvalidStateError"}};t.NoSessionDataError=class extends n{constructor(e){super({code:t.ERROR_CODES.INVALID_STATE,message:e}),this.message=e,this.name="NoSessionDataError"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(27),i=["debug","info","warn","error","none"],o={},a={};for(let e=0;e<i.length;e++){const t=i[e];o[t]=e,a[e]=t}t.Logger=class{static error(e){this.shouldLog("error")&&console.error(this.logMessage("error",e))}static warn(e){this.shouldLog("warn")&&console.warn(this.logMessage("warn",e))}static info(e){this.shouldLog("info")&&console.log(this.logMessage("info",e))}static debug(e){this.shouldLog("debug")&&console.log(this.logMessage("debug",e))}static logMessage(e,t){return`[${e.toUpperCase()}] ${t}`}static shouldLog(e){return o[n.config.logLevel]<=o[e]}}},function(e,t,r){(function(){var e,n,i,o,a,s,u={}.hasOwnProperty;a=r(7).WordArray,s=r(15),n=function(){function e(){this.reset()}return e.prototype._minBufferSize=0,e.prototype.reset=function(){return this._data=new a,this._nDataBytes=0},e.prototype._append=function(e){return this._data.concat(e),this._nDataBytes+=e.sigBytes},e.prototype._process=function(e){var t,r,n,i,o,s,u,c,f,l;if(n=(t=this._data).words,i=(r=t.sigBytes)/(4*this.blockSize),s=(i=e?Math.ceil(i):Math.max((0|i)-this._minBufferSize,0))*this.blockSize,o=Math.min(4*s,r),s){for(u=f=0,l=this.blockSize;l>0?f<s:f>s;u=f+=l)this._doProcessBlock(n,u);c=n.splice(0,s),t.sigBytes-=o}return new a(c,o)},e.prototype.copy_to=function(e){return e._data=this._data.clone(),e._nDataBytes=this._nDataBytes},e.prototype.clone=function(){var t;return t=new e,this.copy_to(t),t},e}(),i=function(e){function t(){t.__super__.constructor.call(this)}return function(e,t){for(var r in t)u.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,n),t.prototype.reset=function(){return t.__super__.reset.call(this),this._doReset(),this},t.prototype.update=function(e){return this._append(e),this._process(),this},t.prototype.finalize=function(e){return e&&this._append(e),this._doFinalize()},t.prototype.bufhash=function(e){var t,r,n;return r=a.from_buffer(e),t=(n=this.finalize(r)).to_buffer(),r.scrub(),n.scrub(),t},t}(),t.BlockCipher=e=function(){function e(e){}return e.prototype.encryptBlock=function(e,t){},e}(),o=function(){function e(){}return e.prototype.encryptBlock=function(e,t){var r,n;return null==t&&(t=0),n=this.get_pad(),r=Math.min(e.words.length-t,this.bsiw),e.xor(n,{dst_offset:t,n_words:r}),n.scrub(),this.bsiw},e.prototype.encrypt=function(e){var t,r,n,i;for(t=r=0,n=e.words.length,i=this.bsiw;i>0?r<n:r>n;t=r+=i)this.encryptBlock(e,t);return e},e.prototype.bulk_encrypt=function(e,t){var r,n,i,o,a,u;return n=e.input,i=e.progress_hook,a=e.what,o={update:(u=this,function(e,t){var r,i,o,a;for(a=[],r=i=e,o=u.bsiw;o>0?i<t:i>t;r=i+=o)a.push(u.encryptBlock(n,r));return a}),finalize:function(){return n},default_n:1024*this.bsiw},r={progress_hook:i,cb:t,what:a},s.bulk(n.sigBytes,o,r)},e}(),t.BlockCipher=e,t.Hasher=i,t.BufferedBlockAlgorithm=n,t.StreamCipher=o}).call(this)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(241);t.bip32=n;var i=r(96);t.address=i;var o=r(26);t.crypto=o;var a=r(99);t.ECPair=a;var s=r(13);t.networks=s;var u=r(65);t.payments=u;var c=r(4);t.script=c;var f=r(296);t.Block=f.Block;var l=r(298);t.Psbt=l.Psbt;var h=r(4);t.opcodes=h.OPS;var d=r(66);t.Transaction=d.Transaction;var p=r(316);t.TransactionBuilder=p.TransactionBuilder},function(e,t,r){"use strict";var n=r(2),i=r(85),o=r(46),a=r(91),s=r(29);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),i=Math.pow(2,31)-1;function o(e){return n.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return n.UInt32(e)&&e<=i},t.BIP32Path=o,o.toJSON=function(){return"BIP32 derivation path"},t.Signer=function(e){return(n.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign};var a=21e14;t.Satoshi=function(e){return n.UInt53(e)&&e<=a},t.ECPoint=n.quacksLike("Point"),t.Network=n.compile({messagePrefix:n.oneOf(n.Buffer,n.String),bip32:{public:n.UInt32,private:n.UInt32},pubKeyHash:n.UInt8,scriptHash:n.UInt8,wif:n.UInt8}),t.Buffer256bit=n.BufferN(32),t.Hash160bit=n.BufferN(20),t.Hash256bit=n.BufferN(32),t.Number=n.Number,t.Array=n.Array,t.Boolean=n.Boolean,t.String=n.String,t.Buffer=n.Buffer,t.Hex=n.Hex,t.maybe=n.maybe,t.tuple=n.tuple,t.UInt8=n.UInt8,t.UInt32=n.UInt32,t.Function=n.Function,t.BufferN=n.BufferN,t.Null=n.Null,t.oneOf=n.oneOf},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(24);function i(e){try{return n("rmd160").update(e).digest()}catch(t){return n("ripemd160").update(e).digest()}}function o(e){return n("sha256").update(e).digest()}t.ripemd160=i,t.sha1=function(e){return n("sha1").update(e).digest()},t.sha256=o,t.hash160=function(e){return i(o(e))},t.hash256=function(e){return o(o(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={network:r(161).network.defaults.MAINNET_DEFAULT,logLevel:"debug"};t.config=n},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,r){var n=r(3).Buffer,i=r(86).Transform,o=r(62).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(2)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){"use strict";(function(t,n){var i=65536,o=4294967295;var a=r(3).Buffer,s=t.crypto||t.msCrypto;s&&s.getRandomValues?e.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u<e;u+=i)s.getRandomValues(r.slice(u,u+i));else s.getRandomValues(r);if("function"==typeof t)return n.nextTick(function(){t(null,r)});return r}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(6),r(16))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(335);Object.defineProperty(t,"TokenSigner",{enumerable:!0,get:function(){return n.TokenSigner}}),Object.defineProperty(t,"createUnsecuredToken",{enumerable:!0,get:function(){return n.createUnsecuredToken}});var i=r(451);Object.defineProperty(t,"TokenVerifier",{enumerable:!0,get:function(){return i.TokenVerifier}});var o=r(452);Object.defineProperty(t,"decodeToken",{enumerable:!0,get:function(){return o.decodeToken}});var a=r(74);Object.defineProperty(t,"MissingParametersError",{enumerable:!0,get:function(){return a.MissingParametersError}}),Object.defineProperty(t,"InvalidTokenError",{enumerable:!0,get:function(){return a.InvalidTokenError}});var s=r(107);Object.defineProperty(t,"SECP256K1Client",{enumerable:!0,get:function(){return s.SECP256K1Client}}),Object.defineProperty(t,"cryptoClients",{enumerable:!0,get:function(){return s.cryptoClients}})},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(23),i=r(31),o=r(9);function a(t,r){const a=i.decodeToken(t),s=a.payload;if(!s.hasOwnProperty("subject"))throw new Error("Token doesn't have a subject");if(!s.subject.hasOwnProperty("publicKey"))throw new Error("Token doesn't have a subject public key");if(!s.hasOwnProperty("issuer"))throw new Error("Token doesn't have an issuer");if(!s.issuer.hasOwnProperty("publicKey"))throw new Error("Token doesn't have an issuer public key");if(!s.hasOwnProperty("claim"))throw new Error("Token doesn't have a claim");const u=s.issuer.publicKey,c=e.from(u,"hex"),f=n.ECPair.fromPublicKey(c,{compressed:!0}),l=o.ecPairToAddress(f),h=n.ECPair.fromPublicKey(c,{compressed:!1}),d=o.ecPairToAddress(h);if(r===u);else if(r===l);else if(r!==d)throw new Error("Token issuer public key does not match the verifying value");const p=new i.TokenVerifier(a.header.alg,u);if(!p)throw new Error("Invalid token verifier");if(!p.verify(t))throw new Error("Token verification failed");return a}t.signProfileToken=function(e,t,r,n,a="ES256K",s=new Date,u=o.nextYear()){if("ES256K"!==a)throw new Error("Signing algorithm not supported");const c=i.SECP256K1Client.derivePublicKey(t);r||(r={publicKey:c}),n||(n={publicKey:c});const f=new i.TokenSigner(a,t),l={jti:o.makeUUID4(),iat:s.toISOString(),exp:u.toISOString(),subject:r,issuer:n,claim:e};return f.sign(l)},t.wrapProfileToken=function(e){return{token:e,decodedToken:i.decodeToken(e)}},t.verifyProfileToken=a,t.extractProfile=function(e,t=null){let r,n={};(r=t?a(e,t):i.decodeToken(e)).hasOwnProperty("payload")&&r.payload.hasOwnProperty("claim")&&(n=r.payload.claim);return n}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(61),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(45);o.inherits=r(2);var a=r(141),s=r(89);o.inherits(l,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];l.prototype[f]||(l.prototype[f]=s.prototype[f])}function l(e){if(!(this instanceof l))return new l(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){(function(t){var n=r(5),i=new(0,r(35).ec)("secp256k1"),o=r(283),a=t.alloc(32,0),s=t.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),u=t.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),c=i.curve.n,f=c.shrn(1),l=i.curve.g,h="Expected Private",d="Expected Point",p="Expected Tweak",y="Expected Hash",b="Expected Signature",m="Expected Extra Data (32 bytes)";function g(e){return t.isBuffer(e)&&32===e.length}function v(e){return!!g(e)&&e.compare(s)<0}function _(e){if(!t.isBuffer(e))return!1;if(e.length<33)return!1;var r=e[0],n=e.slice(1,33);if(0===n.compare(a))return!1;if(n.compare(u)>=0)return!1;if((2===r||3===r)&&33===e.length){try{A(e)}catch(e){return!1}return!0}var i=e.slice(33);return 0!==i.compare(a)&&(!(i.compare(u)>=0)&&(4===r&&65===e.length))}function w(e){return 4!==e[0]}function S(e){return!!g(e)&&(e.compare(a)>0&&e.compare(s)<0)}function k(e,t){return void 0===e&&void 0!==t?w(t):void 0===e||e}function E(e){return new n(e)}function x(e){return e.toArrayLike(t,"be",32)}function A(e){return i.curve.decodePoint(e)}function O(e,r){return t.from(e._encode(r))}function P(e,r,n){if(!g(e))throw new TypeError(y);if(!S(r))throw new TypeError(h);if(void 0!==n&&!g(n))throw new TypeError(m);var i,a,s=E(r),u=E(e);o(e,r,function(e){var t=E(e),r=l.mul(t);return!r.isInfinity()&&0!==(i=r.x.umod(c)).isZero()&&0!==(a=t.invm(c).mul(u.add(s.mul(i))).umod(c)).isZero()},S,n),a.cmp(f)>0&&(a=c.sub(a));var d=t.allocUnsafe(64);return x(i).copy(d,0),x(a).copy(d,32),d}e.exports={isPoint:_,isPointCompressed:function(e){return!!_(e)&&w(e)},isPrivate:S,pointAdd:function(e,t,r){if(!_(e))throw new TypeError(d);if(!_(t))throw new TypeError(d);var n=A(e),i=A(t),o=n.add(i);return o.isInfinity()?null:O(o,k(r,e))},pointAddScalar:function(e,t,r){if(!_(e))throw new TypeError(d);if(!v(t))throw new TypeError(p);var n=k(r,e),i=A(e);if(0===t.compare(a))return O(i,n);var o=E(t),s=l.mul(o),u=i.add(s);return u.isInfinity()?null:O(u,n)},pointCompress:function(e,t){if(!_(e))throw new TypeError(d);var r=A(e);if(r.isInfinity())throw new TypeError(d);return O(r,t)},pointFromScalar:function(e,t){if(!S(e))throw new TypeError(h);var r=E(e),n=l.mul(r);return n.isInfinity()?null:O(n,k(t))},pointMultiply:function(e,t,r){if(!_(e))throw new TypeError(d);if(!v(t))throw new TypeError(p);var n=k(r,e),i=A(e),o=E(t),a=i.mul(o);return a.isInfinity()?null:O(a,n)},privateAdd:function(e,t){if(!S(e))throw new TypeError(h);if(!v(t))throw new TypeError(p);var r=E(e),n=E(t),i=x(r.add(n).umod(c));return S(i)?i:null},privateSub:function(e,t){if(!S(e))throw new TypeError(h);if(!v(t))throw new TypeError(p);var r=E(e),n=E(t),i=x(r.sub(n).umod(c));return S(i)?i:null},sign:function(e,t){return P(e,t)},signWithEntropy:function(e,t,r){return P(e,t,r)},verify:function(e,r,n){if(!g(e))throw new TypeError(y);if(!_(r))throw new TypeError(d);if(!function(e){var r=e.slice(0,32),n=e.slice(32,64);return t.isBuffer(e)&&64===e.length&&r.compare(s)<0&&n.compare(s)<0}(n))throw new TypeError(b);var i=A(r),o=E(n.slice(0,32)),a=E(n.slice(32,64));if(o.gtn(0)<=0)return!1;if(a.gtn(0)<=0)return!1;var u=E(e),f=a.invm(c),h=u.mul(f).umod(c),p=o.mul(f).umod(c),m=l.mulAdd(h,i,p);return!m.isInfinity()&&m.x.umod(c).eq(o)}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=t;n.version=r(264).version,n.utils=r(12),n.rand=r(92),n.curve=r(149),n.curves=r(93),n.ec=r(276),n.eddsa=r(280)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=r.call(this);return this[t]=e,e},set:function(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){var t;return function(){return void 0!==t?t:t=e()}}},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(30),t.createHash=t.Hash=r(24),t.createHmac=t.Hmac=r(63);var n=r(339),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(108);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(341);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var u=r(358);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=r(361);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r(377);var f=r(378);t.publicEncrypt=f.publicEncrypt,t.privateEncrypt=f.privateEncrypt,t.publicDecrypt=f.publicDecrypt,t.privateDecrypt=f.privateDecrypt;var l=r(381);t.randomFill=l.randomFill,t.randomFillSync=l.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var r in t)void 0===e[r]&&(e[r]=t[r]);return e},e.exports=t.default,e.exports.default=t.default},function(e,t,r){(function(){var e,n,i,o,a,s,u,c={}.hasOwnProperty;u=r(7),o=u.X64Word,a=u.X64WordArray,n=r(21).Hasher,e=function(){function e(){this.K=this.convert([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]),this.I=new a(this.convert([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])),this.W=function(){var e,t;for(t=[],e=0;e<80;++e)t.push(new o(0,0));return t}()}return e.convert=function(e){var t,r,n,i;for(i=[],t=r=0,n=e.length;r<n;t=r+=2)i.push(new o(e[t],e[t+1]));return i},e.prototype.convert=function(t){return e.convert(t)},e}(),t.Global=e,s=new e,t.SHA512=i=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return function(e,t){for(var r in t)c.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,n),t.blockSize=32,t.prototype.blockSize=t.blockSize,t.output_size=64,t.prototype.output_size=t.output_size,t.prototype._doReset=function(){return this._hash=s.I.clone()},t.prototype._doProcessBlock=function(e,t){var r,n,i,o,a,u,c,f,l,h,d,p,y,b,m,g,v,_,w,S,k,E,x,A,O,P,T,I,j,M,B,N,C,D,U,R,F,L,z,q,H,K,$,V,G,W,X,J,Z,Y,Q,ee,te,re,ne,ie,oe,ae,se,ue,ce,fe,le,he,de,pe,ye,be,me,ge,ve;for(r=this._hash.words,I=s.W,n=r[0],a=r[1],f=r[2],d=r[3],b=r[4],v=r[5],S=r[6],x=r[7],U=i=n.high,R=o=n.low,F=u=a.high,L=c=a.low,z=l=f.high,K=h=f.low,$=p=d.high,V=y=d.low,G=m=b.high,W=g=b.low,X=_=v.high,J=w=v.low,se=k=S.high,ue=E=S.low,ce=A=x.high,fe=O=x.low,le=ve=0;ve<80;le=++ve)j=I[le],le<16?(C=j.high=0|e[t+2*le],D=j.low=0|e[t+2*le+1]):(Z=((ee=(Q=I[le-15]).high)>>>1|(te=Q.low)<<31)^(ee>>>8|te<<24)^ee>>>7,Y=(te>>>1|ee<<31)^(te>>>8|ee<<24)^(te>>>7|ee<<25),re=((oe=(ie=I[le-2]).high)>>>19|(ae=ie.low)<<13)^(oe<<3|ae>>>29)^oe>>>6,ne=(ae>>>19|oe<<13)^(ae<<3|oe>>>29)^(ae>>>6|oe<<26),C=(C=(C=Z+(N=I[le-7]).high+((D=Y+N.low)>>>0<Y>>>0?1:0))+re+((D+=ne)>>>0<ne>>>0?1:0))+(M=I[le-16]).high+((D+=B=M.low)>>>0<B>>>0?1:0),j.high=C,j.low=D),q=G&X^~G&se,H=W&J^~W&ue,he=U&F^U&z^F&z,de=R&L^R&K^L&K,pe=(U>>>28|R<<4)^(U<<30|R>>>2)^(U<<25|R>>>7),ye=(R>>>28|U<<4)^(R<<30|U>>>2)^(R<<25|U>>>7),be=ce+((G>>>14|W<<18)^(G>>>18|W<<14)^(G<<23|W>>>9))+((me=fe+((W>>>14|G<<18)^(W>>>18|G<<14)^(W<<23|G>>>9)))>>>0<fe>>>0?1:0),ce=se,fe=ue,se=X,ue=J,X=G,J=W,G=$+(be=(be=(be=be+q+((me+=H)>>>0<H>>>0?1:0))+(P=s.K[le]).high+((me+=T=P.low)>>>0<T>>>0?1:0))+C+((me+=D)>>>0<D>>>0?1:0))+((W=V+me|0)>>>0<V>>>0?1:0)|0,$=z,V=K,z=F,K=L,F=U,L=R,U=be+(pe+he+((ge=ye+de)>>>0<ye>>>0?1:0))+((R=me+ge|0)>>>0<me>>>0?1:0)|0;return o=n.low=o+R,n.high=i+U+(o>>>0<R>>>0?1:0),c=a.low=c+L,a.high=u+F+(c>>>0<L>>>0?1:0),h=f.low=h+K,f.high=l+z+(h>>>0<K>>>0?1:0),y=d.low=y+V,d.high=p+$+(y>>>0<V>>>0?1:0),g=b.low=g+W,b.high=m+G+(g>>>0<W>>>0?1:0),w=v.low=w+J,v.high=_+X+(w>>>0<J>>>0?1:0),E=S.low=E+ue,S.high=k+se+(E>>>0<ue>>>0?1:0),O=x.low=O+fe,x.high=A+ce+(O>>>0<fe>>>0?1:0)},t.prototype._doFinalize=function(){var e,t,r;return e=this._data.words,r=8*this._nDataBytes,e[(t=8*this._data.sigBytes)>>>5]|=128<<24-t%32,e[30+(t+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(t+128>>>10<<5)]=r,this._data.sigBytes=4*e.length,this._process(),this._hash.toX32()},t.prototype.copy_to=function(e){return t.__super__.copy_to.call(this,e),e._hash=this._hash.clone()},t.prototype.clone=function(){var e;return e=new t,this.copy_to(e),e},t}(),t.transform=function(e){var t;return t=(new i).finalize(e),e.scrub(),t}}).call(this)},function(e,t,r){var n=r(3).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,c=Math.min(o-s,i-u),f=0;f<c;f++)r[u+f]=e[s+f];s+=c,(a+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});const n=r(37),i=r(23);function o(e){return e||(e=32),"number"==typeof e?n.randomBytes(e):n.randomFillSync(e)}t.getEntropy=o,t.makeECPrivateKey=function(){return i.ECPair.makeRandom({rng:o}).privateKey.toString("hex")},t.publicKeyToAddress=function(t){const r=e.from(t,"hex"),n=i.crypto.hash160(r);return i.address.toBase58Check(n,0)},t.getPublicKeyFromPrivate=function(t){return i.ECPair.fromPrivateKey(e.from(t,"hex")).publicKey.toString("hex")}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(105);const n=r(219),i=r(17);t.Service=class{static validateProof(e,t,r=null){let o;return Promise.resolve().then(()=>(o=this.getProofUrl(e),i.fetchPrivate(o))).then(e=>{if(200!==e.status)throw new Error(`Proof url ${o} returned unexpected http status ${e.status}.\n Unable to validate proof.`);return e.text()}).then(i=>{if(this.shouldValidateIdentityInBody()&&e.identifier!==this.getProofIdentity(i))return e;const o=this.getProofStatement(i);return e.valid=n.containsValidProofStatement(o,r)||n.containsValidAddressProofStatement(o,t),e}).catch(t=>(console.error(t),e.valid=!1,e))}static getBaseUrls(){return[]}static getProofIdentity(e){return e}static getProofStatement(e){return e}static shouldValidateIdentityInBody(){return!1}static prefixScheme(e){return e.startsWith("https://")||e.startsWith("http://")?e.startsWith("http://")?e.replace("http://","https://"):e:`https://${e}`}static getProofUrl(e){const t=this.getBaseUrls();let r=e.proof_url.toLowerCase();r=this.prefixScheme(r);for(let n=0;n<t.length;n++){const i=`${t[n]}${e.identifier}`.toLowerCase();if(r.startsWith(i))return r}throw new Error(`Proof url ${e.proof_url} is not valid for service ${e.service}`)}}},function(e,t,r){(function(){var e,n,i,o,a,s,u,c={}.hasOwnProperty;a=r(11),i=r(39).SHA512,n=r(132).SHA256,u=r(15),e=function(){function e(e,t){var r,n,o;for(null==t&&(t=i),this.key=e.clone(),this.hasher=new t,this.hasherBlockSize=this.hasher.blockSize,this.hasherBlockSizeBytes=4*this.hasherBlockSize,this.key.sigBytes>this.hasherBlockSizeBytes&&(this.key=this.hasher.finalize(this.key)),this.key.clamp(),this._oKey=this.key.clone(),this._iKey=this.key.clone(),r=n=0,o=this.hasherBlockSize;0<=o?n<o:n>o;r=0<=o?++n:--n)this._oKey.words[r]^=1549556828,this._iKey.words[r]^=909522486;this._oKey.sigBytes=this._iKey.sigBytes=this.hasherBlockSizeBytes,this.reset()}return e.outputSize=64,e.prototype.outputSize=e.outputSize,e.prototype.get_output_size=function(){return this.hasher.output_size},e.prototype.reset=function(){return this.hasher.reset().update(this._iKey)},e.prototype.update=function(e){return this.hasher.update(e),this},e.prototype.finalize=function(e){var t,r,n;return t=this.hasher.finalize(e),this.hasher.reset(),r=this._oKey.clone().concat(t),n=this.hasher.finalize(r),t.scrub(),r.scrub(),n},e.prototype.scrub=function(){return this.key.scrub(),this._iKey.scrub(),this._oKey.scrub()},e}(),s=function(t){var r,n,i,o,a;return o=t.key,i=t.input,n=t.hash_class,a=(r=new e(o,n)).finalize(i.clamp()),r.scrub(),a},o=function(t,r){var n,i,o,s,c,f,l,h,d,p;d=a.findDeferral(arguments),o=t.key,i=t.input,c=t.progress_hook,s=t.klass,h=t.what,s||(s=e),h||(h="hmac_sha512"),n=new s(o),i.clamp(),l={update:function(e,t){return n.update(i.slice(e,t))},finalize:function(){return n.finalize()},default_n:1e3*n.hasherBlockSize},function(e){p=new a.Deferrals(e,{parent:d,filename:"/Users/max/src/keybase/triplesec/src/hmac.iced"}),u.bulk(i.sigBytes,l,{what:h,progress_hook:c,cb:p.defer({assign_fn:function(){return f=arguments[0]},lineno:137})}),p._fulfill()}(function(){return n.scrub(),r(f)})},t.HMAC_SHA256=function(t){function r(e){r.__super__.constructor.call(this,e,n)}return function(e,t){for(var r in t)c.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(r,e),r}(),t.HMAC=e,t.sign=s,t.bulk_sign=o}).call(this)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BLOCKSTACK_HANDLER="blockstack",t.BLOCKSTACK_STORAGE_LABEL="blockstack",t.DEFAULT_BLOCKSTACK_HOST="https://browser.blockstack.org/auth",t.DEFAULT_SCOPE=["store_write"],t.BLOCKSTACK_APP_PRIVATE_KEY_LABEL="blockstack-transit-private-key",t.BLOCKSTACK_DEFAULT_GAIA_HUB_URL="https://hub.blockstack.org",t.DEFAULT_CORE_NODE="https://core.blockstack.org",t.NAME_LOOKUP_PATH="/v1/names",t.LOCALSTORAGE_SESSION_KEY="blockstack-session"},function(e,t,r){(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"===r(e)},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"===r(e)&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===r(e)||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(0).Buffer,i=r(2),o=r(140),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[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],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function y(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,w=0|this._b,S=0|this._c,k=0|this._d,E=0|this._e,x=0;x<80;x+=1){var A,O;x<16?(A=y(r,n,i,o,d,e[s[x]],l[0],c[x]),O=v(_,w,S,k,E,e[u[x]],h[0],f[x])):x<32?(A=b(r,n,i,o,d,e[s[x]],l[1],c[x]),O=g(_,w,S,k,E,e[u[x]],h[1],f[x])):x<48?(A=m(r,n,i,o,d,e[s[x]],l[2],c[x]),O=m(_,w,S,k,E,e[u[x]],h[2],f[x])):x<64?(A=g(r,n,i,o,d,e[s[x]],l[3],c[x]),O=b(_,w,S,k,E,e[u[x]],h[3],f[x])):(A=v(r,n,i,o,d,e[s[x]],l[4],c[x]),O=y(_,w,S,k,E,e[u[x]],h[4],f[x])),r=d,d=o,o=p(i,10),i=n,n=A,_=E,E=k,k=p(S,10),S=w,w=O}var P=this._b+i+k|0;this._b=this._c+o+E|0,this._c=this._d+d+_|0,this._d=this._e+r+w|0,this._e=this._a+n+S|0,this._a=P},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){"use strict";var n=r(24),i=r(260);e.exports=i(function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()})},function(e,t,r){"use strict";var n=r(18),i=r(10);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},function(e,t,r){"use strict";function n(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}Object.defineProperty(t,"__esModule",{value:!0}),t.readUInt64LE=function(e,t){var r=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return n((i*=4294967296)+r,9007199254740991),i+r},t.writeUInt64LE=function(e,t,r){return n(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8},t.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,r=0,n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e}},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;o<n;++o)i[o]=e[o]^r[o];return i}}).call(this,r(0).Buffer)},function(e,t,r){var n=t;n.bignum=r(5),n.define=r(364).define,n.base=r(52),n.constants=r(174),n.decoders=r(369),n.encoders=r(371)},function(e,t,r){var n=t;n.Reporter=r(366).Reporter,n.DecoderBuffer=r(173).DecoderBuffer,n.EncoderBuffer=r(173).EncoderBuffer,n.Node=r(367)},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2),o=r(114).Reporter,a=r(0).Buffer;function s(e,t){o.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function u(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return u.isEncoderBuffer(e)||(e=new u(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+n(e));this.value=e,this.length=e.length}}i(s,o),t.DecoderBuffer=s,s.isDecoderBuffer=function(e){return e instanceof s||"object"===n(e)&&a.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},s.prototype.restore=function(e){var t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=u,u.isEncoderBuffer=function(e){return e instanceof u||"object"===n(e)&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},u.prototype.join=function(e,t){return e||(e=new a(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},function(e,t,r){(e.exports=r(122)).version=r(507).version},function(e,t,r){var n=r(206),i=r(210);function o(t,r){return delete e.exports[t],e.exports[t]=r,r}e.exports={Parser:n,Tokenizer:r(207),ElementType:r(28),DomHandler:i,get FeedHandler(){return o("FeedHandler",r(467))},get Stream(){return o("Stream",r(477))},get WritableStream(){return o("WritableStream",r(213))},get ProxyHandler(){return o("ProxyHandler",r(479))},get DomUtils(){return o("DomUtils",r(212))},get CollectingHandler(){return o("CollectingHandler",r(480))},DefaultHandler:i,get RssHandler(){return o("RssHandler",this.FeedHandler)},parseDOM:function(e,t){var r=new i(t);return new n(r,t).end(e),r.dom},parseFeed:function(t,r){var i=new e.exports.FeedHandler(r);return new n(i,r).end(t),i.dom},createDomStream:function(e,t,r){var o=new i(e,t,r);return new n(o,t)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(e,t,r){var n=r(80),i=r(81),o={tag:!0,script:!0,style:!0};t.isTag=function(e){return e.type&&(e=e.type),o[e]||!1},t.camelCase=function(e){return e.replace(/[_.-](\w|$)/g,function(e,t){return t.toUpperCase()})},t.cssCase=function(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase()},t.domEach=function(e,t){for(var r=0,n=e.length;r<n&&!1!==t.call(e,r,e[r]);)++r;return e},t.cloneDom=function(e,t){return n(i(e,t),t).children};var a=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;t.isHtml=function(e){if("<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3)return!0;var t=a.exec(e);return!(!t||!t[1])}},function(e,t,r){var n=e.exports;[r(482),r(483),r(484),r(485),r(486),r(487)].forEach(function(e){Object.keys(e).forEach(function(t){n[t]=e[t].bind(n)})})},function(e,t){e.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},function(e,t,r){(function(e){(function(){var n,i,o,a,s,u,c,f,l,h,d,p,y,b={}.hasOwnProperty,m=function(e,t){for(var r in t)b.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};d=r(11),y=r(7),l=y.endian_reverse,c=y.WordArray,i=r(83).Counter,h=r(15).fixup_uint32,u=r(21).StreamCipher,p=r(15),f=function(e,t){var r,n,i,o;for(n=i=0,o=t.length;i<o;n=++i)r=t[n],e[n]+=r;return!1},a=function(){function e(e){this.rounds=e}return e.prototype._core=function(e){var t,r,n,i,o,a,s,u,c,f,l,h,d,p,y,b,m,g,v;for(r=e[0],n=e[1],f=e[2],l=e[3],h=e[4],d=e[5],p=e[6],y=e[7],b=e[8],m=e[9],i=e[10],o=e[11],a=e[12],s=e[13],u=e[14],c=e[15],g=0,v=this.rounds;g<v;g+=2)r^=(t=(a^=(t=(b^=(t=(h^=(t=r+a|0)<<7|t>>>25)+r|0)<<9|t>>>23)+h|0)<<13|t>>>19)+b|0)<<18|t>>>14,d^=(t=(n^=(t=(s^=(t=(m^=(t=d+n|0)<<7|t>>>25)+d|0)<<9|t>>>23)+m|0)<<13|t>>>19)+s|0)<<18|t>>>14,i^=(t=(p^=(t=(f^=(t=(u^=(t=i+p|0)<<7|t>>>25)+i|0)<<9|t>>>23)+u|0)<<13|t>>>19)+f|0)<<18|t>>>14,c^=(t=(o^=(t=(y^=(t=(l^=(t=c+o|0)<<7|t>>>25)+c|0)<<9|t>>>23)+l|0)<<13|t>>>19)+y|0)<<18|t>>>14,r^=(t=(l^=(t=(f^=(t=(n^=(t=r+l|0)<<7|t>>>25)+r|0)<<9|t>>>23)+n|0)<<13|t>>>19)+f|0)<<18|t>>>14,d^=(t=(h^=(t=(y^=(t=(p^=(t=d+h|0)<<7|t>>>25)+d|0)<<9|t>>>23)+p|0)<<13|t>>>19)+y|0)<<18|t>>>14,i^=(t=(m^=(t=(b^=(t=(o^=(t=i+m|0)<<7|t>>>25)+i|0)<<9|t>>>23)+o|0)<<13|t>>>19)+b|0)<<18|t>>>14,c^=(t=(u^=(t=(s^=(t=(a^=(t=c+u|0)<<7|t>>>25)+c|0)<<9|t>>>23)+a|0)<<13|t>>>19)+s|0)<<18|t>>>14;return[r,n,f,l,h,d,p,y,b,m,i,o,a,s,u,c]},e}(),o=function(t){function r(e,t){var n;if(r.__super__.constructor.call(this,20),this.key=e.clone().endian_reverse(),this.nonce=t.clone().endian_reverse(),(16!==this.key.sigBytes||8!==this.nonce.sigBytes)&&(32!==this.key.sigBytes||8!==(n=this.nonce.sigBytes)&&24!==n))throw new Error("Bad key/nonce lengths");24===this.nonce.sigBytes&&this.xsalsa_setup(),this.input=this.key_iv_setup(this.nonce,this.key),this._reset()}return m(r,a),r.prototype.sigma=c.from_buffer_le(new e("expand 32-byte k")),r.prototype.tau=c.from_buffer_le(new e("expand 16-byte k")),r.blockSize=64,r.prototype.blockSize=r.blockSize,r.keySize=32,r.prototype.keySize=r.keySize,r.ivSize=24,r.prototype.ivSize=r.ivSize,r.prototype.scrub=function(){return this.key.scrub(),this.nonce.scrub(),p.scrub_vec(this.input)},r.prototype.xsalsa_setup=function(){var e;return e=new c(this.nonce.words.slice(0,4)),this.nonce=new c(this.nonce.words.slice(4)),this.key=this.hsalsa20(e,this.key)},r.prototype.hsalsa20=function(e,t){var r,n,i,o;return(i=this.key_iv_setup(e,t))[8]=e.words[2],i[9]=e.words[3],o=this._core(i),n=[0,5,10,15,6,7,8,9],o=function(){var e,t,i;for(i=[],e=0,t=n.length;e<t;e++)r=n[e],i.push(h(o[r]));return i}(),p.scrub_vec(i),new c(o)},r.prototype.key_iv_setup=function(e,t){var r,n,i,o,a,s,u,c;for(o=[],i=a=0;a<4;i=++a)o[i+1]=t.words[i];for(n=(c=32===t.sigBytes?[this.sigma,t.words.slice(4)]:[this.tau,t.words])[0],r=c[1],i=s=0;s<4;i=++s)o[i+11]=r[i];for(i=u=0;u<4;i=++u)o[5*i]=n.words[i];return o[6]=e.words[0],o[7]=e.words[1],o},r.prototype.counter_setup=function(){return this.input[8]=this.counter.get().words[0],this.input[9]=this.counter.get().words[1]},r.prototype._reset=function(){return this.counter=new i({len:2})},r.prototype._generateBlock=function(){var e;return this.counter_setup(),e=this._core(this.input),f(e,this.input),this.counter.inc_le(),e},r}(),t.Salsa20WordStream=s=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return m(t,o),t.prototype._reset=function(){return t.__super__._reset.call(this)},t.prototype.getWordArray=function(e){var t,r,n,i,o,a,s,u;for(null==e||e===this.blockSize?o=this._generateBlock():(n=Math.ceil(e/this.blockSize),t=function(){var e,t;for(t=[],r=e=0;0<=n?e<n:e>n;r=0<=n?++e:--e)t.push(this._generateBlock());return t}.call(this),o=(u=[]).concat.apply(u,t)),r=a=0,s=o.length;a<s;r=++a)i=o[r],o[r]=l(i);return new c(o,e)},t}(),t.Salsa20=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return m(r,o),r.prototype._reset=function(){return r.__super__._reset.call(this),this._i=this.blockSize},r.prototype.getBytes=function(t){var r,n,i;if(null==t&&(t=this.blockSize),i=[],r=this.blockSize,this._i===r&&t===r)return this._generateBlockBuffer();for(;t>0;)this._i===r&&(this._generateBlockBuffer(),this._i=0),n=Math.min(t,r-this._i),i.push(n===r?this._buf:this._buf.slice(this._i,this._i+n)),this._i+=n,t-=n;return e.concat(i)},r.prototype._generateBlockBuffer=function(){var t,r,n,i,o;for(this._buf=new e(this.blockSize),r=i=0,o=(n=this._generateBlock()).length;i<o;r=++i)t=n[r],this._buf.writeUInt32LE(h(t),4*r);return this._buf},r}(),t.Cipher=n=function(e){function t(e){var r,n;n=e.key,r=e.iv,t.__super__.constructor.call(this),this.salsa=new s(n,r),this.bsiw=this.salsa.blockSize/4}return m(t,u),t.prototype.scrub=function(){return this.salsa.scrub()},t.prototype.get_pad=function(){return this.salsa.getWordArray()},t}(),t.encrypt=function(e){var t,r,i,o,a;return o=e.key,i=e.iv,r=e.input,a=(t=new n({key:o,iv:i})).encrypt(r),t.scrub(),a},t.bulk_encrypt=function(e,t){var r,i,o,a,s,u,c,f;c=d.findDeferral(arguments),a=e.key,o=e.iv,i=e.input,s=e.progress_hook,r=new n({key:a,iv:o}),function(e){f=new d.Deferrals(e,{parent:c,filename:"/Users/max/src/keybase/triplesec/src/salsa20.iced"}),r.bulk_encrypt({input:i,progress_hook:s,what:"salsa20"},f.defer({assign_fn:function(){return u=arguments[0]},lineno:256})),f._fulfill()}(function(){return r.scrub(),t(u)})},t.Salsa20InnerCore=a,t.endian_reverse=l,t.asum=f}).call(this)}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,o="object"===("undefined"==typeof Reflect?"undefined":n(Reflect))?Reflect:null,a=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};i=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function f(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function l(e,t,r,i){var o,a,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(r));if(void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(o=f(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,u=c,console&&console.warn&&console.warn(u)}return e}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,a(this.listener,this.target,e))}.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):y(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var c=u.length,f=y(u,c);for(r=0;r<c;++r)a(f[r],this,t)}return!0},u.prototype.addListener=function(e,t){return l(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return l(this,e,t,!0)},u.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(t));return this.on(e,h(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(t));return this.prependListener(e,h(this,e,t)),this},u.prototype.removeListener=function(e,t){var r,i,o,a,s;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+n(t));if(void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,s||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},u.prototype.listeners=function(e){return d(this,e,!0)},u.prototype.rawListeners=function(e){return d(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},u.prototype.listenerCount=p,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(e,t,r){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}}:e.exports=t}).call(this,r(16))},function(e,t,r){"use strict";var n=r(249).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=a(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(2),i=r(259),o=r(29),a=r(3).Buffer,s=r(147),u=r(46),c=r(91),f=a.alloc(128);function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length<r&&(t=a.concat([t,f],r));for(var n=this._ipad=a.allocUnsafe(r),i=this._opad=a.allocUnsafe(r),s=0;s<r;s++)n[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new u:c(e),this._hash.update(n)}n(l,o),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new l("rmd160",t):"md5"===e?new i(s,t):new l(e,t)}},function(e,t,r){"use strict";var n=r(5),i=r(12),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;for(var a=[],u=0;u<n.length;u+=r.step){var c=0;for(t=u+r.step-1;t>=u;t--)c=(c<<1)+n[t];a.push(c)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=i;h>0;h--){for(u=0;u<a.length;u++){(c=a[u])===h?l=l.mixedAdd(r.points[u]):c===-h&&(l=l.mixedAdd(r.points[u].neg()))}f=f.add(l)}return f.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(t,r),u=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(t=0;c>=0&&0===a[c];c--)t++;if(c>=0&&t++,u=u.dblp(t),c<0)break;var f=a[c];s(0!==f),u="affine"===e.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){for(var s=this._wnafT1,u=this._wnafT2,c=this._wnafT3,f=0,l=0;l<n;l++){var h=(x=t[l])._getNAFPoints(e);s[l]=h.wnd,u[l]=h.points}for(l=n-1;l>=1;l-=2){var d=l-1,p=l;if(1===s[d]&&1===s[p]){var y=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(y[1]=t[d].add(t[p]),y[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(y[1]=t[d].toJ().mixedAdd(t[p]),y[2]=t[d].add(t[p].neg())):(y[1]=t[d].toJ().mixedAdd(t[p]),y[2]=t[d].toJ().mixedAdd(t[p].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],m=a(r[d],r[p]);f=Math.max(m[0].length,f),c[d]=new Array(f),c[p]=new Array(f);for(var g=0;g<f;g++){var v=0|m[0][g],_=0|m[1][g];c[d][g]=b[3*(v+1)+(_+1)],c[p][g]=0,u[d]=y}}else c[d]=o(r[d],s[d]),c[p]=o(r[p],s[p]),f=Math.max(c[d].length,f),f=Math.max(c[p].length,f)}var w=this.jpoint(null,null,null),S=this._wnafT4;for(l=f;l>=0;l--){for(var k=0;l>=0;){var E=!0;for(g=0;g<n;g++)S[g]=0|c[g][l],0!==S[g]&&(E=!1);if(!E)break;k++,l--}if(l>=0&&k++,w=w.dblp(k),l<0)break;for(g=0;g<n;g++){var x,A=S[g];0!==A&&(A>0?x=u[g][A-1>>1]:A<0&&(x=u[g][-A-1>>1].neg()),w="affine"===x.type?w.mixedAdd(x):w.add(x))}}for(l=0;l<n;l++)u[l]=null;return i?w:w.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(285);t.embed=n.p2data;var i=r(290);t.p2ms=i.p2ms;var o=r(291);t.p2pk=o.p2pk;var a=r(292);t.p2pkh=a.p2pkh;var s=r(293);t.p2sh=s.p2sh;var u=r(294);t.p2wpkh=u.p2wpkh;var c=r(295);t.p2wsh=c.p2wsh},function(e,t,r){"use strict";(function(e){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(49),o=r(49),a=r(26),s=r(4),u=r(4),c=r(25),f=r(8),l=r(156);function h(e){var t=e.length;return l.encodingLength(t)+t}var d=e.allocUnsafe(0),p=[],y=e.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),b=e.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),m=e.from("ffffffffffffffff","hex"),g={script:d,valueBuffer:m};var v=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.version=1,this.locktime=0,this.ins=[],this.outs=[]}var r,m,v;return r=t,v=[{key:"fromBuffer",value:function(e,r){var n=0;function o(t){return n+=t,e.slice(n-t,n)}function a(){var t=e.readUInt32LE(n);return n+=4,t}function s(){var t=i.readUInt64LE(e,n);return n+=8,t}function u(){var t=l.decode(e,n);return n+=l.decode.bytes,t}function c(){return o(u())}function f(){for(var e=u(),t=[],r=0;r<e;r++)t.push(c());return t}var h=new t;h.version=function(){var t=e.readInt32LE(n);return n+=4,t}();var d=e.readUInt8(n),y=e.readUInt8(n+1),b=!1;d===t.ADVANCED_TRANSACTION_MARKER&&y===t.ADVANCED_TRANSACTION_FLAG&&(n+=2,b=!0);for(var m=u(),g=0;g<m;++g)h.ins.push({hash:o(32),index:a(),script:c(),sequence:a(),witness:p});for(var v=u(),_=0;_<v;++_)h.outs.push({value:s(),script:c()});if(b){for(var w=0;w<m;++w)h.ins[w].witness=f();if(!h.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(h.locktime=a(),r)return h;if(n!==e.length)throw new Error("Transaction has unexpected data");return h}},{key:"fromHex",value:function(r){return t.fromBuffer(e.from(r,"hex"),!1)}},{key:"isCoinbaseHash",value:function(e){f(c.Hash256bit,e);for(var t=0;t<32;++t)if(0!==e[t])return!1;return!0}}],(m=[{key:"isCoinbase",value:function(){return 1===this.ins.length&&t.isCoinbaseHash(this.ins[0].hash)}},{key:"addInput",value:function(e,r,n,i){return f(c.tuple(c.Hash256bit,c.UInt32,c.maybe(c.UInt32),c.maybe(c.Buffer)),arguments),c.Null(n)&&(n=t.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:r,script:i||d,sequence:n,witness:p})-1}},{key:"addOutput",value:function(e,t){return f(c.tuple(c.Buffer,c.Satoshi),arguments),this.outs.push({script:e,value:t})-1}},{key:"hasWitnesses",value:function(){return this.ins.some(function(e){return 0!==e.witness.length})}},{key:"weight",value:function(){return 3*this.__byteLength(!1)+this.__byteLength(!0)}},{key:"virtualSize",value:function(){return Math.ceil(this.weight()/4)}},{key:"byteLength",value:function(){return this.__byteLength(!0)}},{key:"clone",value:function(){var e=new t;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map(function(e){return{hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}}),e.outs=this.outs.map(function(e){return{script:e.script,value:e.value}}),e}},{key:"hashForSignature",value:function(r,n,i){if(f(c.tuple(c.UInt32,c.Buffer,c.Number),arguments),r>=this.ins.length)return b;var o=s.compile(s.decompile(n).filter(function(e){return e!==u.OPS.OP_CODESEPARATOR})),l=this.clone();if((31&i)===t.SIGHASH_NONE)l.outs=[],l.ins.forEach(function(e,t){t!==r&&(e.sequence=0)});else if((31&i)===t.SIGHASH_SINGLE){if(r>=this.outs.length)return b;l.outs.length=r+1;for(var h=0;h<r;h++)l.outs[h]=g;l.ins.forEach(function(e,t){t!==r&&(e.sequence=0)})}i&t.SIGHASH_ANYONECANPAY?(l.ins=[l.ins[r]],l.ins[0].script=o):(l.ins.forEach(function(e){e.script=d}),l.ins[r].script=o);var p=e.allocUnsafe(l.__byteLength(!1)+4);return p.writeInt32LE(i,p.length-4),l.__toBuffer(p,0,!1),a.hash256(p)}},{key:"hashForWitnessV0",value:function(r,n,o,s){f(c.tuple(c.UInt32,c.Buffer,c.Satoshi,c.UInt32),arguments);var u=e.from([]),d=0;function p(e){d+=e.copy(u,d)}function b(e){d=u.writeUInt32LE(e,d)}function m(e){d=i.writeUInt64LE(u,e,d)}function g(e){l.encode(e,u,d),d+=l.encode.bytes}function v(e){g(e.length),p(e)}var _=y,w=y,S=y;if(s&t.SIGHASH_ANYONECANPAY||(u=e.allocUnsafe(36*this.ins.length),d=0,this.ins.forEach(function(e){p(e.hash),b(e.index)}),w=a.hash256(u)),s&t.SIGHASH_ANYONECANPAY||(31&s)===t.SIGHASH_SINGLE||(31&s)===t.SIGHASH_NONE||(u=e.allocUnsafe(4*this.ins.length),d=0,this.ins.forEach(function(e){b(e.sequence)}),S=a.hash256(u)),(31&s)!==t.SIGHASH_SINGLE&&(31&s)!==t.SIGHASH_NONE){var k=this.outs.reduce(function(e,t){return e+8+h(t.script)},0);u=e.allocUnsafe(k),d=0,this.outs.forEach(function(e){m(e.value),v(e.script)}),_=a.hash256(u)}else if((31&s)===t.SIGHASH_SINGLE&&r<this.outs.length){var E=this.outs[r];u=e.allocUnsafe(8+h(E.script)),d=0,m(E.value),v(E.script),_=a.hash256(u)}u=e.allocUnsafe(156+h(n)),d=0;var x=this.ins[r];return b(this.version),p(w),p(S),p(x.hash),b(x.index),v(n),m(o),b(x.sequence),p(_),b(this.locktime),b(s),a.hash256(u)}},{key:"getHash",value:function(t){return t&&this.isCoinbase()?e.alloc(32,0):a.hash256(this.__toBuffer(void 0,void 0,t))}},{key:"getId",value:function(){return o.reverseBuffer(this.getHash(!1)).toString("hex")}},{key:"toBuffer",value:function(e,t){return this.__toBuffer(e,t,!0)}},{key:"toHex",value:function(){return this.toBuffer(void 0,void 0).toString("hex")}},{key:"setInputScript",value:function(e,t){f(c.tuple(c.Number,c.Buffer),arguments),this.ins[e].script=t}},{key:"setWitness",value:function(e,t){f(c.tuple(c.Number,[c.Buffer]),arguments),this.ins[e].witness=t}},{key:"__byteLength",value:function(e){var t=e&&this.hasWitnesses();return(t?10:8)+l.encodingLength(this.ins.length)+l.encodingLength(this.outs.length)+this.ins.reduce(function(e,t){return e+40+h(t.script)},0)+this.outs.reduce(function(e,t){return e+8+h(t.script)},0)+(t?this.ins.reduce(function(e,t){return e+(r=t.witness,n=r.length,l.encodingLength(n)+r.reduce(function(e,t){return e+h(t)},0));var r,n},0):0)}},{key:"__toBuffer",value:function(r,n,o){r||(r=e.allocUnsafe(this.__byteLength(o)));var a,s=n||0;function u(e){s+=e.copy(r,s)}function c(e){s=r.writeUInt8(e,s)}function f(e){s=r.writeUInt32LE(e,s)}function h(e){l.encode(e,r,s),s+=l.encode.bytes}function d(e){h(e.length),u(e)}a=this.version,s=r.writeInt32LE(a,s);var p=o&&this.hasWitnesses();return p&&(c(t.ADVANCED_TRANSACTION_MARKER),c(t.ADVANCED_TRANSACTION_FLAG)),h(this.ins.length),this.ins.forEach(function(e){u(e.hash),f(e.index),d(e.script),f(e.sequence)}),h(this.outs.length),this.outs.forEach(function(e){void 0!==e.value?function(e){s=i.writeUInt64LE(r,e,s)}(e.value):u(e.valueBuffer),d(e.script)}),p&&this.ins.forEach(function(e){var t;h((t=e.witness).length),t.forEach(d)}),f(this.locktime),void 0!==n?r.slice(n,s):r}}])&&n(r.prototype,m),v&&n(r,v),t}();v.DEFAULT_SEQUENCE=4294967295,v.SIGHASH_ALL=1,v.SIGHASH_NONE=2,v.SIGHASH_SINGLE=3,v.SIGHASH_ANYONECANPAY=128,v.ADVANCED_TRANSACTION_MARKER=0,v.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=v}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=9007199254740991;function n(e){if(e<0||e>r||e%1!=0)throw new RangeError("value out of range")}function i(e){return n(e),e<253?1:e<=65535?3:e<=4294967295?5:9}t.encode=function t(r,o,a){if(n(r),o||(o=e.allocUnsafe(i(r))),!e.isBuffer(o))throw new TypeError("buffer must be a Buffer instance");return a||(a=0),r<253?(o.writeUInt8(r,a),Object.assign(t,{bytes:1})):r<=65535?(o.writeUInt8(253,a),o.writeUInt16LE(r,a+1),Object.assign(t,{bytes:3})):r<=4294967295?(o.writeUInt8(254,a),o.writeUInt32LE(r,a+1),Object.assign(t,{bytes:5})):(o.writeUInt8(255,a),o.writeUInt32LE(r>>>0,a+1),o.writeUInt32LE(r/4294967296|0,a+5),Object.assign(t,{bytes:9})),o},t.decode=function t(r,i){if(!e.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");i||(i=0);var o=r.readUInt8(i);if(o<253)return Object.assign(t,{bytes:1}),o;if(253===o)return Object.assign(t,{bytes:3}),r.readUInt16LE(i+1);if(254===o)return Object.assign(t,{bytes:5}),r.readUInt32LE(i+1);Object.assign(t,{bytes:9});var a=r.readUInt32LE(i+1),s=4294967296*r.readUInt32LE(i+5)+a;return n(s),s},t.encodingLength=i}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),r(105);const i=r(31),o=r(41),a=r(9),s=r(75),u=r(120),c=r(20),f=r(44),l=r(76),h="1.3.1";function d(t,r){const n=u.encryptECIES(t,r),i=JSON.stringify(n);return e.from(i).toString("hex")}t.generateTransitKey=function(){return o.makeECPrivateKey()},t.makeAuthRequest=function(e,t,r,u=f.DEFAULT_SCOPE.slice(),d,p=a.nextMonth().getTime(),y={}){return n(this,void 0,void 0,function*(){e||(e=yield(new l.UserSession).generateAndStoreTransitKey());const n=e=>a.getGlobalObject("location",{throwIfUnavailable:!0,usageDesc:`makeAuthRequest([${e}=undefined])`}).origin;t||(t=`${n("redirectURI")}/`),r||(r=`${n("manifestURI")}/manifest.json`),d||(d=n("appDomain"));const f=Object.assign({},y,{jti:a.makeUUID4(),iat:Math.floor((new Date).getTime()/1e3),exp:Math.floor(p/1e3),iss:null,public_keys:[],domain_name:d,manifest_uri:r,redirect_uri:t,version:h,do_not_include_profile:!0,supports_hub_url:!0,scopes:u});c.Logger.info(`blockstack.js: generating v${h} auth request`);const b=i.SECP256K1Client.derivePublicKey(e);f.public_keys=[b];const m=o.publicKeyToAddress(b);return f.iss=s.makeDIDFromAddress(m),new i.TokenSigner("ES256k",e).sign(f)})},t.encryptPrivateKey=d,t.decryptPrivateKey=function(t,r){const n=e.from(r,"hex").toString(),i=JSON.parse(n),o=u.decryptECIES(t,i);if("string"!=typeof o)throw new Error("Unable to correctly decrypt private key");return o},t.makeAuthResponse=function(e,t={},r=null,n,u=null,f=null,l=a.nextMonth().getTime(),p=null,y=null,b=null,m=null){const g=i.SECP256K1Client.derivePublicKey(e),v=o.publicKeyToAddress(g);let _=f,w=u,S={};null!=f?(c.Logger.info(`blockstack.js: generating v${h} auth response`),null!=p&&(_=d(p,f),null!=u&&(w=d(p,u))),S={email:n.email?n.email:null,profile_url:n.profileUrl?n.profileUrl:null,hubUrl:y,blockstackAPIUrl:b,associationToken:m,version:h}):c.Logger.info("blockstack.js: generating legacy auth response");const k=Object.assign({},{jti:a.makeUUID4(),iat:Math.floor((new Date).getTime()/1e3),exp:Math.floor(l/1e3),iss:s.makeDIDFromAddress(v),private_key:_,public_keys:[g],profile:t,username:r,core_token:w},S);return new i.TokenSigner("ES256k",e).sign(k)}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(3).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function o(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,n,i){for(var o,a,s,u,c=r[0],f=r[1],l=r[2],h=r[3],d=e[0]^t[0],p=e[1]^t[1],y=e[2]^t[2],b=e[3]^t[3],m=4,g=1;g<i;g++)o=c[d>>>24]^f[p>>>16&255]^l[y>>>8&255]^h[255&b]^t[m++],a=c[p>>>24]^f[y>>>16&255]^l[b>>>8&255]^h[255&d]^t[m++],s=c[y>>>24]^f[b>>>16&255]^l[d>>>8&255]^h[255&p]^t[m++],u=c[b>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&y]^t[m++],d=o,p=a,y=s,b=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&b])^t[m++],a=(n[p>>>24]<<24|n[y>>>16&255]<<16|n[b>>>8&255]<<8|n[255&d])^t[m++],s=(n[y>>>24]<<24|n[b>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^t[m++],u=(n[b>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^t[m++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var f=e[a],l=e[f],h=e[l],d=257*e[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o<t;o++)i[o]=e[o];for(o=t;o<n;o++){var a=i[o-1];o%t==0?(a=a<<8|a>>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-t]^a}for(var c=[],f=0;f<n;f++){var l=n-f,h=i[l-(f%4?0:4)];c[f]=f<4||l<=4?h:u.INV_SUB_MIX[0][u.SBOX[h>>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=c},function(e,t,r){var n=r(3).Buffer,i=r(85);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),c=n.alloc(0);a>0||o>0;){var f=new i;f.update(c),f.update(e),t&&f.update(t),c=f.digest();var l=0;if(a>0){var h=s.length-a;l=Math.min(a,c.length),c.copy(s,h,0,l),a-=l}if(l<c.length&&o>0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:s,iv:u}}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(363),o=r(374),a=r(375),s=r(110),u=r(108),c=r(3).Buffer;function f(e){var t;"object"!==n(e)||c.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=c.from(e));var r,f,l=a(e,t),h=l.tag,d=l.data;switch(h){case"CERTIFICATE":f=i.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=i.PublicKey.decode(d,"der")),r=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=i.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+h);case"ENCRYPTED PRIVATE KEY":d=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=o[e.algorithm.decrypt.cipher.algo.join(".")],a=e.algorithm.decrypt.cipher.iv,f=e.subjectPrivateKey,l=parseInt(i.split("-")[1],10)/8,h=u.pbkdf2Sync(t,r,n,l,"sha1"),d=s.createDecipheriv(i,h,a),p=[];return p.push(d.update(f)),p.push(d.final()),c.concat(p)}(d=i.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(r=(f=i.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:i.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=i.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+h);case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=i.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+h)}}e.exports=f,f.signature=i.signature},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,i.default)(t);r=String(r);if(!r)return e(t,4)||e(t,6);if("4"===r){if(!o.test(t))return!1;var n=t.split(".").sort(function(e,t){return e-t});return n[3]<=255}if("6"===r){var s=t.split(":"),u=!1,c=e(s[s.length-1],4),f=c?7:8;if(s.length>f)return!1;if("::"===t)return!0;"::"===t.substr(0,2)?(s.shift(),s.shift(),u=!0):"::"===t.substr(t.length-2)&&(s.pop(),s.pop(),u=!0);for(var l=0;l<s.length;++l)if(""===s[l]&&l>0&&l<s.length-1){if(u)return!1;u=!0}else if(c&&l===s.length-1);else if(!a.test(s[l]))return!1;return u?s.length>=1:s.length===f}return!1};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,a=/^[0-9A-F]{1,4}$/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.commaDecimal=t.dotDecimal=t.arabicLocales=t.englishLocales=t.decimal=t.alphanumeric=t.alpha=void 0;var n={"en-US":/^[A-Z]+$/i,"bg-BG":/^[А-Я]+$/i,"cs-CZ":/^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[A-ZÆØÅ]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"el-GR":/^[Α-ω]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[A-ZÀÉÈÌÎÓÒÙ]+$/i,"nb-NO":/^[A-ZÆØÅ]+$/i,"nl-NL":/^[A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[A-ZÆØÅ]+$/i,"hu-HU":/^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"pl-PL":/^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[А-ЯЁ]+$/i,"sl-SI":/^[A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[A-ZÅÄÖ]+$/i,"tr-TR":/^[A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[А-ЩЬЮЯЄIЇҐі]+$/i,"ku-IQ":/^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/};t.alpha=n;var i={"en-US":/^[0-9A-Z]+$/i,"bg-BG":/^[0-9А-Я]+$/i,"cs-CZ":/^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,"da-DK":/^[0-9A-ZÆØÅ]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"el-GR":/^[0-9Α-ω]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"it-IT":/^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,"hu-HU":/^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,"nb-NO":/^[0-9A-ZÆØÅ]+$/i,"nl-NL":/^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,"nn-NO":/^[0-9A-ZÆØÅ]+$/i,"pl-PL":/^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁ]+$/i,"sl-SI":/^[0-9A-ZČĆĐŠŽ]+$/i,"sk-SK":/^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,"sr-RS@latin":/^[0-9A-ZČĆŽŠĐ]+$/i,"sr-RS":/^[0-9А-ЯЂЈЉЊЋЏ]+$/i,"sv-SE":/^[0-9A-ZÅÄÖ]+$/i,"tr-TR":/^[0-9A-ZÇĞİıÖŞÜ]+$/i,"uk-UA":/^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,"ku-IQ":/^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,ar:/^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/};t.alphanumeric=i;var o={"en-US":".",ar:"٫"};t.decimal=o;var a=["AU","GB","HK","IN","NZ","ZA","ZM"];t.englishLocales=a;for(var s,u=0;u<a.length;u++)n[s="en-".concat(a[u])]=n["en-US"],i[s]=i["en-US"],o[s]=o["en-US"];var c=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];t.arabicLocales=c;for(var f,l=0;l<c.length;l++)n[f="ar-".concat(c[l])]=n.ar,i[f]=i.ar,o[f]=o.ar;var h=[];t.dotDecimal=h;var d=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","es-ES","fr-FR","it-IT","ku-IQ","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA"];t.commaDecimal=d;for(var p=0;p<h.length;p++)o[h[p]]=o["en-US"];for(var y=0;y<d.length;y++)o[d[y]]=",";n["pt-BR"]=n["pt-PT"],i["pt-BR"]=i["pt-PT"],o["pt-BR"]=o["pt-PT"],n["pl-Pl"]=n["pl-PL"],i["pl-Pl"]=i["pl-PL"],o["pl-Pl"]=o["pl-PL"]},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==n(t)&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+n(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});t.MissingParametersError=function(e){function t(e){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.name="MissingParametersError",r.message=e||"",r}return a(t,Error),t}(),t.InvalidTokenError=function(e){function t(e){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.name="InvalidTokenError",r.message=e||"",r}return a(t,Error),t}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(19);function i(e){const t=e.split(":");if(3!==t.length)throw new n.InvalidDIDError("Decentralized IDs must have 3 parts");if("did"!==t[0].toLowerCase())throw new n.InvalidDIDError('Decentralized IDs must start with "did"');return t[1].toLowerCase()}t.makeDIDFromAddress=function(e){return`did:btc-addr:${e}`},t.makeDIDFromPublicKey=function(e){return`did:ecdsa-pub:${e}`},t.getDIDType=i,t.getAddressFromDID=function(e){return"btc-addr"===i(e)?e.split(":")[2]:null}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(137),a=r(453),s=i(r(195)),u=i(r(68)),c=i(r(199)),f=r(9),l=r(19),h=r(20),d=r(200),p=r(44);t.UserSession=class{constructor(e){let t=!0;if("undefined"==typeof window&&"undefined"==typeof self&&(h.Logger.debug("UserSession: not running in browser"),t=!1),e&&e.appConfig)this.appConfig=e.appConfig;else{if(!t)throw new l.MissingParameterError("You need to specify options.appConfig");this.appConfig=new o.AppConfig}e&&e.sessionStore?this.store=e.sessionStore:this.store=t?e?new a.LocalStorageStore(e.sessionOptions):new a.LocalStorageStore:e?new a.InstanceDataStore(e.sessionOptions):new a.InstanceDataStore}redirectToSignIn(e,t,r){return n(this,void 0,void 0,function*(){const n=yield this.generateAndStoreTransitKey(),i=yield this.makeAuthRequest(n,e,t,r),o=this.appConfig&&this.appConfig.authenticatorURL;return s.redirectToSignInWithAuthRequest(i,o)})}redirectToSignInWithAuthRequest(e,t){return n(this,void 0,void 0,function*(){e=e||(yield this.makeAuthRequest());const r=t||this.appConfig&&this.appConfig.authenticatorURL;return s.redirectToSignInWithAuthRequest(e,r)})}makeAuthRequest(e,t,r,i,o,a=f.nextHour().getTime(),s={}){return n(this,void 0,void 0,function*(){const n=this.appConfig;if(!n)throw new l.InvalidStateError("Missing AppConfig");return e=e||(yield this.generateAndStoreTransitKey()),t=t||n.redirectURI(),r=r||n.manifestURI(),i=i||n.scopes,o=o||n.appDomain,u.makeAuthRequest(e,t,r,i,o,a,s)})}generateAndStoreTransitKey(){return n(this,void 0,void 0,function*(){const e=yield this.store.getSessionData(),t=u.generateTransitKey();return e.transitKey=t,yield this.store.setSessionData(e),t})}getAuthResponseToken(){return s.getAuthResponseToken()}isSignInPending(){return s.isSignInPending()}isUserSignedIn(){return this.store.getSessionData().then(e=>!!e.userData)}handlePendingSignIn(e=this.getAuthResponseToken()){return n(this,void 0,void 0,function*(){const t=yield this.store.getSessionData(),r=t.transitKey,n=t.coreNode;return s.handlePendingSignIn(n,e,r,this)})}loadUserData(){return n(this,void 0,void 0,function*(){const e=yield this.store.getSessionData().then(e=>e.userData);if(!e)throw new l.InvalidStateError("No user data found. Did the user sign in?");return e})}signUserOut(e){s.signUserOut(e,this)}encryptContent(e,t){return c.encryptContent(e,t,this)}decryptContent(e,t){return c.decryptContent(e,t,this)}putFile(e,t,r){return c.putFile(e,t,r,this)}getFile(e,t){return c.getFile(e,t,this)}getFileUrl(e,t){return c.getFileUrl(e,t,this)}listFiles(e){return c.listFiles(e,this)}deleteFile(e,t){return c.deleteFile(e,t,this)}getOrSetLocalGaiaHubConnection(){return n(this,void 0,void 0,function*(){const e=(yield this.store.getSessionData()).userData;if(!e)throw new l.InvalidStateError("Missing userData");const t=e.gaiaHubConfig;return t?Promise.resolve(t):this.setLocalGaiaHubConnection()})}setLocalGaiaHubConnection(){return n(this,void 0,void 0,function*(){const e=yield this.loadUserData();if(!e)throw new l.InvalidStateError("Missing userData");e.hubUrl||(e.hubUrl=p.BLOCKSTACK_DEFAULT_GAIA_HUB_URL);const t=yield d.connectToGaiaHub(e.hubUrl,e.appPrivateKey,e.gaiaAssociationToken);e.gaiaHubConfig=t;const r=yield this.store.getSessionData();return r.userData.gaiaHubConfig=t,this.store.setSessionData(r).then(e=>t)})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(202),i=r(32),o=r(121),a=r(20),s=r(17);function u(e){if(!e.hasOwnProperty("uri"))return null;if(!Array.isArray(e.uri))return null;if(e.uri.length<1)return null;const t=e.uri[0];if(!t.hasOwnProperty("target"))return null;let r=t.target;return r.startsWith("https")||r.startsWith("http")||(r=`https://${r}`),r}t.makeProfileZoneFile=function(e,t){if(t.indexOf("://")<0)throw new Error("Invalid token file url");const r=t.split("://")[0],i=t.split("://")[1].split("/"),o={$origin:e,$ttl:3600,uri:[{name:"_http._tcp",priority:10,weight:1,target:`${r}://${i[0]}${`/${i.slice(1).join("/")}`}`}]};return n.makeZoneFile(o,"{$origin}\n{$ttl}\n{uri}\n")},t.getTokenFileUrl=u,t.resolveZoneFileToProfile=function(e,t){return new Promise((r,c)=>{let f=null;try{(f=n.parseZoneFile(e)).hasOwnProperty("$origin")||(f=null)}catch(e){c(e)}let l=null;if(f&&Object.keys(f).length>0)(l=u(f))?s.fetchPrivate(l).then(e=>e.text()).then(e=>JSON.parse(e)).then(e=>{const n=e,o=i.extractProfile(n[0].token,t);r(o)}).catch(e=>{a.Logger.error(`resolveZoneFileToProfile: error fetching token file ${l}: ${e}`),c(e)}):(a.Logger.debug("Token file url not found. Resolving to blank profile."),r({}));else{let t=null;try{t=JSON.parse(e),t=o.Person.fromLegacyFormat(t).profile()}catch(e){c(e)}r(t)}})}},function(e,t,r){e.exports=r(461)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(78)),o=r(32),a=r(205),s=r(77),u={type:"object",properties:{"@context":{type:"string",optional:!0},"@type":{type:"string"}}};class c{constructor(e={}){this._profile=Object.assign({},{"@context":"http://schema.org/"},e)}toJSON(){return Object.assign({},this._profile)}toToken(e){return o.signProfileToken(this.toJSON(),e)}static validateSchema(e,t=!1){return u.strict=t,i.default.validate(u,e)}static fromToken(e,t=null){const r=o.extractProfile(e,t);return new c(r)}static makeZoneFile(e,t){return s.makeProfileZoneFile(e,t)}static validateProofs(e){return a.validateProofs((new c).toJSON(),e)}}t.Profile=c},function(e,t,r){(function(n){var i=r(55);(t=e.exports=function(e,r){var n=t.evaluate(e,r),i=t.evaluate("<root></root>",r)[0];return i.type="root",t.update(n,i),i}).evaluate=function(e,t){return"string"==typeof e||n.isBuffer(e)?i.parseDOM(e,t):e},t.update=function(e,t){Array.isArray(e)||(e=[e]),t?t.children=e:t=null;for(var r=0;r<e.length;r++){var n=e[r],i=n.parent||n.root,o=i&&i.children;o&&o!==e&&(o.splice(o.indexOf(n),1),n.prev&&(n.prev.next=n.next),n.next&&(n.next.prev=n.prev)),t?(n.prev=e[r-1]||null,n.next=e[r+1]||null):n.prev=n.next=null,t&&"root"===t.type?(n.root=t,n.parent=null):(n.root=null,n.parent=t)}return t}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(28),i=r(469),o={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};var a={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},s=e.exports=function(e,t){Array.isArray(e)||e.cheerio||(e=[e]),t=t||{};for(var r="",i=0;i<e.length;i++){var o=e[i];"root"===o.type?r+=s(o.children,t):n.isTag(o)?r+=u(o,t):o.type===n.Directive?r+=c(o):o.type===n.Comment?r+=h(o):o.type===n.CDATA?r+=l(o):r+=f(o,t)}return r};function u(e,t){"svg"===e.name&&(t={decodeEntities:t.decodeEntities,xmlMode:!0});var r="<"+e.name,n=function(e,t){if(e){var r,n="";for(var o in e)n&&(n+=" "),n+=o,(null!==(r=e[o])&&""!==r||t.xmlMode)&&(n+='="'+(t.decodeEntities?i.encodeXML(r):r)+'"');return n}}(e.attribs,t);return n&&(r+=" "+n),!t.xmlMode||e.children&&0!==e.children.length?(r+=">",e.children&&(r+=s(e.children,t)),a[e.name]&&!t.xmlMode||(r+="</"+e.name+">")):r+="/>",r}function c(e){return"<"+e.data+">"}function f(e,t){var r=e.data||"";return!t.decodeEntities||e.parent&&e.parent.name in o||(r=i.encodeXML(r)),r}function l(e){return"<![CDATA["+e.children[0].data+"]]>"}function h(e){return"\x3c!--"+e.data+"--\x3e"}},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=9007199254740991,i="[object Arguments]",o="[object Function]",a="[object GeneratorFunction]",s=/^(?:0|[1-9]\d*)$/;function u(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););return e}var c,f,l=Object.prototype,h=l.hasOwnProperty,d=l.toString,p=l.propertyIsEnumerable,y=(c=Object.keys,f=Object,function(e){return c(f(e))});function b(e,t){var n=k(e)||function(e){return function(e){return function(e){return!!e&&"object"==r(e)}(e)&&E(e)}(e)&&h.call(e,"callee")&&(!p.call(e,"callee")||d.call(e)==i)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],o=n.length,a=!!o;for(var s in e)!t&&!h.call(e,s)||a&&("length"==s||S(s,o))||n.push(s);return n}var m,g,v=(m=function(e,t){return e&&_(e,t,x)},function(e,t){if(null==e)return e;if(!E(e))return m(e,t);for(var r=e.length,n=g?r:-1,i=Object(e);(g?n--:++n<r)&&!1!==t(i[n],n,i););return e}),_=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===r(o[u],u,o))break}return t}}();function w(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||l,t!==n)return y(e);var t,r,n,i=[];for(var o in Object(e))h.call(e,o)&&"constructor"!=o&&i.push(o);return i}function S(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||s.test(e))&&e>-1&&e%1==0&&e<t}var k=Array.isArray;function E(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!function(e){var t=function(e){var t=r(e);return!!e&&("object"==t||"function"==t)}(e)?d.call(e):"";return t==o||t==a}(e)}function x(e){return E(e)?b(e):w(e)}function A(e){return e}e.exports=function(e,t){return(k(e)?u:v)(e,"function"==typeof t?t:A)}},function(e,t,r){(function(){var e,n,i,o,a,s,u,c={}.hasOwnProperty;u=r(11),o=r(7).WordArray,i=r(21).StreamCipher,n=function(){function e(e){var t,r;r=e.value,t=e.len,this._value=null!=r?r.clone():(null==t&&(t=2),new o(function(){var e,r;for(r=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)r.push(0);return r}()))}return e.prototype.WORD_MAX=4294967295,e.prototype.inc=function(){var t,r;for(t=!0,r=this._value.words.length-1;t&&r>=0;)++this._value.words[r]>e.WORD_MAX?this._value.words[r]=0:t=!1,r--;return this},e.prototype.inc_le=function(){var t,r;for(t=!0,r=0;t&&r<this._value.words.length;)++this._value.words[r]>e.WORD_MAX?this._value.words[r]=0:t=!1,r++;return this},e.prototype.get=function(){return this._value},e.prototype.copy=function(){return this._value.clone()},e}(),e=function(e){function t(e){if(this.block_cipher=e.block_cipher,this.iv=e.iv,t.__super__.constructor.call(this),this.bsiw=this.block_cipher.blockSize/4,this.iv.sigBytes!==this.block_cipher.blockSize)throw new Error("IV is wrong length ("+this.iv.sigBytes+")");this.ctr=new n({value:this.iv})}return function(e,t){for(var r in t)c.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,i),t.prototype.scrub=function(){return this.block_cipher.scrub()},t.prototype.get_pad=function(){var e;return e=this.ctr.copy(),this.ctr.inc(),this.block_cipher.encryptBlock(e.words),e},t}(),s=function(t){var r,n,i,o,a;return r=t.block_cipher,o=t.iv,i=t.input,a=(n=new e({block_cipher:r,iv:o})).encrypt(i),n.scrub(),a},a=function(t,r){var n,i,o,a,s,c,f,l,h;l=u.findDeferral(arguments),n=t.block_cipher,a=t.iv,o=t.input,s=t.progress_hook,f=t.what,i=new e({block_cipher:n,iv:a}),function(e){h=new u.Deferrals(e,{parent:l,filename:"/Users/max/src/keybase/triplesec/src/ctr.iced"}),i.bulk_encrypt({input:o,progress_hook:s,what:f},h.defer({assign_fn:function(){return c=arguments[0]},lineno:121})),h._fulfill()}(function(){return r(c)})},t.Counter=n,t.Cipher=e,t.encrypt=s,t.bulk_encrypt=a}).call(this)},function(e,t,r){(function(){var e,n,i,o,a,s,u,c,f,l={}.hasOwnProperty,h=function(e,t){for(var r in t)l.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};f=r(43),i=f.HMAC,c=f.bulk_sign,a=r(39).SHA512,o=r(133).SHA3,s=r(7).WordArray,e=function(){function e(){this.hasherBlockSize=this.hashers[0].hasherBlockSize,this.hasherBlockSizeBytes=4*this.hasherBlockSize,this.reset()}return e.prototype.reset=function(){var e,t,r;for(e=0,t=(r=this.hashers).length;e<t;e++)r[e].reset();return this},e.prototype.update=function(e){var t,r,n;for(t=0,r=(n=this.hashers).length;t<r;t++)n[t].update(e);return this},e.prototype.scrub=function(){var e,t,r;for(e=0,t=(r=this.hashers).length;e<t;e++)r[e].scrub();return this},e.prototype.finalize=function(e){var t,r,n,i,o,a;for(n=(r=function(){var r,n,i,o;for(o=[],r=0,n=(i=this.hashers).length;r<n;r++)t=i[r],o.push(t.finalize(e));return o}.call(this))[0],i=0,o=(a=r.slice(1)).length;i<o;i++)t=a[i],this._coalesce(n,t),t.scrub();return n},e}(),n=function(t){function r(e,t){var n,s,u,c,f;null==t&&(t=[a,o]),f=e.split(t.length),this.hashers=function(){var e,r,o;for(o=[],s=e=0,r=t.length;e<r;s=++e)u=t[s],c=f[s],n=new i(c,u),c.scrub(),o.push(n);return o}(),r.__super__.constructor.call(this)}return h(r,e),r.get_output_size=function(){return a.output_size+o.output_size},r.prototype._coalesce=function(e,t){return e.concat(t)},r.prototype.get_output_size=function(){var e,t,r,n;for(e=0,t=0,r=(n=this.hashers).length;t<r;t++)e+=n[t].get_output_size();return e},r.sign=function(e){var t,n;return n=e.key,t=e.input,new r(n).finalize(t)},r.bulk_sign=function(e,t){return e.klass=r,e.what="HMAC-SHA512-SHA3",c(e,t)},r}(),u=function(t){function r(e,t){var n;null==t&&(t=[a,o]),this.hashers=function(){var r,o,a;for(a=[],r=0,o=t.length;r<o;r++)n=t[r],a.push(new i(e,n));return a}(),r.__super__.constructor.call(this)}return h(r,e),r.prototype.reset=function(){var e,t,n,i;for(r.__super__.reset.call(this),e=t=0,n=(i=this.hashers).length;t<n;e=++t)i[e].update(new s([e]));return this},r.get_output_size=function(){return Math.max(a.output_size,o.output_size)},r.prototype._coalesce=function(e,t){return e.xor(t,{})},r.prototype.get_output_size=function(){var e;return Math.max.apply(Math,function(){var t,r,n,i;for(i=[],t=0,r=(n=this.hashers).length;t<r;t++)e=n[t],i.push(e.get_output_size());return i}.call(this))},r.sign=function(e){var t,n;return n=e.key,t=e.input,new r(n).finalize(t)},r.bulk_sign=function(e,t){return e.klass=r,e.what="HMAC-SHA512-XOR-SHA3",c(e,t)},r}(),t.Concat=n,t.XOR=u}).call(this)},function(e,t,r){"use strict";var n=r(2),i=r(140),o=r(3).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=f(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=l(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=h(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,r,n,i,e[7],1126891415,10),i=h(i,o,r,n,e[14],2878612391,15),n=h(n,i,o,r,e[5],4237533241,21),r=h(r,n,i,o,e[12],1700485571,6),o=h(o,r,n,i,e[3],2399980690,10),i=h(i,o,r,n,e[10],4293915773,15),n=h(n,i,o,r,e[1],2240044497,21),r=h(r,n,i,o,e[8],1873313359,6),o=h(o,r,n,i,e[15],4264355552,10),i=h(i,o,r,n,e[6],2734768916,15),n=h(n,i,o,r,e[13],1309151649,21),r=h(r,n,i,o,e[4],4149444226,6),o=h(o,r,n,i,e[11],3174756917,10),i=h(i,o,r,n,e[2],718787259,15),n=h(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){e.exports=i;var n=r(60).EventEmitter;function i(){n.call(this)}r(2)(i,n),i.Readable=r(87),i.Writable=r(251),i.Duplex=r(252),i.Transform=r(253),i.PassThrough=r(254),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t,r){(t=e.exports=r(141)).Stream=t,t.Readable=t,t.Writable=r(89),t.Duplex=r(33),t.Transform=r(144),t.PassThrough=r(250)},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t,n,i){var o=r(61);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=g;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;g.WritableState=m;var c=r(45);c.inherits=r(2);var f={deprecate:r(248)},l=r(142),h=r(88).Buffer,d=i.Uint8Array||function(){};var p,y=r(143);function b(){}function m(e,t){s=s||r(33),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),E(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(e,r),n?u(_,e,r,a,i):_(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function g(e){if(s=s||r(33),!(p.call(g,this)||this instanceof s))return new g(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),E(e,t)}function w(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,v(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(v(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)})}function E(e,t){var r=S(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(g,l),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):p=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,h.isBuffer(n)||n instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||w(this,e))},g.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(16),r(90).setImmediate,r(6))},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(247),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(6))},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(255),t.sha1=r(256),t.sha224=r(257),t.sha256=r(145),t.sha384=r(258),t.sha512=r(146)},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i;function o(e){this.rand=e}if(e.exports=function(e){return i||(i=new o(null)),i.generate(e)},e.exports.Rand=o,o.prototype.generate=function(e){return this._rand(e)},o.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"===("undefined"==typeof self?"undefined":n(self)))self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"===("undefined"==typeof window?"undefined":n(window))&&(o.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=r(265);if("function"!=typeof a.randomBytes)throw new Error("Not supported");o.prototype._rand=function(e){return a.randomBytes(e)}}catch(e){}},function(e,t,r){"use strict";var n,i=t,o=r(94),a=r(149),s=r(12).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,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:o.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:o.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:o.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:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),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:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(275)}catch(e){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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(18),n.common=r(48),n.sha=r(269),n.ripemd=r(273),n.hmac=r(274),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n={Array:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){return null!=e&&e.constructor===Array}),Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"===r(e)},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var i in n.Null=n.Nil,n)n[i].toJSON=function(e){return e}.bind(null,i);e.exports=n},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),i=r(65),o=r(4),a=r(25),s=r(98),u=r(47),c=r(8);function f(e){var t=u.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function l(t){var r=s.decode(t),n=s.fromWords(r.words.slice(1));return{version:r.words[0],prefix:r.prefix,data:e.from(n)}}t.fromBase58Check=f,t.fromBech32=l,t.toBase58Check=function(t,r){c(a.tuple(a.Hash160bit,a.UInt8),arguments);var n=e.allocUnsafe(21);return n.writeUInt8(r,0),t.copy(n,1),u.encode(n)},t.toBech32=function(e,t,r){var n=s.toWords(e);return n.unshift(t),s.encode(r,n)},t.fromOutputScript=function(e,t){t=t||n.bitcoin;try{return i.p2pkh({output:e,network:t}).address}catch(e){}try{return i.p2sh({output:e,network:t}).address}catch(e){}try{return i.p2wpkh({output:e,network:t}).address}catch(e){}try{return i.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(o.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){var r,o;t=t||n.bitcoin;try{r=f(e)}catch(e){}if(r){if(r.version===t.pubKeyHash)return i.p2pkh({hash:r.hash}).output;if(r.version===t.scriptHash)return i.p2sh({hash:r.hash}).output}else{try{o=l(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return i.p2wpkh({hash:o.data}).output;if(32===o.data.length)return i.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}).call(this,r(0).Buffer)},function(e){e.exports=JSON.parse('{"OP_FALSE":0,"OP_0":0,"OP_PUSHDATA1":76,"OP_PUSHDATA2":77,"OP_PUSHDATA4":78,"OP_1NEGATE":79,"OP_RESERVED":80,"OP_TRUE":81,"OP_1":81,"OP_2":82,"OP_3":83,"OP_4":84,"OP_5":85,"OP_6":86,"OP_7":87,"OP_8":88,"OP_9":89,"OP_10":90,"OP_11":91,"OP_12":92,"OP_13":93,"OP_14":94,"OP_15":95,"OP_16":96,"OP_NOP":97,"OP_VER":98,"OP_IF":99,"OP_NOTIF":100,"OP_VERIF":101,"OP_VERNOTIF":102,"OP_ELSE":103,"OP_ENDIF":104,"OP_VERIFY":105,"OP_RETURN":106,"OP_TOALTSTACK":107,"OP_FROMALTSTACK":108,"OP_2DROP":109,"OP_2DUP":110,"OP_3DUP":111,"OP_2OVER":112,"OP_2ROT":113,"OP_2SWAP":114,"OP_IFDUP":115,"OP_DEPTH":116,"OP_DROP":117,"OP_DUP":118,"OP_NIP":119,"OP_OVER":120,"OP_PICK":121,"OP_ROLL":122,"OP_ROT":123,"OP_SWAP":124,"OP_TUCK":125,"OP_CAT":126,"OP_SUBSTR":127,"OP_LEFT":128,"OP_RIGHT":129,"OP_SIZE":130,"OP_INVERT":131,"OP_AND":132,"OP_OR":133,"OP_XOR":134,"OP_EQUAL":135,"OP_EQUALVERIFY":136,"OP_RESERVED1":137,"OP_RESERVED2":138,"OP_1ADD":139,"OP_1SUB":140,"OP_2MUL":141,"OP_2DIV":142,"OP_NEGATE":143,"OP_ABS":144,"OP_NOT":145,"OP_0NOTEQUAL":146,"OP_ADD":147,"OP_SUB":148,"OP_MUL":149,"OP_DIV":150,"OP_MOD":151,"OP_LSHIFT":152,"OP_RSHIFT":153,"OP_BOOLAND":154,"OP_BOOLOR":155,"OP_NUMEQUAL":156,"OP_NUMEQUALVERIFY":157,"OP_NUMNOTEQUAL":158,"OP_LESSTHAN":159,"OP_GREATERTHAN":160,"OP_LESSTHANOREQUAL":161,"OP_GREATERTHANOREQUAL":162,"OP_MIN":163,"OP_MAX":164,"OP_WITHIN":165,"OP_RIPEMD160":166,"OP_SHA1":167,"OP_SHA256":168,"OP_HASH160":169,"OP_HASH256":170,"OP_CODESEPARATOR":171,"OP_CHECKSIG":172,"OP_CHECKSIGVERIFY":173,"OP_CHECKMULTISIG":174,"OP_CHECKMULTISIGVERIFY":175,"OP_NOP1":176,"OP_NOP2":177,"OP_CHECKLOCKTIMEVERIFY":177,"OP_NOP3":178,"OP_CHECKSEQUENCEVERIFY":178,"OP_NOP4":179,"OP_NOP5":180,"OP_NOP6":181,"OP_NOP7":182,"OP_NOP8":183,"OP_NOP9":184,"OP_NOP10":185,"OP_PUBKEYHASH":253,"OP_PUBKEY":254,"OP_INVALIDOPCODE":255}')},function(e,t,r){"use strict";for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},o=0;o<n.length;o++){var a=n.charAt(o);if(void 0!==i[a])throw new TypeError(a+" is ambiguous");i[a]=o}function s(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function u(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)throw new Error("Invalid prefix ("+e+")");t=s(t)^n>>5}for(t=s(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=s(t)^31&i}return t}function c(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)throw new Error("Excess padding");if(i<<r-o&a)throw new Error("Non-zero padding")}return s}e.exports={decode:function(e,t){if(t=t||90,e.length<8)throw new TypeError(e+" too short");if(e.length>t)throw new TypeError("Exceeds length limit");var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)throw new Error("Mixed-case string "+e);var o=(e=r).lastIndexOf("1");if(-1===o)throw new Error("No separator character for "+e);if(0===o)throw new Error("Missing prefix for "+e);var a=e.slice(0,o),c=e.slice(o+1);if(c.length<6)throw new Error("Data too short");for(var f=u(a),l=[],h=0;h<c.length;++h){var d=c.charAt(h),p=i[d];if(void 0===p)throw new Error("Unknown character "+d);f=s(f)^p,h+6>=c.length||l.push(p)}if(1!==f)throw new Error("Invalid checksum for "+e);return{prefix:a,words:l}},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");for(var i=u(e=e.toLowerCase()),o=e+"1",a=0;a<t.length;++a){var c=t[a];if(c>>5!=0)throw new Error("Non 5-bit word");i=s(i)^c,o+=n.charAt(c)}for(a=0;a<6;++a)i=s(i);for(i^=1,a=0;a<6;++a){var f=i>>5*(5-a)&31;o+=n.charAt(f)}return o},toWords:function(e){return c(e,8,5,!0)},fromWords:function(e){return c(e,5,8,!1)}}},function(e,t,r){"use strict";(function(e){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(13),o=r(25),a=r(34),s=r(30),u=r(8),c=r(154),f=u.maybe(u.compile({compressed:o.maybe(o.Boolean),network:o.maybe(o.Network)})),l=function(){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.__D=e,this.__Q=r,this.lowR=!1,void 0===n&&(n={}),this.compressed=void 0===n.compressed||n.compressed,this.network=n.network||i.bitcoin,void 0!==r&&(this.__Q=a.pointCompress(r,this.compressed))}var r,o,s;return r=t,(o=[{key:"toWIF",value:function(){if(!this.__D)throw new Error("Missing private key");return c.encode(this.network.wif,this.__D,this.compressed)}},{key:"sign",value:function(t,r){if(!this.__D)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return a.sign(t,this.__D);for(var n=a.sign(t,this.__D),i=e.alloc(32,0),o=0;n[0]>127;)o++,i.writeUIntLE(o,0,6),n=a.signWithEntropy(t,this.__D,i);return n}},{key:"verify",value:function(e,t){return a.verify(e,this.publicKey,t)}},{key:"privateKey",get:function(){return this.__D}},{key:"publicKey",get:function(){return this.__Q||(this.__Q=a.pointFromScalar(this.__D,this.compressed)),this.__Q}}])&&n(r.prototype,o),s&&n(r,s),t}();function h(e,t){if(u(o.Buffer256bit,e),!a.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return u(f,t),new l(e,void 0,t)}t.fromPrivateKey=h,t.fromPublicKey=function(e,t){return u(a.isPoint,e),u(f,t),new l(void 0,e,t)},t.fromWIF=function(e,t){var r=c.decode(e),n=r.version;if(o.Array(t)){if(!(t=t.filter(function(e){return n===e.wif}).pop()))throw new Error("Unknown network version")}else if(t=t||i.bitcoin,n!==t.wif)throw new Error("Invalid network version");return h(r.privateKey,{compressed:r.compressed,network:t})},t.makeRandom=function(e){u(f,e),void 0===e&&(e={});var t,r=e.rng||s;do{t=r(32),u(o.Buffer256bit,t)}while(!a.isPrivate(t));return h(t,e)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),i=r(302),o=r(303),a=r(304),s=r(305),u=r(306),c=r(307),f=r(308),l=r(309),h=r(310),d=r(311),p=r(312),y=r(313),b=r(314),m={unsignedTx:o,globalXpub:i,checkPubkey:p.makeChecker([])};t.globals=m;var g={nonWitnessUtxo:u,partialSig:c,sighashType:l,finalScriptSig:a,finalScriptWitness:s,porCommitment:f,witnessUtxo:h,bip32Derivation:d.makeConverter(n.InputTypes.BIP32_DERIVATION),redeemScript:y.makeConverter(n.InputTypes.REDEEM_SCRIPT),witnessScript:b.makeConverter(n.InputTypes.WITNESS_SCRIPT),checkPubkey:p.makeChecker([n.InputTypes.PARTIAL_SIG,n.InputTypes.BIP32_DERIVATION])};t.inputs=g;var v={bip32Derivation:d.makeConverter(n.OutputTypes.BIP32_DERIVATION),redeemScript:y.makeConverter(n.OutputTypes.REDEEM_SCRIPT),witnessScript:b.makeConverter(n.OutputTypes.WITNESS_SCRIPT),checkPubkey:p.makeChecker([n.OutputTypes.BIP32_DERIVATION])};t.outputs=v},function(e,t,r){"use strict";(function(e){function n(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(t,"__esModule",{value:!0});var i=r(67);function o(t){var r=t.key.length,n=t.value.length,o=i.encodingLength(r),a=i.encodingLength(n),s=e.allocUnsafe(o+r+a+n);return i.encode(r,s,0),t.key.copy(s,o),i.encode(n,s,o+r),t.value.copy(s,o+r+a),s}function a(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}t.range=function(e){return n(Array(e).keys())},t.reverseBuffer=function(e){if(e.length<1)return e;for(var t=e.length-1,r=0,n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.keyValsToBuffer=function(t){var r=t.map(function(e){return o(e)});return r.push(e.from([0])),e.concat(r)},t.keyValToBuffer=o,t.readUInt64LE=function(e,t){var r=e.readUInt32LE(t),n=e.readUInt32LE(t+4);return a((n*=4294967296)+r,9007199254740991),n+r},t.writeUInt64LE=function(e,t,r){return a(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(318);t.input=n;var i=r(319);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(321);t.input=n;var i=r(322);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(323);t.input=n;var i=r(324);t.output=i},function(e,t){!function(e){if(!e.fetch){var t={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=function(e){return e&&DataView.prototype.isPrototypeOf(e)},i=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};f.prototype.append=function(e,t){e=s(e),t=u(t);var r=this.map[e];this.map[e]=r?r+","+t:t},f.prototype.delete=function(e){delete this.map[s(e)]},f.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},f.prototype.set=function(e,t){this.map[s(e)]=u(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),c(e)},f.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),c(e)},f.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),c(e)},t.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);var o=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},y.call(b.prototype),y.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var a=[301,302,303,307,308];g.redirect=function(e,t){if(-1===a.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},e.Headers=f,e.Request=b,e.Response=g,e.fetch=function(e,r){return new Promise(function(n,i){var o=new b(e,r),a=new XMLHttpRequest;a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new g(i,r))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function f(e){this.map={},e instanceof f?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function d(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(t.arrayBuffer&&t.blob&&n(e))this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!t.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!i(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=p(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,n=l(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),o.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}}("undefined"!=typeof self?self:this)},function(e,t,r){e.exports=r(336).default,e.exports.default=e.exports},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cryptoClients=t.SECP256K1Client=void 0;var n=r(338),i={ES256K:n.SECP256K1Client};t.SECP256K1Client=n.SECP256K1Client,t.cryptoClients=i},function(e,t,r){t.pbkdf2=r(340),t.pbkdf2Sync=r(165)},function(e,t,r){"use strict";t.utils=r(343),t.Cipher=r(344),t.DES=r(345),t.CBC=r(346),t.EDE=r(347)},function(e,t,r){var n=r(348),i=r(356),o=r(168);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){var n={ECB:r(349),CBC:r(350),CFB:r(351),CFB8:r(352),CFB1:r(353),OFB:r(354),CTR:r(166),GCM:r(166)},i=r(168);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){(function(t){var n=r(5),i=r(30);function o(e,r){var i=function(e){var t=a(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),o=r.modulus.byteLength(),s=(n.mont(r.modulus),new n(e).mul(i.blinder).umod(r.modulus)),u=s.toRed(n.mont(r.prime1)),c=s.toRed(n.mont(r.prime2)),f=r.coefficient,l=r.prime1,h=r.prime2,d=u.redPow(r.exponent1),p=c.redPow(r.exponent2);d=d.fromRed(),p=p.fromRed();var y=d.isub(p).imul(f).umod(l);return y.imul(h),p.iadd(y),new t(p.imul(i.unblinder).umod(r.modulus).toArray(!1,o))}function a(e){for(var t=e.modulus.byteLength(),r=new n(i(t));r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=o,o.getr=a}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(114).Reporter,o=r(53).EncoderBuffer,a=r(53).DecoderBuffer,s=r(10),u=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(u);function f(e,t,r){var n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=f;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){var e=this._baseState,t={};l.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},f.prototype._wrap=function(){var e=this._baseState;c.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},f.prototype._init=function(e){var t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),s.equal(t.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!==n(e)||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);var n=e[r];t[n]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){f.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),u.forEach(function(e){f.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}}),f.prototype.use=function(e){s(e);var t=this._baseState;return s(null===t.use),t.use=e,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(e){var t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},f.prototype.explicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},f.prototype.implicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},f.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},f.prototype.key=function(e){var t=this._baseState;return s(null===t.key),t.key=e,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(e){var t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},f.prototype.contains=function(e){var t=this._baseState;return s(null===t.use),t.contains=e,this},f.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var n,i=r.default,o=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){var u=null;if(null!==r.explicit?u=r.explicit:null!==r.implicit?u=r.implicit:null!==r.tag&&(u=r.tag),null!==u||r.any){if(o=this._peekTag(e,u,r.any),e.isError(o))return o}else{var c=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(c)}}if(r.obj&&o&&(n=e.enterObject()),o){if(null!==r.explicit){var f=this._decodeTag(e,r.explicit);if(e.isError(f))return f;e=f}var l=e.offset;if(null===r.use&&null===r.choice){var h;r.any&&(h=e.save());var d=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(d))return d;r.any?i=e.raw(h):e=d}if(t&&t.track&&null!==r.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var p=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(p,t)}}return r.obj&&o&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==o?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},f.prototype._decodeGeneric=function(e,t,r){var n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},f.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(e,t){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some(function(o){var a=e.save(),s=r.choice[o];try{var u=s._decode(e,t);if(e.isError(u))return!1;n={type:o,value:u},i=!0}catch(t){return e.restore(a),!1}return!0},this),i?n:e.error("Choice not matched")},f.prototype._createEncoderBuffer=function(e){return new o(e,this.reporter)},f.prototype._encode=function(e,t,r){var n=this._baseState;if(null===n.default||n.default!==e){var i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},f.prototype._encodeValue=function(e,t,r){var o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new i);var a=null;if(this.reporter=t,o.optional&&void 0===e){if(null===o.default)return;e=o.default}var s=null,u=!1;if(o.any)a=this._createEncoderBuffer(e);else if(o.choice)a=this._encodeChoice(e,t);else if(o.contains)s=this._getUse(o.contains,r)._encode(e,t),u=!0;else if(o.children)s=o.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if("object"!==n(e))return t.error("Child expected, but input is not object");var o=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),o},this).filter(function(e){return e}),s=this._createEncoderBuffer(s);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return t.error("Too many args for : "+o.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var c=this.clone();c._baseState.implicit=null,s=this._createEncoderBuffer(e.map(function(r){var n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)},c))}else null!==o.use?a=this._getUse(o.use,r)._encode(e,t):(s=this._encodePrimitive(o.tag,e),u=!0);if(!o.any&&null===o.choice){var f=null!==o.implicit?o.implicit:o.tag,l=null===o.implicit?"universal":"context";null===f?null===o.use&&t.error("Tag could be omitted only for .use()"):null===o.use&&(a=this._encodeComposite(f,u,l,s))}return null!==o.explicit&&(a=this._encodeComposite(o.explicit,!1,"context",a)),a},f.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},f.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},f.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},f.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-.\/:=?]*$/.test(e)}},function(e,t,r){"use strict";var n=r(2);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){var n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){var t,r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,r){"use strict";function n(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r}),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n(t.tag)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e=Date.parse(e),isNaN(e)?null:new Date(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){"object"===i(e)&&null!==e?e="function"==typeof e.toString?e.toString():"[object Object]":(null==e||isNaN(e)&&!e.length)&&(e="");return String(e)},e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),(t=(0,i.default)(t,a)).allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));for(var r=e.split("."),o=0;o<r.length;o++)if(r[o].length>63)return!1;if(t.require_tld){var s=r.pop();if(!r.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(s))return!1;if(/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20]/.test(s))return!1}for(var u,c=0;c<r.length;c++){if(u=r[c],t.allow_underscores&&(u=u.replace(/_/g,"")),!/^[a-z\u00a1-\uffff0-9-]+$/i.test(u))return!1;if(/[\uff01-\uff5e]/.test(u))return!1;if("-"===u[0]||"-"===u[u.length-1])return!1}return!0};var n=o(r(1)),i=o(r(38));function o(e){return e&&e.__esModule?e:{default:e}}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){return e.some(function(e){return t===e})};t.default=n,e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(35),o=n(r(37)),a=r(41),s=new i.ec("secp256k1");function u(e,t){return o.default.createHmac("sha256",e).update(t).digest()}function c(e){const t=o.default.createHash("sha512").update(e).digest();return{encryptionKey:t.slice(0,32),hmacKey:t.slice(32)}}function f(e){const t=e.toString("hex");if(64===t.length)return t;if(t.length<64){return`${"0".repeat(64-t.length)}${t}`}throw new Error("Generated a > 32-byte BN for encryption. Failing.")}t.getHexFromBN=f,t.encryptECIES=function(t,r){const n="string"==typeof r,i=e.from(r),a=s.keyFromPublic(t,"hex").getPublic(),l=s.genKeyPair(),h=l.getPublic(),d=f(l.derive(a)),p=c(e.from(d,"hex")),y=o.default.randomBytes(16),b=function(t,r,n){const i=o.default.createCipheriv("aes-256-cbc",r,t);return e.concat([i.update(n),i.final()])}(y,p.encryptionKey,i),m=e.concat([y,e.from(h.encodeCompressed("array")),b]),g=u(p.hmacKey,m);return{iv:y.toString("hex"),ephemeralPK:h.encodeCompressed("hex"),cipherText:b.toString("hex"),mac:g.toString("hex"),wasString:n}},t.decryptECIES=function(t,r){const n=s.keyFromPrivate(t,"hex"),i=s.keyFromPublic(r.ephemeralPK,"hex").getPublic(),a=n.derive(i),l=c(e.from(f(a),"hex")),h=e.from(r.iv,"hex"),d=e.from(r.cipherText,"hex"),p=e.concat([h,e.from(i.encodeCompressed("array")),d]),y=u(l.hmacKey,p);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(e.from(r.mac,"hex"),y))throw new Error("Decryption failed: failure in MAC check");const b=function(t,r,n){const i=o.default.createDecipheriv("aes-256-cbc",r,t);return e.concat([i.update(n),i.final()])}(h,l.encryptionKey,d);return r.wasString?b.toString():b},t.signECDSA=function(t,r){const n=r instanceof e?r:e.from(r),i=s.keyFromPrivate(t,"hex"),u=a.getPublicKeyFromPrivate(t),c=o.default.createHash("sha256").update(n).digest();return{signature:i.sign(c).toDER("hex"),publicKey:u}},t.verifyECDSA=function(t,r,n){const i=function(t){return t instanceof e?t:(ArrayBuffer,e.from(t))}(t),a=s.keyFromPublic(r,"hex"),u=o.default.createHash("sha256").update(i).digest();return a.verify(u,n)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(78)),o=r(79),a=r(32),s=r(220),u=r(513),c={type:"object",strict:!1,properties:{"@context":{type:"string",optional:!0},"@type":{type:"string"},"@id":{type:"string",optional:!0},name:{type:"string",optional:!0},givenName:{type:"string",optional:!0},familyName:{type:"string",optional:!0},description:{type:"string",optional:!0},image:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},name:{type:"string",optional:!0},contentUrl:{type:"string",optional:!0}}}},website:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},url:{type:"string",optional:!0}}}},account:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},service:{type:"string",optional:!0},identifier:{type:"string",optional:!0},proofType:{type:"string",optional:!0},proofUrl:{type:"string",optional:!0},proofMessage:{type:"string",optional:!0},proofSignature:{type:"string",optional:!0}}}},worksFor:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},"@id":{type:"string",optional:!0}}}},knows:{type:"array",optional:!0,items:{type:"object",properties:{"@type":{type:"string"},"@id":{type:"string",optional:!0}}}},address:{type:"object",optional:!0,properties:{"@type":{type:"string"},streetAddress:{type:"string",optional:!0},addressLocality:{type:"string",optional:!0},postalCode:{type:"string",optional:!0},addressCountry:{type:"string",optional:!0}}},birthDate:{type:"string",optional:!0},taxID:{type:"string",optional:!0}}};class f extends o.Profile{constructor(e={}){super(e),this._profile=Object.assign({},{"@type":"Person"},this._profile)}static validateSchema(e,t=!1){return c.strict=t,i.default.validate(c,e)}static fromToken(e,t=null){const r=a.extractProfile(e,t);return new f(r)}static fromLegacyFormat(e){const t=s.getPersonFromLegacyFormat(e);return new f(t)}toJSON(){return{profile:this.profile(),name:this.name(),givenName:this.givenName(),familyName:this.familyName(),description:this.description(),avatarUrl:this.avatarUrl(),verifiedAccounts:this.verifiedAccounts(),address:this.address(),birthDate:this.birthDate(),connections:this.connections(),organizations:this.organizations()}}profile(){return Object.assign({},this._profile)}name(){return u.getName(this.profile())}givenName(){return u.getGivenName(this.profile())}familyName(){return u.getFamilyName(this.profile())}description(){return u.getDescription(this.profile())}avatarUrl(){return u.getAvatarUrl(this.profile())}verifiedAccounts(e){return u.getVerifiedAccounts(this.profile(),e)}address(){return u.getAddress(this.profile())}birthDate(){return u.getBirthDate(this.profile())}connections(){return u.getConnections(this.profile())}organizations(){return u.getOrganizations(this.profile())}}t.Person=f},function(e,t,r){var n=r(80),i=r(56).isHtml,o={extend:r(214),bind:r(125),forEach:r(82),defaults:r(215)},a=[r(481),r(497),r(501),r(503),r(505)],s=e.exports=function(e,t,r,a){return this instanceof s?(this.options=o.defaults(a||{},this.options),e?(r&&("string"==typeof r&&(r=n(r,this.options)),this._root=s.call(this,r)),e.cheerio?e:(u(e)&&(e=[e]),Array.isArray(e)?(o.forEach(e,o.bind(function(e,t){this[t]=e},this)),this.length=e.length,this):"string"==typeof e&&i(e)?s.call(this,n(e,this.options).children):(t?"string"==typeof t?i(t)?(t=n(t,this.options),t=s.call(this,t)):(e=[t,e].join(" "),t=this._root):t.cheerio||(t=s.call(this,t)):t=this._root,t?t.find(e):this))):this):new s(e,t,r,a)};o.extend(s,r(126)),s.prototype.cheerio="[cheerio object]",s.prototype.options={withDomLvl1:!0,normalizeWhitespace:!1,xmlMode:!1,decodeEntities:!0},s.prototype.length=0,s.prototype.splice=Array.prototype.splice,s.prototype._make=function(e,t){var r=new this.constructor(e,t,this._root,this.options);return r.prevObject=this,r},s.prototype.toArray=function(){return this.get()},a.forEach(function(e){o.extend(s.prototype,e)});var u=function(e){return e.name||"text"===e.type||"comment"===e.type}},function(e){e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},function(e){e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')},function(e,t,r){(function(t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n="Expected a function",i="__lodash_placeholder__",o=1,a=2,s=4,u=8,c=16,f=32,l=64,h=128,d=512,p=1/0,y=9007199254740991,b=17976931348623157e292,m=NaN,g=[["ary",h],["bind",o],["bindKey",a],["curry",u],["curryRight",c],["flip",d],["partial",f],["partialRight",l],["rearg",256]],v="[object Function]",_="[object GeneratorFunction]",w="[object Symbol]",S=/^\s+|\s+$/g,k=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,E=/\{\n\/\* \[wrapped with (.+)\] \*/,x=/,? & /,A=/^[-+]0x[0-9a-f]+$/i,O=/^0b[01]+$/i,P=/^\[object .+?Constructor\]$/,T=/^0o[0-7]+$/i,I=/^(?:0|[1-9]\d*)$/,j=parseInt,M="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t,B="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,N=M||B||Function("return this")();function C(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function D(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,n){var i=e.length,o=r+(n?1:-1);for(;n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}(e,U,r);var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,0)>-1}function U(e){return e!=e}function R(e,t){for(var r=-1,n=e.length,o=0,a=[];++r<n;){var s=e[r];s!==t&&s!==i||(e[r]=i,a[o++]=r)}return a}var F,L,z,q=Function.prototype,H=Object.prototype,K=N["__core-js_shared__"],$=(F=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+F:"",V=q.toString,G=H.hasOwnProperty,W=H.toString,X=RegExp("^"+V.call(G).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),J=Object.create,Z=Math.max,Y=Math.min,Q=(L=se(Object,"defineProperty"),(z=se.name)&&z.length>2?L:void 0);function ee(e){return pe(e)?J(e):{}}function te(e){return!(!pe(e)||function(e){return!!$&&$ in e}(e))&&(function(e){var t=pe(e)?W.call(e):"";return t==v||t==_}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?X:P).test(function(e){if(null!=e){try{return V.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function re(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=ee(e.prototype),n=e.apply(r,t);return pe(n)?n:r}}function ne(e,t,r,n,i,s,f,l,p,y){var b=t&h,m=t&o,g=t&a,v=t&(u|c),_=t&d,w=g?void 0:re(e);return function o(){for(var a=arguments.length,u=Array(a),c=a;c--;)u[c]=arguments[c];if(v)var h=ae(o),d=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&n++;return n}(u,h);if(n&&(u=function(e,t,r,n){for(var i=-1,o=e.length,a=r.length,s=-1,u=t.length,c=Z(o-a,0),f=Array(u+c),l=!n;++s<u;)f[s]=t[s];for(;++i<a;)(l||i<o)&&(f[r[i]]=e[i]);for(;c--;)f[s++]=e[i++];return f}(u,n,i,v)),s&&(u=function(e,t,r,n){for(var i=-1,o=e.length,a=-1,s=r.length,u=-1,c=t.length,f=Z(o-s,0),l=Array(f+c),h=!n;++i<f;)l[i]=e[i];for(var d=i;++u<c;)l[d+u]=t[u];for(;++a<s;)(h||i<o)&&(l[d+r[a]]=e[i++]);return l}(u,s,f,v)),a-=d,v&&a<y){var S=R(u,h);return ie(e,t,ne,o.placeholder,r,u,S,l,p,y-a)}var k=m?r:this,E=g?k[e]:e;return a=u.length,l?u=function(e,t){for(var r=e.length,n=Y(t.length,r),i=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}(e);n--;){var o=t[n];e[n]=fe(o,r)?i[o]:void 0}return e}(u,l):_&&a>1&&u.reverse(),b&&p<a&&(u.length=p),this&&this!==N&&this instanceof o&&(E=w||re(E)),E.apply(k,u)}}function ie(e,t,r,n,i,c,h,d,p,y){var b=t&u;t|=b?f:l,(t&=~(b?l:f))&s||(t&=~(o|a));var m=r(e,t,i,b?c:void 0,b?h:void 0,b?void 0:c,b?void 0:h,d,p,y);return m.placeholder=n,le(m,e,t)}function oe(e,t,r,i,s,h,d,p){var y=t&a;if(!y&&"function"!=typeof e)throw new TypeError(n);var b=i?i.length:0;if(b||(t&=~(f|l),i=s=void 0),d=void 0===d?d:Z(me(d),0),p=void 0===p?p:me(p),b-=s?s.length:0,t&l){var m=i,g=s;i=s=void 0}var v=[e,t,r,i,s,m,g,h,d,p];if(e=v[0],t=v[1],r=v[2],i=v[3],s=v[4],!(p=v[9]=null==v[9]?y?0:e.length:Z(v[9]-b,0))&&t&(u|c)&&(t&=~(u|c)),t&&t!=o)_=t==u||t==c?function(e,t,r){var n=re(e);return function i(){for(var o=arguments.length,a=Array(o),s=o,u=ae(i);s--;)a[s]=arguments[s];var c=o<3&&a[0]!==u&&a[o-1]!==u?[]:R(a,u);return(o-=c.length)<r?ie(e,t,ne,i.placeholder,void 0,a,c,void 0,void 0,r-o):C(this&&this!==N&&this instanceof i?n:e,this,a)}}(e,t,p):t!=f&&t!=(o|f)||s.length?ne.apply(void 0,v):function(e,t,r,n){var i=t&o,a=re(e);return function t(){for(var o=-1,s=arguments.length,u=-1,c=n.length,f=Array(c+s),l=this&&this!==N&&this instanceof t?a:e;++u<c;)f[u]=n[u];for(;s--;)f[u++]=arguments[++o];return C(l,i?r:this,f)}}(e,t,r,i);else var _=function(e,t,r){var n=t&o,i=re(e);return function t(){return(this&&this!==N&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return le(_,e,t)}function ae(e){return e.placeholder}function se(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return te(r)?r:void 0}function ue(e){var t=e.match(E);return t?t[1].split(x):[]}function ce(e,t){var r=t.length,n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(k,"{\n/* [wrapped with "+t+"] */\n")}function fe(e,t){return!!(t=null==t?y:t)&&("number"==typeof e||I.test(e))&&e>-1&&e%1==0&&e<t}var le=Q?function(e,t,r){var n,i=t+"";return Q(e,"toString",{configurable:!0,enumerable:!1,value:(n=ce(i,he(ue(i),r)),function(){return n})})}:function(e){return e};function he(e,t){return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););}(g,function(r){var n="_."+r[0];t&r[1]&&!D(e,n)&&e.push(n)}),e.sort()}var de=function(e,t){return t=Z(void 0===t?e.length-1:t,0),function(){for(var r=arguments,n=-1,i=Z(r.length-t,0),o=Array(i);++n<i;)o[n]=r[t+n];n=-1;for(var a=Array(t+1);++n<t;)a[n]=r[n];return a[t]=o,C(e,this,a)}}(function(e,t,r){var n=o;if(r.length){var i=R(r,ae(de));n|=f}return oe(e,n,t,r,i)});function pe(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function ye(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&W.call(e)==w}function be(e){return e?(e=function(e){if("number"==typeof e)return e;if(ye(e))return m;if(pe(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=pe(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(S,"");var r=O.test(e);return r||T.test(e)?j(e.slice(2),r?2:8):A.test(e)?m:+e}(e))===p||e===-p?(e<0?-1:1)*b:e==e?e:0:0===e?e:0}function me(e){var t=be(e),r=t%1;return t==t?r?t-r:t:0}de.placeholder={},e.exports=de}).call(this,r(6))},function(e,t,r){var n=r(81),i=r(216),o=r(80),a={merge:r(495),defaults:r(215)};function s(e,t,r){if(t)"string"==typeof t&&(t=i(t,e._root,r));else{if(!e._root||!e._root.children)return"";t=e._root.children}return n(t,r)}t.load=function(e,n){var i=r(122);n=a.defaults(n||{},i.prototype.options);var s=o(e,n),u=function e(t,r,o,u){return this instanceof e?(u=a.defaults(u||{},n),i.call(this,t,r,o||s,u)):new e(t,r,o,u)};return(u.prototype=Object.create(i.prototype)).constructor=u,u.fn=u.prototype,u.prototype._originalRoot=s,a.merge(u,t),u._root=s,u._options=n,u},t.html=function(e,t){var n=r(122);return"[object Object]"!==Object.prototype.toString.call(e)||t||"length"in e||"type"in e||(t=e,e=void 0),s(this,e,t=a.defaults(t||{},this._options,n.prototype.options))},t.xml=function(e){return s(this,e,a.defaults({xmlMode:!0},this._options))},t.text=function(e){e||(e=this.root());for(var r,n="",i=e.length,o=0;o<i;o++)"text"===(r=e[o]).type?n+=r.data:r.children&&"comment"!==r.type&&(n+=t.text(r.children));return n},t.parseHTML=function(e,t,r){var n;return e&&"string"==typeof e?("boolean"==typeof t&&(r=t),n=this.load(e),r||n("script").remove(),n.root()[0].children.slice()):null},t.root=function(){return this(this._root)},t.contains=function(e,t){if(t===e)return!1;for(;t&&t!==t.parent;)if((t=t.parent)===e)return!0;return!1}},function(e,t,r){var n=r(57),i=n.isTag,o=n.getText,a=n.getParent,s=n.getChildren,u=n.getSiblings,c=n.hasAttrib,f=n.getName,l=n.getAttributeValue,h=r(488),d=r(217).rules.equals,p=r(58),y=p.trueFunc,b=p.falseFunc;function m(e,t){var r={name:e,value:t};return function(e){return d(e,r)}}function g(e){return function(t){return!!a(t)&&e(t)}}var v={contains:function(e,t){return function(r){return e(r)&&o(r).indexOf(t)>=0}},icontains:function(e,t){var r=t.toLowerCase();return function(t){return e(t)&&o(t).toLowerCase().indexOf(r)>=0}},"nth-child":function(e,t){var r=h(t);return r===b?r:r===y?g(e):function(t){for(var n=u(t),o=0,a=0;o<n.length;o++)if(i(n[o])){if(n[o]===t)break;a++}return r(a)&&e(t)}},"nth-last-child":function(e,t){var r=h(t);return r===b?r:r===y?g(e):function(t){for(var n=u(t),o=0,a=n.length-1;a>=0;a--)if(i(n[a])){if(n[a]===t)break;o++}return r(o)&&e(t)}},"nth-of-type":function(e,t){var r=h(t);return r===b?r:r===y?g(e):function(t){for(var n=u(t),o=0,a=0;a<n.length;a++)if(i(n[a])){if(n[a]===t)break;f(n[a])===f(t)&&o++}return r(o)&&e(t)}},"nth-last-of-type":function(e,t){var r=h(t);return r===b?r:r===y?g(e):function(t){for(var n=u(t),o=0,a=n.length-1;a>=0;a--)if(i(n[a])){if(n[a]===t)break;f(n[a])===f(t)&&o++}return r(o)&&e(t)}},root:function(e){return function(t){return!a(t)&&e(t)}},scope:function(e,t,r,n){return n&&0!==n.length?1===n.length?function(t){return n[0]===t&&e(t)}:function(t){return n.indexOf(t)>=0&&e(t)}:v.root(e)},checkbox:m("type","checkbox"),file:m("type","file"),password:m("type","password"),radio:m("type","radio"),reset:m("type","reset"),image:m("type","image"),submit:m("type","submit")},_={empty:function(e){return!s(e).some(function(e){return i(e)||"text"===e.type})},"first-child":function(e){return function(e){for(var t=0;e&&t<e.length;t++)if(i(e[t]))return e[t]}(u(e))===e},"last-child":function(e){for(var t=u(e),r=t.length-1;r>=0;r--){if(t[r]===e)return!0;if(i(t[r]))break}return!1},"first-of-type":function(e){for(var t=u(e),r=0;r<t.length;r++)if(i(t[r])){if(t[r]===e)return!0;if(f(t[r])===f(e))break}return!1},"last-of-type":function(e){for(var t=u(e),r=t.length-1;r>=0;r--)if(i(t[r])){if(t[r]===e)return!0;if(f(t[r])===f(e))break}return!1},"only-of-type":function(e){for(var t=u(e),r=0,n=t.length;r<n;r++)if(i(t[r])){if(t[r]===e)continue;if(f(t[r])===f(e))return!1}return!0},"only-child":function(e){for(var t=u(e),r=0;r<t.length;r++)if(i(t[r])&&t[r]!==e)return!1;return!0},link:function(e){return c(e,"href")},visited:b,selected:function(e){if(c(e,"selected"))return!0;if("option"!==f(e))return!1;var t=a(e);if(!t||"select"!==f(t)||c(t,"multiple"))return!1;for(var r=s(t),n=!1,o=0;o<r.length;o++)if(i(r[o]))if(r[o]===e)n=!0;else{if(!n)return!1;if(c(r[o],"selected"))return!1}return n},disabled:function(e){return c(e,"disabled")},enabled:function(e){return!c(e,"disabled")},checked:function(e){return c(e,"checked")||_.selected(e)},required:function(e){return c(e,"required")},optional:function(e){return!c(e,"required")},parent:function(e){return!_.empty(e)},header:function(e){var t=f(e);return"h1"===t||"h2"===t||"h3"===t||"h4"===t||"h5"===t||"h6"===t},button:function(e){var t=f(e);return"button"===t||"input"===t&&"button"===l(e,"type")},input:function(e){var t=f(e);return"input"===t||"textarea"===t||"select"===t||"button"===t},text:function(e){var t;return"input"===f(e)&&(!(t=l(e,"type"))||"text"===t.toLowerCase())}};function w(e,t,r){if(null===r){if(e.length>1&&"scope"!==t)throw new SyntaxError("pseudo-selector :"+t+" requires an argument")}else if(1===e.length)throw new SyntaxError("pseudo-selector :"+t+" doesn't have any arguments")}var S=/^(?:(?:nth|last|first|only)-(?:child|of-type)|root|empty|(?:en|dis)abled|checked|not)$/;e.exports={compile:function(e,t,r,n){var i=t.name,o=t.data;if(r&&r.strict&&!S.test(i))throw SyntaxError(":"+i+" isn't part of CSS3");if("function"==typeof v[i])return w(v[i],i,o),v[i](e,o,r,n);if("function"==typeof _[i]){var a=_[i];return w(a,i,o),e===y?a:function(t){return a(t,o)&&e(t)}}throw new SyntaxError("unmatched pseudo-class :"+i)},filters:v,pseudos:_}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(23),o=n(r(46)),a=n(r(5)),s=r(19);t.DUST_MINIMUM=5500,t.hash160=function(e){const t=i.crypto.sha256(e);return(new o.default).update(t).digest()},t.hash128=function(t){return e.from(i.crypto.sha256(t).slice(0,16))};const u=10,c=41,f=107,l=9,h=25;function d(e,t){return u+e.reduce((e,t)=>e+function(e){return e&&e.script&&e.script.length>0?c+e.script.length:c+f}(t),0)+t.reduce((e,t)=>e+function(e){return e&&e.script&&e.script.length>0?l+e.script.length:l+h}(t),0)}function p(e){return e.__TX}function y(e){return e instanceof i.Transaction?e:p(e)}function b(e,t,r){const n=y(e),i=new Array(t);i.fill(null);const o=new Array(r);return o.fill(null),d([].concat(n.ins,i),[].concat(n.outs,o))}t.getTransactionInsideBuilder=p,t.estimateTXBytes=b,t.sumOutputValues=function(e){return y(e).outs.reduce((e,t)=>e+t.value,0)},t.decodeB40=function(e){const t=new a.default(40);return e.split("").reverse().map((e,r)=>new a.default("0123456789abcdefghijklmnopqrstuvwxyz-_.+".indexOf(e)).mul(t.pow(new a.default(r)))).reduce((e,t)=>e.add(t),new a.default(0)).toString(16,2)},t.addUTXOsToFund=function e(t,r,n,i,o=!0){if(0===r.length)throw new s.NotEnoughFundsError(n);const a=i*(b(t,1,0)-b(t,0,0));let u=n;o&&(u+=a);const c=r.filter(e=>e.value>=u);if(c.length>0){c.sort((e,t)=>e.value-t.value);const e=c[0];let r=e.value-n;return o&&(r-=a),t.addInput(e.tx_hash,e.tx_output_n),r}{r.sort((e,t)=>t.value-e.value);const u=r[0];if(a>=u.value)throw new s.NotEnoughFundsError(n);t.addInput(u.tx_hash,u.tx_output_n);let c=n-u.value;return o&&(c+=a),e(t,r.slice(1),c,i,o)}},t.signInputs=function(e,t,r){const n=p(e),i=n.ins.map(()=>t);r&&r.forEach(e=>{i[e.index]=e.signer});let o=Promise.resolve();for(let t=0;t<n.ins.length;t++)o=o.then(()=>i[t].signTransaction(e,t));return o.then(()=>e)}}).call(this,r(0).Buffer)},function(e,t){(function(){e.exports={k:"__iced_k",k_noop:"__iced_k_noop",param:"__iced_p_",ns:"iced",runtime:"runtime",Deferrals:"Deferrals",deferrals:"__iced_deferrals",fulfill:"_fulfill",b_while:"_break",t_while:"_while",c_while:"_continue",n_while:"_next",n_arg:"__iced_next_arg",defer_method:"defer",slot:"__slot",assign_fn:"assign_fn",autocb:"autocb",retslot:"ret",trace:"__iced_trace",passed_deferral:"__iced_passed_deferral",findDeferral:"findDeferral",lineno:"lineno",parent:"parent",filename:"filename",funcname:"funcname",catchExceptions:"catchExceptions",runtime_modes:["node","inline","window","none","browserify","interp"],trampoline:"trampoline",context:"context",defer_arg:"__iced_defer_"}}).call(this)},function(e,t,r){(function(){var e,n,i,o,a,s={}.hasOwnProperty;n=r(21).BlockCipher,a=r(15).scrub_vec,o=function(){function e(){this.SBOX=[],this.INV_SBOX=[],this.SUB_MIX=function(){var e,t;for(t=[],e=0;e<4;++e)t.push([]);return t}(),this.INV_SUB_MIX=function(){var e,t;for(t=[],e=0;e<4;++e)t.push([]);return t}(),this.init(),this.RCON=[0,1,2,4,8,16,32,64,128,27,54]}return e.prototype.init=function(){var e,t,r,n,i,o,a,s,u,c;for(e=function(){var e,r;for(r=[],t=e=0;e<256;t=++e)t<128?r.push(t<<1):r.push(t<<1^283);return r}(),i=0,u=0,t=c=0;c<256;t=++c)r=(r=u^u<<1^u<<2^u<<3^u<<4)>>>8^255&r^99,this.SBOX[i]=r,this.INV_SBOX[r]=i,s=e[a=e[o=e[i]]],n=257*e[r]^16843008*r,this.SUB_MIX[0][i]=n<<24|n>>>8,this.SUB_MIX[1][i]=n<<16|n>>>16,this.SUB_MIX[2][i]=n<<8|n>>>24,this.SUB_MIX[3][i]=n,n=16843009*s^65537*a^257*o^16843008*i,this.INV_SUB_MIX[0][r]=n<<24|n>>>8,this.INV_SUB_MIX[1][r]=n<<16|n>>>16,this.INV_SUB_MIX[2][r]=n<<8|n>>>24,this.INV_SUB_MIX[3][r]=n,0===i?i=u=1:(i=o^e[e[e[s^o]]],u^=e[e[u]]);return!0},e}(),i=new o,e=function(e){function t(e){this._key=e.clone(),this._doReset()}return function(e,t){for(var r in t)s.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,n),t.blockSize=16,t.prototype.blockSize=t.blockSize,t.keySize=32,t.prototype.keySize=t.keySize,t.ivSize=t.blockSize,t.prototype.ivSize=t.ivSize,t.prototype._doReset=function(){var e,t,r,n,o,a,s,u;for(r=this._key.words,t=this._key.sigBytes/4,this._nRounds=t+6,o=4*(this._nRounds+1),this._keySchedule=[],n=s=0;0<=o?s<o:s>o;n=0<=o?++s:--s)this._keySchedule[n]=n<t?r[n]:(a=this._keySchedule[n-1],n%t==0?(a=a<<8|a>>>24,a=i.SBOX[a>>>24]<<24|i.SBOX[a>>>16&255]<<16|i.SBOX[a>>>8&255]<<8|i.SBOX[255&a],a^=i.RCON[n/t|0]<<24):t>6&&n%t==4&&(a=i.SBOX[a>>>24]<<24|i.SBOX[a>>>16&255]<<16|i.SBOX[a>>>8&255]<<8|i.SBOX[255&a]),this._keySchedule[n-t]^a);for(this._invKeySchedule=[],e=u=0;0<=o?u<o:u>o;e=0<=o?++u:--u)n=o-e,a=this._keySchedule[n-(e%4?0:4)],this._invKeySchedule[e]=e<4||n<=4?a:i.INV_SUB_MIX[0][i.SBOX[a>>>24]]^i.INV_SUB_MIX[1][i.SBOX[a>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[a>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&a]];return!0},t.prototype.encryptBlock=function(e,t){return null==t&&(t=0),this._doCryptBlock(e,t,this._keySchedule,i.SUB_MIX,i.SBOX)},t.prototype.decryptBlock=function(e,t){var r,n;return null==t&&(t=0),r=[e[t+3],e[t+1]],e[t+1]=r[0],e[t+3]=r[1],this._doCryptBlock(e,t,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX),n=[e[t+3],e[t+1]],e[t+1]=n[0],e[t+3]=n[1],n},t.prototype.scrub=function(){return a(this._keySchedule),a(this._invKeySchedule),this._key.scrub()},t.prototype._doCryptBlock=function(e,t,r,n,i){var o,a,s,u,c,f,l,h,d,p,y;for(a=e[t]^r[0],s=e[t+1]^r[1],u=e[t+2]^r[2],c=e[t+3]^r[3],o=4,p=1,y=this._nRounds;1<=y?p<y:p>y;1<=y?++p:--p)f=n[0][a>>>24]^n[1][s>>>16&255]^n[2][u>>>8&255]^n[3][255&c]^r[o++],l=n[0][s>>>24]^n[1][u>>>16&255]^n[2][c>>>8&255]^n[3][255&a]^r[o++],h=n[0][u>>>24]^n[1][c>>>16&255]^n[2][a>>>8&255]^n[3][255&s]^r[o++],d=n[0][c>>>24]^n[1][a>>>16&255]^n[2][s>>>8&255]^n[3][255&u]^r[o++],a=f,s=l,u=h,c=d;return f=(i[a>>>24]<<24|i[s>>>16&255]<<16|i[u>>>8&255]<<8|i[255&c])^r[o++],l=(i[s>>>24]<<24|i[u>>>16&255]<<16|i[c>>>8&255]<<8|i[255&a])^r[o++],h=(i[u>>>24]<<24|i[c>>>16&255]<<16|i[a>>>8&255]<<8|i[255&s])^r[o++],d=(i[c>>>24]<<24|i[a>>>16&255]<<16|i[s>>>8&255]<<8|i[255&u])^r[o++],e[t]=f,e[t+1]=l,e[t+2]=h,e[t+3]=d},t}(),t.AES=e}).call(this)},function(e,t,r){(function(){var e,n,i,o={}.hasOwnProperty;e=r(21).BlockCipher,i=r(15).scrub_vec,n=new function(){this.P=[[169,103,179,232,4,253,163,118,154,146,128,120,228,221,209,56,13,198,53,152,24,247,236,108,67,117,55,38,250,19,148,72,242,208,139,48,132,84,223,35,25,91,61,89,243,174,162,130,99,1,131,46,217,81,155,124,166,235,165,190,22,12,227,97,192,140,58,245,115,44,37,11,187,78,137,107,83,106,180,241,225,230,189,69,226,244,182,102,204,149,3,86,212,28,30,215,251,195,142,181,233,207,191,186,234,119,57,175,51,201,98,113,129,121,9,173,36,205,249,216,229,197,185,77,68,8,134,231,161,29,170,237,6,112,178,210,65,123,160,17,49,194,39,144,32,246,96,255,150,92,177,171,158,156,82,27,95,147,10,239,145,133,73,238,45,79,143,59,71,135,109,70,214,62,105,100,42,206,203,47,252,151,5,122,172,127,213,26,75,14,167,90,40,20,63,41,136,60,76,2,184,218,176,23,85,31,138,125,87,199,141,116,183,196,159,114,126,21,34,18,88,7,153,52,110,80,222,104,101,188,219,248,200,168,43,64,220,254,50,164,202,16,33,240,211,93,15,0,111,157,54,66,74,94,193,224],[117,243,198,244,219,123,251,200,74,211,230,107,69,125,232,75,214,50,216,253,55,113,241,225,48,15,248,27,135,250,6,63,94,186,174,91,138,0,188,157,109,193,177,14,128,93,210,213,160,132,7,20,181,144,44,163,178,115,76,84,146,116,54,81,56,176,189,90,252,96,98,150,108,66,247,16,124,40,39,140,19,149,156,199,36,70,59,112,202,227,133,203,17,208,147,184,166,131,32,255,159,119,195,204,3,111,8,191,64,231,43,226,121,12,170,130,65,58,234,185,228,154,164,151,126,218,122,23,102,148,161,29,61,240,222,179,11,114,167,28,239,209,83,62,143,51,38,95,236,118,42,73,129,136,238,33,196,26,235,217,197,57,153,205,173,49,139,1,24,35,221,31,78,45,249,72,79,242,101,142,120,92,88,25,141,229,152,87,103,127,5,100,175,99,182,254,245,183,60,165,206,233,104,68,224,77,67,105,41,46,172,21,89,168,10,158,110,71,223,52,53,106,207,220,34,201,192,155,137,212,237,171,18,162,13,82,187,2,47,169,215,97,30,180,80,4,246,194,22,37,134,86,85,9,190,145]],this.P_00=1,this.P_01=0,this.P_02=0,this.P_03=1,this.P_04=1,this.P_10=0,this.P_11=0,this.P_12=1,this.P_13=1,this.P_14=0,this.P_20=1,this.P_21=1,this.P_22=0,this.P_23=0,this.P_24=0,this.P_30=0,this.P_31=1,this.P_32=1,this.P_33=0,this.P_34=1,this.GF256_FDBK=361,this.GF256_FDBK_2=this.GF256_FDBK/2,this.GF256_FDBK_4=this.GF256_FDBK/4,this.RS_GF_FDBK=333,this.SK_STEP=33686018,this.SK_BUMP=16843009,this.SK_ROTL=9},t.TwoFish=function(t){function r(e){this._key=e.clone(),this.gMDS0=[],this.gMDS1=[],this.gMDS2=[],this.gMDS3=[],this.gSubKeys=[],this.gSBox=[],this.k64Cnt=0,this._doReset()}return function(e,t){for(var r in t)o.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(r,e),r.blockSize=16,r.prototype.blockSize=r.blockSize,r.keySize=32,r.prototype.keySize=r.keySize,r.ivSize=r.blockSize,r.prototype.ivSize=r.ivSize,r.prototype.getByte=function(e,t){return e>>>8*t&255},r.prototype.switchEndianness=function(e){return(255&e)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>24&255},r.prototype.LFSR1=function(e){return e>>1^(0!=(1&e)?n.GF256_FDBK_2:0)},r.prototype.LFSR2=function(e){return e>>2^(0!=(2&e)?n.GF256_FDBK_2:0)^(0!=(1&e)?n.GF256_FDBK_4:0)},r.prototype.Mx_X=function(e){return e^this.LFSR2(e)},r.prototype.Mx_Y=function(e){return e^this.LFSR1(e)^this.LFSR2(e)},r.prototype.RS_rem=function(e){var t,r,i;return r=255&((t=e>>>24&255)<<1^(0!=(128&t)?n.RS_GF_FDBK:0)),e<<8^(i=t>>>1^(0!=(1&t)?n.RS_GF_FDBK>>>1:0)^r)<<24^r<<16^i<<8^t},r.prototype.RS_MDS_Encode=function(e,t){var r,n,i;for(r=t,n=0;n<4;++n)r=this.RS_rem(r);for(r^=e,i=0;i<4;++i)r=this.RS_rem(r);return r},r.prototype.F32=function(e,t){var r,i,o,a,s,u,c,f,l;return r=this.getByte(e,0),i=this.getByte(e,1),o=this.getByte(e,2),a=this.getByte(e,3),s=t[0],u=t[1],c=t[2],f=t[3],1===(l=3&this.k64Cnt)?this.gMDS0[255&n.P[n.P_01][r]^this.getByte(s,0)]^this.gMDS1[255&n.P[n.P_11][i]^this.getByte(s,1)]^this.gMDS2[255&n.P[n.P_21][o]^this.getByte(s,2)]^this.gMDS3[255&n.P[n.P_31][a]^this.getByte(s,3)]:(0===l&&(r=255&n.P[n.P_04][r]^this.getByte(f,0),i=255&n.P[n.P_14][i]^this.getByte(f,1),o=255&n.P[n.P_24][o]^this.getByte(f,2),a=255&n.P[n.P_34][a]^this.getByte(f,3)),(0===l||3===l)&&(r=255&n.P[n.P_03][r]^this.getByte(c,0),i=255&n.P[n.P_13][i]^this.getByte(c,1),o=255&n.P[n.P_23][o]^this.getByte(c,2),a=255&n.P[n.P_33][a]^this.getByte(c,3)),this.gMDS0[255&n.P[n.P_01][255&n.P[n.P_02][r]^this.getByte(u,0)]^this.getByte(s,0)]^this.gMDS1[255&n.P[n.P_11][255&n.P[n.P_12][i]^this.getByte(u,1)]^this.getByte(s,1)]^this.gMDS2[255&n.P[n.P_21][255&n.P[n.P_22][o]^this.getByte(u,2)]^this.getByte(s,2)]^this.gMDS3[255&n.P[n.P_31][255&n.P[n.P_32][a]^this.getByte(u,3)]^this.getByte(s,3)])},r.prototype.Fe32_0=function(e){return this.gSBox[0+2*(255&e)]^this.gSBox[1+2*(e>>>8&255)]^this.gSBox[512+2*(e>>>16&255)]^this.gSBox[513+2*(e>>>24&255)]},r.prototype.Fe32_3=function(e){return this.gSBox[0+2*(e>>>24&255)]^this.gSBox[1+2*(255&e)]^this.gSBox[512+2*(e>>>8&255)]^this.gSBox[513+2*(e>>>16&255)]},r.prototype._doReset=function(){var e,t,r,i,o,a,s,u,c,f,l,h,d,p,y,b,m,g,v,_,w,S,k,E,x,A,O;if(d=[],p=[],w=[],b=[],m=[],g=[],this.k64Cnt=this._key.words.length/2,this.k64Cnt<1)throw"Key size less than 64 bits";if(this.k64Cnt>4)throw"Key size larger than 256 bits";for(s=S=0;S<256;s=++S)u=255&n.P[0][s],b[0]=u,m[0]=255&this.Mx_X(u),g[0]=255&this.Mx_Y(u),u=255&n.P[1][s],b[1]=u,m[1]=255&this.Mx_X(u),g[1]=255&this.Mx_Y(u),this.gMDS0[s]=b[n.P_00]|m[n.P_00]<<8|g[n.P_00]<<16|g[n.P_00]<<24,this.gMDS1[s]=g[n.P_10]|g[n.P_10]<<8|m[n.P_10]<<16|b[n.P_10]<<24,this.gMDS2[s]=m[n.P_20]|g[n.P_20]<<8|b[n.P_20]<<16|g[n.P_20]<<24,this.gMDS3[s]=m[n.P_30]|b[n.P_30]<<8|g[n.P_30]<<16|m[n.P_30]<<24;for(s=k=0,A=this.k64Cnt;0<=A?k<A:k>A;s=0<=A?++k:--k)v=2*s,d[s]=this.switchEndianness(this._key.words[v]),p[s]=this.switchEndianness(this._key.words[v+1]),w[this.k64Cnt-1-s]=this.RS_MDS_Encode(d[s],p[s]);for(s=E=0,20;E<20;s=++E)_=s*n.SK_STEP,e=this.F32(_,d),e+=t=(t=this.F32(_+n.SK_BUMP,p))<<8|t>>>24,this.gSubKeys[2*s]=e,e+=t,this.gSubKeys[2*s+1]=e<<n.SK_ROTL|e>>>32-n.SK_ROTL;for(c=w[0],f=w[1],l=w[2],h=w[3],this.gSBox=[],O=[],s=x=0;x<256;s=++x)r=i=o=a=s,1===(y=3&this.k64Cnt)?(this.gSBox[2*s]=this.gMDS0[255&n.P[n.P_01][r]^this.getByte(c,0)],this.gSBox[2*s+1]=this.gMDS1[255&n.P[n.P_11][i]^this.getByte(c,1)],this.gSBox[2*s+512]=this.gMDS2[255&n.P[n.P_21][o]^this.getByte(c,2)],O.push(this.gSBox[2*s+513]=this.gMDS3[255&n.P[n.P_31][a]^this.getByte(c,3)])):(0===y&&(r=255&n.P[n.P_04][r]^this.getByte(h,0),i=255&n.P[n.P_14][i]^this.getByte(h,1),o=255&n.P[n.P_24][o]^this.getByte(h,2),a=255&n.P[n.P_34][a]^this.getByte(h,3)),0!==y&&3!==y||(r=255&n.P[n.P_03][r]^this.getByte(l,0),i=255&n.P[n.P_13][i]^this.getByte(l,1),o=255&n.P[n.P_23][o]^this.getByte(l,2),a=255&n.P[n.P_33][a]^this.getByte(l,3)),this.gSBox[2*s]=this.gMDS0[255&n.P[n.P_01][255&n.P[n.P_02][r]^this.getByte(f,0)]^this.getByte(c,0)],this.gSBox[2*s+1]=this.gMDS1[255&n.P[n.P_11][255&n.P[n.P_12][i]^this.getByte(f,1)]^this.getByte(c,1)],this.gSBox[2*s+512]=this.gMDS2[255&n.P[n.P_21][255&n.P[n.P_22][o]^this.getByte(f,2)]^this.getByte(c,2)],O.push(this.gSBox[2*s+513]=this.gMDS3[255&n.P[n.P_31][255&n.P[n.P_32][a]^this.getByte(f,3)]^this.getByte(c,3)]));return O},r.prototype.scrub=function(){return i(this.gSubKeys),i(this.gSBox),this._key.scrub()},r.prototype.decryptBlock=function(e,t){var r,n,i,o,a,s,u,c;for(null==t&&(t=0),s=this.switchEndianness(e[t])^this.gSubKeys[4],u=this.switchEndianness(e[t+1])^this.gSubKeys[5],o=this.switchEndianness(e[t+2])^this.gSubKeys[6],a=this.switchEndianness(e[t+3])^this.gSubKeys[7],r=39,c=0;c<16;c+=2)a^=(n=this.Fe32_0(s))+2*(i=this.Fe32_3(u))+this.gSubKeys[r--],o=(o<<1|o>>>31)^n+i+this.gSubKeys[r--],a=a>>>1|a<<31,u^=(n=this.Fe32_0(o))+2*(i=this.Fe32_3(a))+this.gSubKeys[r--],s=(s<<1|s>>>31)^n+i+this.gSubKeys[r--],u=u>>>1|u<<31;return e[t]=this.switchEndianness(o^this.gSubKeys[0]),e[t+1]=this.switchEndianness(a^this.gSubKeys[1]),e[t+2]=this.switchEndianness(s^this.gSubKeys[2]),e[t+3]=this.switchEndianness(u^this.gSubKeys[3])},r.prototype.encryptBlock=function(e,t){var r,n,i,o,a,s,u,c;for(null==t&&(t=0),o=this.switchEndianness(e[t])^this.gSubKeys[0],a=this.switchEndianness(e[t+1])^this.gSubKeys[1],s=this.switchEndianness(e[t+2])^this.gSubKeys[2],u=this.switchEndianness(e[t+3])^this.gSubKeys[3],r=8,c=0;c<16;c+=2)s=(s^=(n=this.Fe32_0(o))+(i=this.Fe32_3(a))+this.gSubKeys[r++])>>>1|s<<31,u=(u<<1|u>>>31)^n+2*i+this.gSubKeys[r++],o=(o^=(n=this.Fe32_0(s))+(i=this.Fe32_3(u))+this.gSubKeys[r++])>>>1|o<<31,a=(a<<1|a>>>31)^n+2*i+this.gSubKeys[r++];return e[t]=this.switchEndianness(s^this.gSubKeys[4]),e[t+1]=this.switchEndianness(u^this.gSubKeys[5]),e[t+2]=this.switchEndianness(o^this.gSubKeys[6]),e[t+3]=this.switchEndianness(a^this.gSubKeys[7])},r}()}).call(this)},function(e,t,r){(function(){var e,n,i,o,a,s,u={}.hasOwnProperty;o=r(7).WordArray,n=r(21).Hasher,e=function(){function e(){this.H=[],this.K=[],this.W=[],this.init()}return e.prototype.isPrime=function(e){var t,r,n;if(2===e||3===e||5===e||7===e)return!0;if(1===e||4===e||6===e||8===e||9===e)return!1;for(r=Math.ceil(Math.sqrt(e)),t=n=2;2<=r?n<=r:n>=r;t=2<=r?++n:--n)if(e%t==0)return!1;return!0},e.prototype.getFractionalBits=function(e){return 4294967296*(e-(0|e))|0},e.prototype.init=function(){var e,t,r;for(e=2,t=0,r=[];t<64;)this.isPrime(e)&&(t<8&&(this.H[t]=this.getFractionalBits(Math.pow(e,.5))),this.K[t]=this.getFractionalBits(Math.pow(e,1/3)),t++),r.push(e++);return r},e}(),a=new e,i=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return function(e,t){for(var r in t)u.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,n),t.blockSize=16,t.prototype.blockSize=t.blockSize,t.output_size=32,t.prototype.output_size=t.output_size,t.prototype._doReset=function(){return this._hash=new o(a.H.slice(0))},t.prototype.get_output_size=function(){return this.output_size},t.prototype._doProcessBlock=function(e,t){var r,n,i,o,s,u,c,f,l,h,d,p,y,b,m,g,v,_,w,S;for(r=this._hash.words,i=a.W,n=a.K,o=r[0],s=r[1],u=r[2],c=r[3],f=r[4],l=r[5],h=r[6],m=r[7],g=S=0;S<64;g=++S)g<16?i[g]=0|e[t+g]:(d=((p=i[g-15])<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=((b=i[g-2])<<15|b>>>17)^(b<<13|b>>>19)^b>>>10,i[g]=d+i[g-7]+y+i[g-16]),v=o&s^o&u^s&u,_=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),w=m+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&l^~f&h)+n[g]+i[g],m=h,h=l,l=f,f=c+w|0,c=u,u=s,s=o,o=w+(_+v)|0;return r[0]=r[0]+o|0,r[1]=r[1]+s|0,r[2]=r[2]+u|0,r[3]=r[3]+c|0,r[4]=r[4]+f|0,r[5]=r[5]+l|0,r[6]=r[6]+h|0,r[7]=r[7]+m|0},t.prototype._doFinalize=function(){var e,t,r,n;return t=(e=this._data).words,n=8*this._nDataBytes,t[(r=8*e.sigBytes)>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},t.prototype.scrub=function(){return this._hash.scrub()},t.prototype.copy_to=function(e){return t.__super__.copy_to.call(this,e),e._hash=this._hash.clone()},t.prototype.clone=function(){var e;return e=new t,this.copy_to(e),e},t}(),s=function(e){var t;return t=(new i).finalize(e),e.scrub(),t},t.SHA256=i,t.transform=s}).call(this)},function(e,t,r){(function(){var e,n,i,o,a,s,u,c={}.hasOwnProperty;u=r(7),o=u.WordArray,a=u.X64Word,u.X64WordArray,n=r(21).Hasher,e=function(){function e(){this.RHO_OFFSETS=[],this.PI_INDEXES=[],this.ROUND_CONSTANTS=[],this.T=[],this.compute_rho_offsets(),this.compute_pi_indexes(),this.compute_round_constants(),this.make_reusables()}return e.prototype.compute_rho_offsets=function(){var e,t,r,n,i,o;for(r=1,n=0,o=[],t=i=0;i<24;t=++i)this.RHO_OFFSETS[r+5*n]=(t+1)*(t+2)/2%64,e=(2*r+3*n)%5,r=n%5,o.push(n=e);return o},e.prototype.compute_pi_indexes=function(){var e,t,r,n;for(n=[],e=r=0;r<5;e=++r)n.push(function(){var r,n;for(n=[],t=r=0;r<5;t=++r)n.push(this.PI_INDEXES[e+5*t]=t+(2*e+3*t)%5*5);return n}.call(this));return n},e.prototype.compute_round_constants=function(){var e,t,r,n,i,o,s,u,c;for(e=1,c=[],r=s=0;s<24;r=++s){for(o=0,i=0,n=u=0;u<7;n=++u)1&e&&((t=(1<<n)-1)<32?i^=1<<t:o^=1<<t-32),128&e?e=e<<1^113:e<<=1;c.push(this.ROUND_CONSTANTS[r]=new a(o,i))}return c},e.prototype.make_reusables=function(){return this.T=function(){var e,t;for(t=[],e=0;e<25;++e)t.push(new a(0,0));return t}()},e}(),s=new e,t.SHA3=i=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return function(e,t){for(var r in t)c.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(t,n),t.outputLength=512,t.prototype.outputLength=t.outputLength,t.blockSize=(1600-2*t.outputLength)/32,t.prototype.blockSize=t.blockSize,t.output_size=t.outputLength/8,t.prototype.output_size=t.output_size,t.prototype._doReset=function(){return this._state=function(){var e,t;for(t=[],e=0;e<25;++e)t.push(new a(0,0));return t}()},t.prototype._doProcessBlock=function(e,t){var r,n,i,o,a,u,c,f,l,h,d,p,y,b,m,g,v,_,w,S,k,E,x,A,O,P,T,I,j,M,B,N,C,D,U,R,F,L;for(r=s,x=this._state,w=this.blockSize/2,b=j=0;0<=w?j<w:j>w;b=0<=w?++j:--j)n=16711935&((n=e[t+2*b])<<8|n>>>24)|4278255360&(n<<24|n>>>8),i=16711935&((i=e[t+2*b+1])<<8|i>>>24)|4278255360&(i<<24|i>>>8),(m=x[b]).high^=i,m.low^=n;for(L=[],k=M=0;M<24;k=++M){for(T=B=0;B<5;T=++B){for(P=O=0,I=N=0;N<5;I=++N)P^=(m=x[T+5*I]).high,O^=m.low;(c=r.T[T]).high=P,c.low=O}for(T=C=0;C<5;T=++C)for(y=r.T[(T+4)%5],d=(f=r.T[(T+1)%5]).high,h=f.low,P=y.high^(d<<1|h>>>31),O=y.low^(h<<1|d>>>31),I=D=0;D<5;I=++D)(m=x[T+5*I]).high^=P,m.low^=O;for(g=U=1;U<25;g=++U)_=(m=x[g]).high,v=m.low,(S=r.RHO_OFFSETS[g])<32?(P=_<<S|v>>>32-S,O=v<<S|_>>>32-S):(P=v<<S-32|_>>>64-S,O=_<<S-32|v>>>64-S),(u=r.T[r.PI_INDEXES[g]]).high=P,u.low=O;for(o=r.T[0],A=x[0],o.high=A.high,o.low=A.low,T=R=0;R<5;T=++R)for(I=F=0;F<5;I=++F)m=x[g=T+5*I],a=r.T[g],l=r.T[(T+1)%5+5*I],p=r.T[(T+2)%5+5*I],m.high=a.high^~l.high&p.high,m.low=a.low^~l.low&p.low;m=x[0],E=r.ROUND_CONSTANTS[k],m.high^=E.high,L.push(m.low^=E.low)}return L},t.prototype._doFinalize=function(){var e,t,r,n,i,a,s,u,c,f,l,h,d;for(r=(t=this._data).words,8*this._nDataBytes,c=8*t.sigBytes,e=32*this.blockSize,r[c>>>5]|=1<<24-c%32,r[(Math.ceil((c+1)/e)*e>>>5)-1]|=128,t.sigBytes=4*r.length,this._process(),h=this._state,l=(f=this.outputLength/8)/8,n=[],i=d=0;0<=l?d<l:d>l;i=0<=l?++d:--d)u=16711935&((u=(a=h[i]).high)<<8|u>>>24)|4278255360&(u<<24|u>>>8),s=16711935&((s=a.low)<<8|s>>>24)|4278255360&(s<<24|s>>>8),n.push(s),n.push(u);return new o(n,f)},t.prototype.copy_to=function(e){var r;return t.__super__.copy_to.call(this,e),e._state=function(){var e,t,n,i;for(i=[],e=0,t=(n=this._state).length;e<t;e++)r=n[e],i.push(r.clone());return i}.call(this)},t.prototype.scrub=function(){},t.prototype.clone=function(){var e;return e=new t,this.copy_to(e),e},t}(),t.transform=function(e){var t;return t=(new i).finalize(e),e.scrub(),t}}).call(this)},function(e,t,r){(function(){var e,n,i,o,a,s;o=r(11),e=r(43).HMAC,i=r(7).WordArray,s=r(15),n=function(){function t(t){this.klass=t.klass,this.c=t.c,this.c||(this.c=1024),this.klass||(this.klass=e)}return t.prototype._PRF=function(e){return this.prf.reset(),this.prf.finalize(e)},t.prototype._gen_T_i=function(e,t){var r,n,a,u,c,f,l,h,d,p;h=o.findDeferral(arguments),c=e.salt,n=e.i,(a=e.progress_hook)(0),f=c.clone().concat(new i([n])),r=this._PRF(f),u=r.clone(),n=1,(p=this,function(e){var t;(t=function(e){var i,c;if(i=e,c=function(){return o.trampoline(function(){return t(e)})},!(n<p.c))return i();for(l=Math.min(p.c,n+128);n<l;)r=p._PRF(r),u.xor(r,{}),n++;a(n),d=new o.Deferrals(function(){return c(null)},{parent:h,filename:"/Users/max/src/keybase/triplesec/src/pbkdf2.iced",funcname:"PBKDF2._gen_T_i"}),s.default_delay(0,0,d.defer({lineno:57})),d._fulfill()})(e)})(function(){return a(n),t(u)})},t.prototype.run=function(e,t){var r,n,a,s,u,c,f,l,h,d,p,y,b,m,g;y=o.findDeferral(arguments),u=e.key,h=e.salt,n=e.dkLen,l=e.progress_hook,this.prf=new this.klass(u),r=this.prf.get_output_size(),c=Math.ceil(n/r),p=[],g=this,(f=function(e){return function(t){return"function"==typeof l?l({what:"pbkdf2",total:c*g.c,i:e*g.c+t}):void 0}})(0)(0),function(e){return function(t){var r;s=1,m=c>1,(r=function(t){var n;if(n=function(){return o.trampoline(function(){return m?s+=1:s-=1,r(t)})},!0===m&&s>c||!1===m&&s<c)return t();b=new o.Deferrals(function(){return n(p.push(d.words))},{parent:y,filename:"/Users/max/src/keybase/triplesec/src/pbkdf2.iced",funcname:"PBKDF2.run"}),e._gen_T_i({salt:h,i:s,progress_hook:f(s-1)},b.defer({assign_fn:function(){return d=arguments[0]},lineno:80})),b._fulfill()})(t)}}(this)(function(e){return function(){var r;return f(c)(0),a=(r=[]).concat.apply(r,p),u.scrub(),e.prf.scrub(),e.prf=null,t(new i(a,n))}}(this))},t}(),a=function(e,t){var r,i,a,s,u,c,f,l,h,d;h=o.findDeferral(arguments),s=e.key,l=e.salt,u=e.klass,r=e.c,i=e.dkLen,f=e.progress_hook,a=new n({klass:u,c:r}),function(e){d=new o.Deferrals(e,{parent:h,filename:"/Users/max/src/keybase/triplesec/src/pbkdf2.iced"}),a.run({key:s,salt:l,dkLen:i,progress_hook:f},d.defer({assign_fn:function(){return c=arguments[0]},lineno:106})),d._fulfill()}(function(){return t(c)})},t.pbkdf2=a,t.PBKDF2=n}).call(this)},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0});const i=r(136);try{i.protocolEchoReplyDetection()}catch(e){console.error(`Error performing global protocol echo reply detection: ${e}`)}n(r(232)),n(r(515)),n(r(199));var o=r(75);t.makeDIDFromAddress=o.makeDIDFromAddress,t.makeDIDFromPublicKey=o.makeDIDFromPublicKey,t.getDIDType=o.getDIDType,t.getAddressFromDID=o.getAddressFromDID;var a=r(41);t.getEntropy=a.getEntropy,t.makeECPrivateKey=a.makeECPrivateKey,t.publicKeyToAddress=a.publicKeyToAddress,t.getPublicKeyFromPrivate=a.getPublicKeyFromPrivate;var s=r(9);t.nextYear=s.nextYear,t.nextMonth=s.nextMonth,t.nextHour=s.nextHour,t.makeUUID4=s.makeUUID4,t.updateQueryStringParameter=s.updateQueryStringParameter,t.isLaterVersion=s.isLaterVersion,t.isSameOriginAbsoluteUrl=s.isSameOriginAbsoluteUrl,t.hexStringToECPair=s.hexStringToECPair,t.ecPairToHexString=s.ecPairToHexString,t.ecPairToAddress=s.ecPairToAddress;var u=r(520);t.transactions=u.transactions,t.safety=u.safety,t.PubkeyHashSigner=u.PubkeyHashSigner,t.addUTXOsToFund=u.addUTXOsToFund,t.estimateTXBytes=u.estimateTXBytes;var c=r(523);t.BlockstackWallet=c.BlockstackWallet;var f=r(161);t.network=f.network;var l=r(31);t.decodeToken=l.decodeToken;var h=r(27);t.config=h.config;var d=r(547);t.encryptMnemonic=d.encryptMnemonic,t.decryptMnemonic=d.decryptMnemonic;var p=r(76);t.UserSession=p.UserSession},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n="_blockstackDidCheckEchoReply",i="echoReply",o="authContinuation";t.protocolEchoReplyDetection=function(){let e;if("undefined"!=typeof self)e=self;else{if("undefined"==typeof window)return!1;e=window}if(!e.location||!e.localStorage||!e.URLSearchParams)return!1;const t=e[n];if("boolean"==typeof t)return t;const r=new e.URLSearchParams(e.location.search),a=r.get(i);if(a){e[n]=!0;const t=`echo-reply-${a}`;return e.localStorage.setItem(t,"success"),e.setTimeout(()=>{const t=r.get(o);e.location.href=t},10),!0}return!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(44),i=r(9);t.AppConfig=class{constructor(e=n.DEFAULT_SCOPE.slice(),t=i.getGlobalObject("location",{returnEmptyObject:!0}).origin,r="",o="/manifest.json",a=null,s=n.DEFAULT_BLOCKSTACK_HOST){this.appDomain=t,this.scopes=e,this.redirectPath=r,this.manifestPath=o,this.coreNode=a||n.DEFAULT_CORE_NODE,this.authenticatorURL=s}redirectURI(){return`${this.appDomain}${this.redirectPath}`}manifestURI(){return`${this.appDomain}${this.manifestPath}`}}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){"use strict";var n=r(3).Buffer,i=r(86).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(2)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i=r(61);e.exports=v;var o,a=r(138);v.ReadableState=g;r(60).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(142),c=r(88).Buffer,f=t.Uint8Array||function(){};var l=r(45);l.inherits=r(2);var h=r(244),d=void 0;d=h&&h.debuglog?h.debuglog("stream"):function(){};var p,y=r(245),b=r(143);l.inherits(v,u);var m=["error","close","destroy","pause","resume"];function g(e,t){e=e||{};var n=t instanceof(o=o||r(33));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(62).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(33),!(this instanceof v))return new v(e);this._readableState=new g(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function _(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}(e,a)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):w(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?w(e,a,t,!1):A(e,a)):w(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function w(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),A(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),_(this,e,t,!1,r)},v.prototype.unshift=function(e){return _(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(62).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this};var S=8388608;function k(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(x,e):x(e))}function x(e){d("emit readable"),e.emit("readable"),I(e)}function A(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(O,e,t))}function O(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function P(e){d("readable nexttick read 0"),e.read(0)}function T(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),I(e),t.flowing&&!t.reading&&e.read(0)}function I(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function M(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}v.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):E(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=k(r,t))),null===(n=e>0?j(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?f:v;function c(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",b),e.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",v),r.removeListener("data",y),h=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){d("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,I(e))}}(r);e.on("drain",l);var h=!1;var p=!1;function y(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==N(o.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function b(t){d("onerror",t),v(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),v()}function g(){d("onfinish"),e.removeListener("close",m),v()}function v(){d("unpipe"),r.unpipe(e)}return r.on("data",y),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=N(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i.nextTick(P,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(T,e,t))}(this,e)),this},v.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(d("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<m.length;o++)e.on(m[o],this.emit.bind(this,m[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=j}).call(this,r(6),r(16))},function(e,t,r){e.exports=r(60).EventEmitter},function(e,t,r){"use strict";var n=r(61);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";e.exports=a;var n=r(33),i=r(45);function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(2),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},function(e,t,r){var n=r(2),i=r(40),o=r(3).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,y=0|this._g,b=0|this._h,m=0;m<16;++m)r[m]=e.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((t=r[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[m-7]+d(r[m-15])+r[m-16];for(var g=0;g<64;++g){var v=b+h(u)+c(u,p,y)+a[g]+r[g]|0,_=l(n)+f(n,i,o)|0;b=y,y=p,p=u,u=s+v|0,s=o,o=i,i=n,n=v+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(2),i=r(40),o=r(3).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,g=0|this._gh,v=0|this._hh,_=0|this._al,w=0|this._bl,S=0|this._cl,k=0|this._dl,E=0|this._el,x=0|this._fl,A=0|this._gl,O=0|this._hl,P=0;P<32;P+=2)t[P]=e.readInt32BE(4*P),t[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var T=t[P-30],I=t[P-30+1],j=d(T,I),M=p(I,T),B=y(T=t[P-4],I=t[P-4+1]),N=b(I,T),C=t[P-14],D=t[P-14+1],U=t[P-32],R=t[P-32+1],F=M+D|0,L=j+C+m(F,M)|0;L=(L=L+B+m(F=F+N|0,N)|0)+U+m(F=F+R|0,R)|0,t[P]=L,t[P+1]=F}for(var z=0;z<160;z+=2){L=t[z],F=t[z+1];var q=f(r,n,i),H=f(_,w,S),K=l(r,_),$=l(_,r),V=h(s,E),G=h(E,s),W=a[z],X=a[z+1],J=c(s,u,g),Z=c(E,x,A),Y=O+G|0,Q=v+V+m(Y,O)|0;Q=(Q=(Q=Q+J+m(Y=Y+Z|0,Z)|0)+W+m(Y=Y+X|0,X)|0)+L+m(Y=Y+F|0,F)|0;var ee=$+H|0,te=K+q+m(ee,$)|0;v=g,O=A,g=u,A=x,u=s,x=E,s=o+Q+m(E=k+Y|0,k)|0,o=i,k=S,i=n,S=w,n=r,w=_,r=Q+te+m(_=Y+ee|0,Y)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+S|0,this._dl=this._dl+k|0,this._el=this._el+E|0,this._fl=this._fl+x|0,this._gl=this._gl+A|0,this._hl=this._hl+O|0,this._ah=this._ah+r+m(this._al,_)|0,this._bh=this._bh+n+m(this._bl,w)|0,this._ch=this._ch+i+m(this._cl,S)|0,this._dh=this._dh+o+m(this._dl,k)|0,this._eh=this._eh+s+m(this._el,E)|0,this._fh=this._fh+u+m(this._fl,x)|0,this._gh=this._gh+g+m(this._gl,A)|0,this._hh=this._hh+v+m(this._hl,O)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){var n=r(85);e.exports=function(e){return(new n).update(e).digest()}},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(64),n.short=r(266),n.mont=r(267),n.edwards=r(268)},function(e,t,r){"use strict";var n=r(18).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(18),i=r(48),o=r(150),a=r(10),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,y=o.g1_256,b=i.BlockHash,m=[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 g(){if(!(this instanceof g))return new g;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(g,b),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],v=this.h[5],_=this.h[6],w=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var S=c(w,d(g),f(g,v,_),this.k[n],r[n]),k=s(h(i),l(i,o,b));w=_,_=v,v=g,g=s(m,S),m=b,b=o,o=i,i=s(S,k)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],b),this.h[3]=s(this.h[3],m),this.h[4]=s(this.h[4],g),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],_),this.h[7]=s(this.h[7],w)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(18),i=r(48),o=r(10),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,l=n.sum64_hi,h=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,b=n.sum64_5_lo,m=i.BlockHash,g=[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;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function _(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function w(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function S(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function k(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function E(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function j(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=I(r[n-4],r[n-3]),o=j(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=P(r[n-30],r[n-29]),c=T(r[n-30],r[n-29]),f=r[n-32],l=r[n-31];r[n]=d(i,o,a,s,u,c,f,l),r[n+1]=p(i,o,a,s,u,c,f,l)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],d=this.h[6],p=this.h[7],m=this.h[8],g=this.h[9],v=this.h[10],P=this.h[11],T=this.h[12],I=this.h[13],j=this.h[14],M=this.h[15];o(this.k.length===r.length);for(var B=0;B<r.length;B+=2){var N=j,C=M,D=A(m,g),U=O(m,g),R=_(m,g,v,P,T),F=w(m,g,v,P,T,I),L=this.k[B],z=this.k[B+1],q=r[B],H=r[B+1],K=y(N,C,D,U,R,F,L,z,q,H),$=b(N,C,D,U,R,F,L,z,q,H);N=E(n,i),C=x(n,i),D=S(n,i,a,s,u),U=k(n,i,a,s,u,c);var V=l(N,C,D,U),G=h(N,C,D,U);j=T,M=I,T=v,I=P,v=m,P=g,m=l(d,p,K,$),g=h(p,p,K,$),d=u,p=c,u=a,c=s,a=n,s=i,n=l(K,$,V,G),i=h(K,$,V,G)}f(this.h,0,n,i),f(this.h,2,a,s),f(this.h,4,u,c),f(this.h,6,d,p),f(this.h,8,m,g),f(this.h,10,v,P),f(this.h,12,T,I),f(this.h,14,j,M)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){var n=r(95);function i(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function o(e){return n.Nil(e)?"":i(e.constructor)}function a(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function s(e){return n.Function(e)?e.toJSON?e.toJSON():i(e):n.Array(e)?"Array":e&&n.Object(e)?"Object":void 0!==e?e:""}function u(e,t,r){var i=function(e){return n.Function(e)?"":n.String(e)?JSON.stringify(e):e&&n.Object(e)?"":e}(t);return"Expected "+s(e)+", got"+(""!==r?" "+r:"")+(""!==i?" "+i:"")}function c(e,t,r){r=r||o(t),this.message=u(e,t,r),a(this,c),this.__type=e,this.__value=t,this.__valueTypeName=r}function f(e,t,r,n,i){e?(i=i||o(n),this.message=function(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),u('property "'+s(r)+o+s(e),n,i)}(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',a(this,c),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,f.prototype=Object.create(Error.prototype),f.prototype.constructor=c,e.exports={TfTypeError:c,TfPropertyTypeError:f,tfCustomError:function(e,t){return new c(e,{},t)},tfSubError:function(e,t,r){return e instanceof f?(t=t+"."+e.__property,e=new f(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof c&&(e=new f(e.__type,t,r,e.__value,e.__valueTypeName)),a(e),e},tfJSON:s,getValueTypeName:o}},function(e,t,r){(function(t){var n=r(47);function i(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function o(e,r,n){var i=new t(n?34:33);return i.writeUInt8(e,0),r.copy(i,1),n&&(i[33]=1),i}e.exports={decode:function(e,t){return i(n.decode(e),t)},decodeRaw:i,encode:function(e,t,r){return"number"==typeof e?n.encode(o(e,t,r)):n.encode(o(e.version,e.privateKey,e.compressed))},encodeRaw:o}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(3).Buffer;e.exports={check:function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))},decode:function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},encode:function(e,t){var r=e.length,i=t.length;if(0===r)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var o=n.allocUnsafe(6+r+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+r]=2,o[5+r]=t.length,t.copy(o,6+r),o}}},function(e,t,r){"use strict";var n=r(3).Buffer,i=9007199254740991;function o(e){if(e<0||e>i||e%1!=0)throw new RangeError("value out of range")}function a(e){return o(e),e<253?1:e<=65535?3:e<=4294967295?5:9}e.exports={encode:function e(t,r,i){if(o(t),r||(r=n.allocUnsafe(a(t))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return i||(i=0),t<253?(r.writeUInt8(t,i),e.bytes=1):t<=65535?(r.writeUInt8(253,i),r.writeUInt16LE(t,i+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,i),r.writeUInt32LE(t,i+1),e.bytes=5):(r.writeUInt8(255,i),r.writeUInt32LE(t>>>0,i+1),r.writeUInt32LE(t/4294967296|0,i+5),e.bytes=9),r},decode:function e(t,r){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=t.readUInt8(r);if(i<253)return e.bytes=1,i;if(253===i)return e.bytes=3,t.readUInt16LE(r+1);if(254===i)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var a=t.readUInt32LE(r+1),s=4294967296*t.readUInt32LE(r+5)+a;return o(s),s},encodingLength:a}},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(301)),n(r(315))},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(100);function i(e,t){var r=e[t];if(void 0===r)throw new Error("No input #".concat(t));return r}function o(e,t,r,n){throw new Error("Data for ".concat(e," key ").concat(t," is incorrect: Expected ")+"".concat(r," and got ").concat(JSON.stringify(n)))}function a(e){return function(t,r){for(var i=function(){var i=s[a],u=t[i],c=n[e+"s"][i]||{},f=c.canAdd,l=c.canAddToArray,h=c.check,d=c.expected;if(h)if(!!l){if(!Array.isArray(u)||r[i]&&!Array.isArray(r[i]))throw new Error("Key type ".concat(i," must be an array"));u.every(function(e){return h(e)})||o(e,i,d,u);var p=r[i]||[],y=new Set;if(!u.every(function(e){return l(p,e,y)}))throw new Error("Can not add duplicate data to array");r[i]=p.concat(u)}else{if(h(u)||o(e,i,d,u),!f(r,u))throw new Error("Can not add duplicate data to ".concat(e));r[i]=u}},a=0,s=Object.keys(t);a<s.length;a++)i()}}t.checkForInput=i,t.checkForOutput=function(e,t){var r=e[t];if(void 0===r)throw new Error("No output #".concat(t));return r},t.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter(function(t){return t.key.equals(e.key)}).length)throw new Error("Duplicate Key: ".concat(e.key.toString("hex")))},t.getEnumLength=function(e){var t=0;return Object.keys(e).forEach(function(e){Number(isNaN(Number(e)))&&t++}),t},t.inputCheckUncleanFinalized=function(e,t){var r=!1,n=!!t.redeemScript,i=!!t.witnessScript,o=!!t.nonWitnessUtxo,a=!!t.witnessUtxo;if(a!==o){var s=a&&i,u=!(o||a&&n)||!!t.finalScriptSig,c=!s||!!t.finalScriptWitness;r=u&&c}if(!1===r)throw new Error("Input #".concat(e," has too much or too little data to clean"))},t.updateGlobal=a("global"),t.updateInput=a("input"),t.updateOutput=a("output"),t.addInputAttributes=function(e,r){var n=i(e,e.length-1);t.updateInput(r,n)},t.addOutputAttributes=function(e,r){var n=i(e,e.length-1);t.updateOutput(r,n)},t.defaultVersionSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Version: Invalid Transaction");return r.writeUInt32LE(t,0),r},t.defaultLocktimeSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Locktime: Invalid Transaction");return r.writeUInt32LE(t,r.length-4),r}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4);function o(e){var t=n.compile(e);return 22===t.length&&t[0]===i.OPS.OP_0&&20===t[1]}t.check=o,o.toJSON=function(){return"Witness pubKeyHash output"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4);function o(e){var t=n.compile(e);return 34===t.length&&t[0]===i.OPS.OP_0&&32===t[1]}t.check=o,o.toJSON=function(){return"Witness scriptHash output"}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(23),o=n(r(334)),a=n(r(5)),s=n(r(46)),u=r(19),c=r(20),f=r(27),l=r(17),h=1e8,d="zone-file",p="registration",y="transaction";class b{broadcastTransaction(e){return Promise.reject(new Error(`Not implemented, broadcastTransaction(${e})`))}getBlockHeight(){return Promise.reject(new Error("Not implemented, getBlockHeight()"))}getTransactionInfo(e){return Promise.reject(new Error(`Not implemented, getTransactionInfo(${e})`))}getNetworkedUTXOs(e){return Promise.reject(new Error(`Not implemented, getNetworkedUTXOs(${e})`))}}t.BitcoinNetwork=b;class m{constructor(e,t,r,n=i.networks.bitcoin){this.blockstackAPIUrl=e,this.broadcastServiceUrl=t,this.layer1=n,this.btc=r,this.DUST_MINIMUM=5500,this.includeUtxoMap={},this.excludeUtxoSet=[],this.MAGIC_BYTES="id"}coerceAddress(e){const{hash:t,version:r}=i.address.fromBase58Check(e),n=[i.networks.bitcoin.scriptHash,i.networks.testnet.scriptHash],o=[i.networks.bitcoin.pubKeyHash,i.networks.testnet.pubKeyHash];let a;if(n.indexOf(r)>=0)a=this.layer1.scriptHash;else{if(!(o.indexOf(r)>=0))throw new Error(`Unrecognized address version number ${r} in ${e}`);a=this.layer1.pubKeyHash}return i.address.toBase58Check(t,a)}getDefaultBurnAddress(){return this.coerceAddress("1111111111111111111114oLvT2")}getNamePriceV1(e){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/prices/names/${e}`).then(t=>{if(!t.ok)throw new Error(`Failed to query name price for ${e}`);return t}).then(e=>e.json()).then(e=>e.name_price).then(t=>{if(!t||!t.satoshis)throw new Error(`Failed to get price for ${e}. Does the namespace exist?`);return t.satoshis<this.DUST_MINIMUM&&(t.satoshis=this.DUST_MINIMUM),{units:"BTC",amount:new a.default(String(t.satoshis))}})}getNamespacePriceV1(e){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/prices/namespaces/${e}`).then(t=>{if(!t.ok)throw new Error(`Failed to query name price for ${e}`);return t}).then(e=>e.json()).then(t=>{if(!t||!t.satoshis)throw new Error(`Failed to get price for ${e}`);return t.satoshis<this.DUST_MINIMUM&&(t.satoshis=this.DUST_MINIMUM),{units:"BTC",amount:new a.default(String(t.satoshis))}})}getNamePriceV2(e){return l.fetchPrivate(`${this.blockstackAPIUrl}/v2/prices/names/${e}`).then(e=>{if(200!==e.status)throw new Error("The upstream node does not handle the /v2/ price namespace");return e}).then(e=>e.json()).then(e=>e.name_price).then(t=>{if(!t)throw new Error(`Failed to get price for ${e}. Does the namespace exist?`);const r={units:t.units,amount:new a.default(t.amount)};if("BTC"===t.units){const e=new a.default(String(this.DUST_MINIMUM));r.amount.ucmp(e)<0&&(r.amount=e)}return r})}getNamespacePriceV2(e){return l.fetchPrivate(`${this.blockstackAPIUrl}/v2/prices/namespaces/${e}`).then(e=>{if(200!==e.status)throw new Error("The upstream node does not handle the /v2/ price namespace");return e}).then(e=>e.json()).then(t=>{if(!t)throw new Error(`Failed to get price for ${e}`);const r={units:t.units,amount:new a.default(t.amount)};if("BTC"===t.units){const e=new a.default(String(this.DUST_MINIMUM));r.amount.ucmp(e)<0&&(r.amount=e)}return r})}getNamePrice(e){return Promise.resolve().then(()=>this.getNamePriceV2(e)).catch(()=>this.getNamePriceV1(e))}getNamespacePrice(e){return Promise.resolve().then(()=>this.getNamespacePriceV2(e)).catch(()=>this.getNamespacePriceV1(e))}getGracePeriod(e){return Promise.resolve(5e3)}getNamesOwned(e){const t=this.coerceAddress(e);return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/addresses/bitcoin/${t}`).then(e=>e.json()).then(e=>e.names)}getNamespaceBurnAddress(e){return Promise.all([l.fetchPrivate(`${this.blockstackAPIUrl}/v1/namespaces/${e}`),this.getBlockHeight()]).then(([t,r])=>{if(404===t.status)throw new Error(`No such namespace '${e}'`);return Promise.all([t.json(),r])}).then(([e,t])=>{let r=this.getDefaultBurnAddress();return 2===e.version&&e.reveal_block+52595>=t&&(r=e.address),r}).then(e=>this.coerceAddress(e))}getNameInfo(e){c.Logger.debug(this.blockstackAPIUrl);const t=`${this.blockstackAPIUrl}/v1/names/${e}`;return l.fetchPrivate(t).then(e=>{if(404===e.status)throw new Error("Name not found");if(200!==e.status)throw new Error(`Bad response status: ${e.status}`);return e.json()}).then(e=>(c.Logger.debug(`nameInfo: ${JSON.stringify(e)}`),e.address?Object.assign({},e,{address:this.coerceAddress(e.address)}):e))}getNamespaceInfo(e){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/namespaces/${e}`).then(e=>{if(404===e.status)throw new Error("Namespace not found");if(200!==e.status)throw new Error(`Bad response status: ${e.status}`);return e.json()}).then(e=>e.address&&e.recipient_address?Object.assign({},e,{address:this.coerceAddress(e.address),recipient_address:this.coerceAddress(e.recipient_address)}):e)}getZonefile(t){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/zonefiles/${t}`).then(r=>{if(200===r.status)return r.text().then(r=>{const n=i.crypto.sha256(e.from(r)),o=(new s.default).update(n).digest("hex");if(o!==t)throw new Error(`Zone file contents hash to ${o}, not ${t}`);return r});throw new Error(`Bad response status: ${r.status}`)})}getAccountStatus(e,t){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/accounts/${e}/${t}/status`).then(e=>{if(404===e.status)throw new Error("Account not found");if(200!==e.status)throw new Error(`Bad response status: ${e.status}`);return e.json()}).then(e=>{return Object.assign({},e,{address:this.coerceAddress(e.address),debit_value:new a.default(String(e.debit_value)),credit_value:new a.default(String(e.credit_value))})})}getAccountHistoryPage(e,t){const r=`${this.blockstackAPIUrl}/v1/accounts/${e}/history?page=${t}`;return l.fetchPrivate(r).then(e=>{if(404===e.status)throw new Error("Account not found");if(200!==e.status)throw new Error(`Bad response status: ${e.status}`);return e.json()}).then(e=>{if(e.error)throw new Error(`Unable to get account history page: ${e.error}`);return e.map(e=>(e.address=this.coerceAddress(e.address),e.debit_value=new a.default(String(e.debit_value)),e.credit_value=new a.default(String(e.credit_value)),e))})}getAccountAt(e,t){const r=`${this.blockstackAPIUrl}/v1/accounts/${e}/history/${t}`;return l.fetchPrivate(r).then(e=>{if(404===e.status)throw new Error("Account not found");if(200!==e.status)throw new Error(`Bad response status: ${e.status}`);return e.json()}).then(e=>{if(e.error)throw new Error(`Unable to get historic account state: ${e.error}`);return e.map(e=>(e.address=this.coerceAddress(e.address),e.debit_value=new a.default(String(e.debit_value)),e.credit_value=new a.default(String(e.credit_value)),e))})}getAccountTokens(e){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/accounts/${e}/tokens`).then(e=>{if(404===e.status)throw new Error("Account not found");if(200!==e.status)throw new Error(`Bad response status: ${e.status}`);return e.json()}).then(e=>{if(e.error)throw new Error(`Unable to get token list: ${e.error}`);return e})}getAccountBalance(e,t){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/accounts/${e}/${t}/balance`).then(e=>{if(404===e.status)return Promise.resolve().then(()=>new a.default("0"));if(200!==e.status)throw new Error(`Bad response status: ${e.status}`);return e.json()}).then(e=>{if(e.error)throw new Error(`Unable to get account balance: ${e.error}`);let t="0";return e&&e.balance&&(t=e.balance),new a.default(t)})}broadcastServiceFetchHelper(e,t){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)},n=`${this.broadcastServiceUrl}/v1/broadcast/${e}`;return l.fetchPrivate(n,r).then(e=>{if(e.ok)return e.json();throw new u.RemoteServiceError(e)})}broadcastTransaction(e,t=null,r=6){if(!e){const e=new u.MissingParameterError("transaction");return Promise.reject(e)}if(!r&&0!==r){const e=new u.MissingParameterError("confirmations");return Promise.reject(e)}if(null===t)return this.btc.broadcastTransaction(e);{const n=y,i={transaction:e,transactionToWatch:t,confirmations:r};return this.broadcastServiceFetchHelper(n,i)}}broadcastZoneFile(e,t=null){if(!e)return Promise.reject(new u.MissingParameterError("zoneFile"));if(t){const r={zoneFile:e,transactionToWatch:t},n=d;return this.broadcastServiceFetchHelper(n,r)}{const t={zonefile:e};return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/zonefile/`,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then(e=>{return e.json().then(t=>{if(t.hasOwnProperty("error"))throw new u.RemoteServiceError(e);return t.servers})})}}broadcastNameRegistration(e,t,r){if(!e){const e=new u.MissingParameterError("preorderTransaction");return Promise.reject(e)}if(!t){const e=new u.MissingParameterError("registerTransaction");return Promise.reject(e)}if(!r){const e=new u.MissingParameterError("zoneFile");return Promise.reject(e)}const n={preorderTransaction:e,registerTransaction:t,zoneFile:r},i=p;return this.broadcastServiceFetchHelper(i,n)}getFeeRate(){return l.fetchPrivate("https://bitcoinfees.earn.com/api/v1/fees/recommended").then(e=>e.json()).then(e=>Math.floor(e.fastestFee))}countDustOutputs(){throw new Error("Not implemented.")}getUTXOs(e){return this.getNetworkedUTXOs(e).then(t=>{let r=t.concat();this.includeUtxoMap.hasOwnProperty(e)&&(r=t.concat(this.includeUtxoMap[e]));const n=this.excludeUtxoSet;return r=r.filter(e=>{return!n.reduce((t,r)=>t||r.tx_hash===e.tx_hash&&r.tx_output_n===e.tx_output_n,!1)})})}modifyUTXOSetFrom(t){const r=i.Transaction.fromHex(t),n=this.excludeUtxoSet.concat();r.ins.forEach(t=>{const r=e.from(t.hash);r.reverse(),n.push({tx_hash:r.toString("hex"),tx_output_n:t.index})}),this.excludeUtxoSet=n;const o=e.from(r.getHash().reverse()).toString("hex");r.outs.forEach((e,t)=>{if(function(e){try{return i.payments.embed({output:e},{validate:!0}),!0}catch(e){return!1}}(e.script))return;const r=i.address.fromOutputScript(e.script,this.layer1);let n=[];this.includeUtxoMap.hasOwnProperty(r)&&(n=n.concat(this.includeUtxoMap[r])),n.push({tx_hash:o,confirmations:0,value:e.value,tx_output_n:t}),this.includeUtxoMap[r]=n})}resetUTXOs(e){delete this.includeUtxoMap[e],this.excludeUtxoSet=[]}getConsensusHash(){return l.fetchPrivate(`${this.blockstackAPIUrl}/v1/blockchains/bitcoin/consensus`).then(e=>e.json()).then(e=>e.consensus_hash)}getTransactionInfo(e){return this.btc.getTransactionInfo(e)}getBlockHeight(){return this.btc.getBlockHeight()}getNetworkedUTXOs(e){return this.btc.getNetworkedUTXOs(e)}}t.BlockstackNetwork=m;class g extends m{constructor(e,t,r){super(e,t,r,i.networks.testnet)}getFeeRate(){return Promise.resolve(Math.floor(1e-5*h))}}t.LocalRegtest=g;class v extends b{constructor(e,t){super(),this.bitcoindUrl=e,this.bitcoindCredentials=t,this.importedBefore={}}broadcastTransaction(t){const r={jsonrpc:"1.0",method:"sendrawtransaction",params:[t]},n={Authorization:`Basic ${e.from(`${this.bitcoindCredentials.username}:${this.bitcoindCredentials.password}`).toString("base64")}`};return l.fetchPrivate(this.bitcoindUrl,{method:"POST",body:JSON.stringify(r),headers:n}).then(e=>e.json()).then(e=>e.result)}getBlockHeight(){const t={Authorization:`Basic ${e.from(`${this.bitcoindCredentials.username}:${this.bitcoindCredentials.password}`).toString("base64")}`};return l.fetchPrivate(this.bitcoindUrl,{method:"POST",body:JSON.stringify({jsonrpc:"1.0",method:"getblockcount"}),headers:t}).then(e=>e.json()).then(e=>e.result)}getTransactionInfo(t){const r={jsonrpc:"1.0",method:"gettransaction",params:[t]},n=e.from(`${this.bitcoindCredentials.username}:${this.bitcoindCredentials.password}`).toString("base64"),i={Authorization:`Basic ${n}`};return l.fetchPrivate(this.bitcoindUrl,{method:"POST",body:JSON.stringify(r),headers:i}).then(e=>e.json()).then(e=>e.result).then(e=>e.blockhash).then(e=>{const t={jsonrpc:"1.0",method:"getblockheader",params:[e]};return i.Authorization=`Basic ${n}`,l.fetchPrivate(this.bitcoindUrl,{method:"POST",body:JSON.stringify(t),headers:i})}).then(e=>e.json()).then(e=>{if(e&&e.result)return{block_height:e.result.height};throw new Error("Unconfirmed transaction")})}getNetworkedUTXOs(t){const r={jsonrpc:"1.0",method:"importaddress",params:[t]},n={jsonrpc:"1.0",method:"listunspent",params:[0,9999999,[t]]},i={Authorization:`Basic ${e.from(`${this.bitcoindCredentials.username}:${this.bitcoindCredentials.password}`).toString("base64")}`};return(this.importedBefore[t]?Promise.resolve():l.fetchPrivate(this.bitcoindUrl,{method:"POST",body:JSON.stringify(r),headers:i}).then(()=>{this.importedBefore[t]=!0})).then(()=>l.fetchPrivate(this.bitcoindUrl,{method:"POST",body:JSON.stringify(n),headers:i})).then(e=>e.json()).then(e=>e.result).then(e=>e.map(e=>({value:Math.round(e.amount*h),confirmations:e.confirmations,tx_hash:e.txid,tx_output_n:e.vout})))}}t.BitcoindAPI=v;class _ extends b{constructor(e="https://utxo.technofractal.com/"){super(),this.apiUrl=e}broadcastTransaction(e){const t={rawtx:e};return l.fetchPrivate(`${this.apiUrl}/tx/send`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(e=>e.json())}getBlockHeight(){return l.fetchPrivate(`${this.apiUrl}/status`).then(e=>e.json()).then(e=>e.blocks)}getTransactionInfo(e){return l.fetchPrivate(`${this.apiUrl}/tx/${e}`).then(e=>e.json()).then(e=>{if(e.error)throw new Error(`Error finding transaction: ${e.error}`);return l.fetchPrivate(`${this.apiUrl}/block/${e.blockHash}`)}).then(e=>e.json()).then(e=>({block_height:e.height}))}getNetworkedUTXOs(e){return l.fetchPrivate(`${this.apiUrl}/addr/${e}/utxo`).then(e=>e.json()).then(e=>e.map(e=>({value:e.satoshis,confirmations:e.confirmations,tx_hash:e.txid,tx_output_n:e.vout})))}}t.InsightClient=_;class w extends b{constructor(e="https://blockchain.info"){super(),this.utxoProviderUrl=e}getBlockHeight(){return l.fetchPrivate(`${this.utxoProviderUrl}/latestblock?cors=true`).then(e=>e.json()).then(e=>e.height)}getNetworkedUTXOs(e){return l.fetchPrivate(`${this.utxoProviderUrl}/unspent?format=json&active=${e}&cors=true`).then(e=>500===e.status?(c.Logger.debug("UTXO provider 500 usually means no UTXOs: returning []"),{unspent_outputs:[]}):e.json()).then(e=>e.unspent_outputs).then(e=>e.map(e=>{return{value:e.value,tx_output_n:e.tx_output_n,confirmations:e.confirmations,tx_hash:e.tx_hash_big_endian}}))}getTransactionInfo(e){return l.fetchPrivate(`${this.utxoProviderUrl}/rawtx/${e}?cors=true`).then(t=>{if(200===t.status)return t.json();throw new Error(`Could not lookup transaction info for '${e}'. Server error.`)}).then(e=>({block_height:e.block_height}))}broadcastTransaction(t){const r=new o.default;return r.append("tx",t),l.fetchPrivate(`${this.utxoProviderUrl}/pushtx?cors=true`,{method:"POST",body:r}).then(r=>{return r.text().then(n=>{if(n.toLowerCase().indexOf("transaction submitted")>=0){return e.from(i.Transaction.fromHex(t).getHash().reverse()).toString("hex")}throw new u.RemoteServiceError(r,`Broadcast transaction failed with message: ${n}`)})})}}t.BlockchainInfoApi=w;const S=new g("http://localhost:16268","http://localhost:16269",new v("http://localhost:18332/",{username:"blockstack",password:"blockstacksystem"})),k=new m("https://core.blockstack.org","https://broadcast.blockstack.org",new w);t.getNameInfo=function(e){return f.config.network.getNameInfo(e)},t.network={BlockstackNetwork:m,LocalRegtest:g,BlockchainInfoApi:w,BitcoindAPI:v,InsightClient:_,defaults:{LOCAL_REGTEST:S,MAINNET_DEFAULT:k}}}).call(this,r(0).Buffer)},function(e){e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},function(e,t,r){(function(t){var r=Math.pow(2,30)-1;function n(e,r){if("string"!=typeof e&&!t.isBuffer(e))throw new TypeError(r+" must be a buffer or string")}e.exports=function(e,t,i,o){if(n(e,"Password"),n(t,"Salt"),"number"!=typeof i)throw new TypeError("Iterations not a number");if(i<0)throw new TypeError("Bad iterations");if("number"!=typeof o)throw new TypeError("Key length not a number");if(o<0||o>r||o!=o)throw new TypeError("Bad key length")}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,r(16))},function(e,t,r){var n=r(147),i=r(46),o=r(91),a=r(163),s=r(164),u=r(3).Buffer,c=u.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,t,r){var a=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return o(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=a(t):t.length<s&&(t=u.concat([t,c],s));for(var l=u.allocUnsafe(s+f[e]),h=u.allocUnsafe(s+f[e]),d=0;d<s;d++)l[d]=54^t[d],h[d]=92^t[d];var p=u.allocUnsafe(s+r+4);l.copy(p,0,0,s),this.ipad1=p,this.ipad2=l,this.opad=h,this.alg=e,this.blocksize=s,this.hash=a,this.size=f[e]}l.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){a(e,t,r,n),u.isBuffer(e)||(e=u.from(e,s)),u.isBuffer(t)||(t=u.from(t,s));var o=new l(i=i||"sha1",e,t.length),c=u.allocUnsafe(n),h=u.allocUnsafe(t.length+4);t.copy(h,0,0,t.length);for(var d=0,p=f[i],y=Math.ceil(n/p),b=1;b<=y;b++){h.writeUInt32BE(b,t.length);for(var m=o.run(h,o.ipad1),g=m,v=1;v<r;v++){g=o.run(g,o.ipad2);for(var _=0;_<p;_++)m[_]^=g[_]}m.copy(c,d),d+=p}return c}},function(e,t,r){var n=r(50),i=r(3).Buffer,o=r(167);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var s=0;s<r;s++){var u=a(e),c=o+16*s;e._cache.writeUInt32BE(u[0],c+0),e._cache.writeUInt32BE(u[1],c+4),e._cache.writeUInt32BE(u[2],c+8),e._cache.writeUInt32BE(u[3],c+12)}var f=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,f)}},function(e,t){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},function(e){e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},function(e,t,r){var n=r(69),i=r(3).Buffer,o=r(29),a=r(2),s=r(355),u=r(50),c=r(167);function f(e,t,r,a){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(t);var f=this._cipher.encryptBlock(u);this._ghash=new s(f),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new s(r),o=t.length,a=o%16;n.update(t),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var u=8*o,f=i.alloc(8);f.writeUIntBE(u,0,8),n.update(f),e._finID=n.state;var l=i.from(e._finID);return c(l),l}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(f,o),f.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},f.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=f},function(e,t,r){var n=r(69),i=r(3).Buffer,o=r(29);function a(e,t,r,a){o.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._mode=e}r(2)(a,o),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},function(e,t,r){var n=r(30);e.exports=g,g.simpleSieve=b,g.fermatTest=m;var i=r(5),o=new i(24),a=new(r(172)),s=new i(1),u=new i(2),c=new i(5),f=(new i(16),new i(8),new i(10)),l=new i(3),h=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function y(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!=0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}function b(e){for(var t=y(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function m(e){var t=i.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function g(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(d)}else for(;r.mod(o).cmp(h);)r.iadd(d);if(b(p=r.shrn(1))&&b(r)&&m(p)&&m(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(5),i=r(92);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),f=s.toRed(o);t>0;t--){var l=this._randrange(new n(2),s);r&&r(l);var h=l.toRed(o).redPow(c);if(0!==h.cmp(a)&&0!==h.cmp(f)){for(var d=1;d<u;d++){if(0===(h=h.redSqr()).cmp(a))return!1;if(0===h.cmp(f))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),o=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var u=e.shrn(s),c=a.toRed(i);t>0;t--){var f=this._randrange(new n(2),a),l=e.gcd(f);if(0!==l.cmpn(1))return l;var h=f.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var d=1;d<s;d++){if(0===(h=h.redSqr()).cmp(o))return h.fromRed().subn(1).gcd(e);if(0===h.cmp(c))break}if(d===s)return(h=h.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2),o=r(52).Reporter,a=r(0).Buffer;function s(e,t){o.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function u(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof u||(e=new u(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+n(e));this.value=e,this.length=e.length}}i(s,o),t.DecoderBuffer=s,s.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},s.prototype.restore=function(e){var t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=u,u.prototype.join=function(e,t){return e||(e=new a(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}},function(e,t,r){var n=t;n._reverse=function(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r}),t},n.der=r(368)},function(e,t,r){var n=r(2),i=r(51),o=i.base,a=i.bignum,s=i.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){o.Node.call(this,"der",e)}function f(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var n=s.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o<i;o++){n<<=8;var a=e.readUInt8(r);if(e.isError(a))return a;n|=a}return n}e.exports=u,u.prototype.decode=function(e,t){return e instanceof o.DecoderBuffer||(e=new o.DecoderBuffer(e,t)),this.tree._decode(e,t)},n(c,o.Node),c.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var n=e.save(),i=f(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},c.prototype._decodeTag=function(e,t,r){var n=f(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;var i=l(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){var r=f(e,t);if(e.isError(r))return r;var n,i=l(e,r.primitive,t);if(e.isError(i))return i;if(n=r.primitive||null!==i?e.skip(i):this._skipUntilEnd(e,t),e.isError(n))return n;if("end"===r.tagStr)break}},c.prototype._decodeList=function(e,t,r,n){for(var i=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var a=r.decode(e,"der",n);if(e.isError(a)&&o)break;i.push(a)}return i},c.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var n=e.raw();if(n.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,r){for(var n,i=[],o=0;!e.isEmpty();){var a=e.readUInt8();o<<=7,o|=127&a,0==(128&a)&&(i.push(o),o=0)}128&a&&i.push(o);var s=i[0]/40|0,u=i[0]%40;if(n=r?i:[s,u].concat(i.slice(1)),t){var c=t[n.join(" ")];void 0===c&&(c=t[n.join(".")]),void 0!==c&&(n=c)}return n},c.prototype._decodeTime=function(e,t){var r=e.raw().toString();if("gentime"===t)var n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),u=0|r.slice(10,12);n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,a,s,u,0)},c.prototype._decodeNull=function(e){return null},c.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){var r=e.raw(),n=new a(r);return t&&(n=t[n.toString(10)]||n),n},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},function(e,t,r){var n=r(2),i=r(0).Buffer,o=r(51),a=o.base,s=o.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){a.Node.call(this,"der",e)}function f(e){return e<10?"0"+e:e}e.exports=u,u.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(c,a.Node),c.prototype._encodeComposite=function(e,t,r,n){var o,a=function(e,t,r,n){var i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var u=1,c=n.length;c>=256;c>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;c=1+u;for(var f=n.length;f>0;c--,f>>=8)o[c]=255&f;return this._createEncoderBuffer([o,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},c.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e)){e=e.slice();for(n=0;n<e.length;n++)e[n]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n<e.length;n++){var a=e[n];for(o++;a>=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=e.length-1;n>=0;n--){a=e[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[f(n.getFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var a=e;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},function(e){e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},function(e,t,r){var n=r(24),i=r(3).Buffer;function o(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,a=i.alloc(0),s=0;a.length<t;)r=o(s++),a=i.concat([a,n("sha1").update(e).update(r).digest()]);return a.slice(0,t)}},function(e,t){e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},function(e,t,r){var n=r(5),i=r(3).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},function(e,t,r){"use strict";var n=t;n.bignum=r(5),n.define=r(384).define,n.base=r(387),n.constants=r(388),n.decoders=r(184),n.encoders=r(182)},function(e,t,r){"use strict";var n=t;n.der=r(183),n.pem=r(385)},function(e,t,r){"use strict";var n=r(2),i=r(0).Buffer,o=r(113),a=r(115);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){o.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,o),u.prototype._encodeComposite=function(e,t,r,n){var o=function(e,t,r,n){var i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(a.tagByName.hasOwnProperty(e))i=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=a.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128){var s=new i(2);return s[0]=o,s[1]=n.length,this._createEncoderBuffer([s,n])}for(var u=1,c=n.length;c>=256;c>>=8)u++;var f=new i(2+u);f[0]=o,f[1]=128|u;for(var l=1+u,h=n.length;h>0;l--,h>>=8)f[l]=255&h;return this._createEncoderBuffer([f,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},u.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e)){e=e.slice();for(var o=0;o<e.length;o++)e[o]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var a=0,s=0;s<e.length;s++){var u=e[s];for(a++;u>=128;u>>=7)a++}for(var c=new i(a),f=c.length-1,l=e.length-1;l>=0;l--){var h=e[l];for(c[f--]=127&h;(h>>=7)>0;)c[f--]=128|127&h}return this._createEncoderBuffer(c)},u.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var a=1,s=e;s>=256;s>>=8)a++;for(var u=new Array(a),c=u.length-1;c>=0;c--)u[c]=255&e,e>>=8;return 128&u[0]&&u.unshift(0),this._createEncoderBuffer(new i(u))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},function(e,t,r){"use strict";var n=t;n.der=r(185),n.pem=r(386)},function(e,t,r){"use strict";var n=r(2),i=r(5),o=r(53).DecoderBuffer,a=r(113),s=r(115);function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){a.call(this,"der",e)}function f(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var n=s.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o<i;o++){n<<=8;var a=e.readUInt8(r);if(e.isError(a))return a;n|=a}return n}e.exports=u,u.prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},n(c,a),c.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var n=e.save(),i=f(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},c.prototype._decodeTag=function(e,t,r){var n=f(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;var i=l(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){var r=f(e,t);if(e.isError(r))return r;var n=l(e,r.primitive,t);if(e.isError(n))return n;var i=void 0;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},c.prototype._decodeList=function(e,t,r,n){for(var i=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var a=r.decode(e,"der",n);if(e.isError(a)&&o)break;i.push(a)}return i},c.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var n=e.raw();if(n.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,r){for(var n,i=[],o=0,a=0;!e.isEmpty();)o<<=7,o|=127&(a=e.readUInt8()),0==(128&a)&&(i.push(o),o=0);128&a&&i.push(o);var s=i[0]/40|0,u=i[0]%40;if(n=r?i:[s,u].concat(i.slice(1)),t){var c=t[n.join(" ")];void 0===c&&(c=t[n.join(".")]),void 0!==c&&(n=c)}return n},c.prototype._decodeTime=function(e,t){var r,n,i,o,a,s,u=e.raw().toString();if("gentime"===t)r=0|u.slice(0,4),n=0|u.slice(4,6),i=0|u.slice(6,8),o=0|u.slice(8,10),a=0|u.slice(10,12),s=0|u.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");r=0|u.slice(0,2),n=0|u.slice(2,4),i=0|u.slice(4,6),o=0|u.slice(6,8),a=0|u.slice(8,10),s=0|u.slice(10,12),r=r<70?2e3+r:1900+r}return Date.UTC(r,n-1,i,o,a,s,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){var r=e.raw(),n=new i(r);return t&&(n=t[n.toString(10)]||n),n},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),parseFloat(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n;(0,o.default)(e),"object"===a(t)?(r=t.min||0,n=t.max):(r=arguments[1],n=arguments[2]);var i=encodeURI(e).split(/%..|./).length-1;return i>=r&&(void 0===n||i<=n)};var i,o=(i=r(1))&&i.__esModule?i:{default:i};function a(e){return(a="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=(t=t||{}).hasOwnProperty("allow_leading_zeroes")&&!t.allow_leading_zeroes?o:a,n=!t.hasOwnProperty("min")||e>=t.min,s=!t.hasOwnProperty("max")||e<=t.max,u=!t.hasOwnProperty("lt")||e<t.lt,c=!t.hasOwnProperty("gt")||e>t.gt;return r.test(e)&&n&&s&&u&&c};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^(?:[-+]?(?:0|[1-9][0-9]*))$/,a=/^[-+]?[0-9]+$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)},t.fullWidth=void 0;var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;t.fullWidth=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)},t.halfWidth=void 0;var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;t.halfWidth=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^[0-9A-F]+$/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=t?new RegExp("^[".concat(t,"]+"),"g"):/^\s+/g;return e.replace(r,"")};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);for(var r=t?new RegExp("[".concat(t,"]")):/\s/,n=e.length-1;n>=0&&r.test(e[n]);n--);return n<e.length?e.substr(0,n+1):e};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),e.replace(new RegExp("[".concat(t,"]+"),"g"),"")};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(r(196)),a=r(31),s=r(197),u=r(9),c=r(17),f=r(75),l=r(19),h=r(68),d=r(44),p=r(32),y=r(76),b=r(27),m=r(20),g=r(136),v=r(458),_={"@type":"Person","@context":"http://schema.org"};function w(){const e=u.getGlobalObject("location",{throwIfUnavailable:!0,usageDesc:"getAuthResponseToken"}).search,t=o.default.parse(e);return t.authResponse?t.authResponse:""}function S(e,t=d.DEFAULT_BLOCKSTACK_HOST){return n(this,void 0,void 0,function*(){e=e||(yield h.makeAuthRequest());const r=`${t}?authRequest=${e}`,{navigator:n,location:i}=u.getGlobalObjects(["navigator","location"],{throwIfUnavailable:!0,usageDesc:"redirectToSignInWithAuthRequest"});if(/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(n.userAgent))return m.Logger.info("detected mobile OS, sending to https"),void(i.href=r);v.launchCustomProtocol(e,function(){m.Logger.info("protocol handler detected")},function(){m.Logger.warn("protocol handler not detected"),i.href=r})})}t.isUserSignedIn=function(){return console.warn("DEPRECATION WARNING: The static isUserSignedIn() function will be deprecated in the next major release of blockstack.js. Create an instance of UserSession and call the instance method isUserSignedIn()."),(new y.UserSession).isUserSignedIn()},t.redirectToSignIn=function(e,t,r){return n(this,void 0,void 0,function*(){return console.warn("DEPRECATION WARNING: The static redirectToSignIn() function will be deprecated in the next major release of blockstack.js. Create an instance of UserSession and call the instance method redirectToSignIn()."),S(yield h.makeAuthRequest(null,e,t,r))})},t.isSignInPending=function(){try{if(g.protocolEchoReplyDetection())return m.Logger.info("protocolEchoReply detected from isSignInPending call, the page is about to redirect."),!0}catch(e){m.Logger.error(`Error checking for protocol echo reply isSignInPending: ${e}`)}return!!w()},t.getAuthResponseToken=w,t.loadUserData=function(){return console.warn("DEPRECATION WARNING: The static loadUserData() function will be deprecated in the next major release of blockstack.js. Create an instance of UserSession and call the instance method loadUserData()."),(new y.UserSession).loadUserData()},t.signUserOut=function(e,t){return n(this,void 0,void 0,function*(){const r=t||new y.UserSession;yield r.store.deleteSessionData(),e&&(u.getGlobalObject("location",{throwIfUnavailable:!0,usageDesc:"signUserOut"}).href=e)})},t.redirectToSignInWithAuthRequest=S,t.handlePendingSignIn=function(e="",t=w(),r,i){return n(this,void 0,void 0,function*(){try{if(g.protocolEchoReplyDetection()){const e="handlePendingSignIn called while protocolEchoReply was detected, and the page is about to redirect. This function will resolve with an error after several seconds, if the page was not redirected for some reason.";return m.Logger.info(e),new Promise((t,r)=>{setTimeout(()=>{m.Logger.error("Page should have redirected by now. handlePendingSignIn will now throw."),r(e)},3e3)})}}catch(e){m.Logger.error(`Error checking for protocol echo reply handlePendingSignIn: ${e}`)}if(i||(i=new y.UserSession),r=r||(yield i.store.getSessionData().then(e=>e.transitKey)),!e){const r=a.decodeToken(t).payload;u.isLaterVersion(r.version,"1.3.0")&&null!==r.blockstackAPIUrl&&void 0!==r.blockstackAPIUrl&&(m.Logger.info(`Overriding ${b.config.network.blockstackAPIUrl} `+`with ${r.blockstackAPIUrl}`),b.config.network.blockstackAPIUrl=r.blockstackAPIUrl),e=`${b.config.network.blockstackAPIUrl}${d.NAME_LOOKUP_PATH}`}if(!(yield s.verifyAuthResponse(t,e)))throw new l.LoginFailedError("Invalid authentication response.");const n=a.decodeToken(t).payload;let o=n.private_key,v=n.core_token;if(u.isLaterVersion(n.version,"1.1.0")){if(void 0===r||null==r)throw new l.LoginFailedError("Authenticating with protocol > 1.1.0 requires transit key, and none found.");if(void 0!==n.private_key&&null!==n.private_key)try{o=h.decryptPrivateKey(r,n.private_key)}catch(e){m.Logger.warn("Failed decryption of appPrivateKey, will try to use as given");try{u.hexStringToECPair(n.private_key)}catch(e){throw new l.LoginFailedError("Failed decrypting appPrivateKey. Usually means that the transit key has changed during login.")}}if(null!=v)try{v=h.decryptPrivateKey(r,v)}catch(e){m.Logger.info("Failed decryption of coreSessionToken, will try to use as given")}}let w,S=d.BLOCKSTACK_DEFAULT_GAIA_HUB_URL;u.isLaterVersion(n.version,"1.2.0")&&null!==n.hubUrl&&void 0!==n.hubUrl&&(S=n.hubUrl),u.isLaterVersion(n.version,"1.3.0")&&null!==n.associationToken&&void 0!==n.associationToken&&(w=n.associationToken);const k={username:n.username,profile:n.profile,email:n.email,decentralizedID:n.iss,identityAddress:f.getAddressFromDID(n.iss),appPrivateKey:o,coreSessionToken:v,authResponseToken:t,hubUrl:S,gaiaAssociationToken:w},E=n.profile_url;if(!k.profile&&E){const e=yield c.fetchPrivate(E);if(e.ok){const t=yield e.text(),r=JSON.parse(t),n=p.extractProfile(r[0].token);k.profile=n}else k.profile=Object.assign({},_)}else k.profile=n.profile;const x=yield i.store.getSessionData();return x.userData=k,i.store.setSessionData(x),k})}},function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a=r(455),s=r(456),u=r(457);function c(e,t){return t.encode?t.strict?a(e):encodeURIComponent(e):e}function f(e,t){return t.decode?s(e):e}function l(e){var t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function h(e){var t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function d(e,t){var r=function(e){var t;switch(e.arrayFormat){case"index":return function(e,r,n){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return function(e,r,n){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":return function(e,t,r){var n="string"==typeof t&&t.split("").indexOf(",")>-1?t.split(","):t;r[e]=n};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",parseNumbers:!1,parseBooleans:!1},t)),o=Object.create(null);if("string"!=typeof e)return o;if(!(e=e.trim().replace(/^[?#&]/,"")))return o;var a=!0,s=!1,c=void 0;try{for(var l,h=e.split("&")[Symbol.iterator]();!(a=(l=h.next()).done);a=!0){var d=l.value,p=n(u(d.replace(/\+/g," "),"="),2),y=p[0],b=p[1];b=void 0===b?null:f(b,t),t.parseNumbers&&!Number.isNaN(Number(b))&&"string"==typeof b&&""!==b.trim()?b=Number(b):!t.parseBooleans||null===b||"true"!==b.toLowerCase()&&"false"!==b.toLowerCase()||(b="true"===b.toLowerCase()),r(f(y,t),b,o)}}catch(e){s=!0,c=e}finally{try{a||null==h.return||h.return()}finally{if(s)throw c}}return!1===t.sort?o:(!0===t.sort?Object.keys(o).sort():Object.keys(o).sort(t.sort)).reduce(function(e,t){var r=o[t];return Boolean(r)&&"object"===i(r)&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"===i(t)?e(Object.keys(t)).sort(function(e,t){return Number(e)-Number(t)}).map(function(e){return t[e]}):t}(r):e[t]=r,e},Object.create(null))}t.extract=h,t.parse=d,t.stringify=function(e,t){if(!e)return"";var r=function(e){switch(e.arrayFormat){case"index":return function(t){return function(r,n){var i=r.length;return void 0===n?r:[].concat(o(r),null===n?[[c(t,e),"[",i,"]"].join("")]:[[c(t,e),"[",c(i,e),"]=",c(n,e)].join("")])}};case"bracket":return function(t){return function(r,n){return void 0===n?r:[].concat(o(r),null===n?[[c(t,e),"[]"].join("")]:[[c(t,e),"[]=",c(n,e)].join("")])}};case"comma":return function(t){return function(r,n,i){return null==n||0===n.length?r:0===i?[[c(t,e),"=",c(n,e)].join("")]:[[r,c(n,e)].join(",")]}};default:return function(t){return function(r,n){return void 0===n?r:[].concat(o(r),null===n?[c(t,e)]:[[c(t,e),"=",c(n,e)].join("")])}}}}(t=Object.assign({encode:!0,strict:!0,arrayFormat:"none"},t)),n=Object.keys(e);return!1!==t.sort&&n.sort(t.sort),n.map(function(n){var i=e[n];return void 0===i?"":null===i?c(n,t):Array.isArray(i)?i.reduce(r(n),[]).join("&"):c(n,t)+"="+c(i,t)}).filter(function(e){return e.length>0}).join("&")},t.parseUrl=function(e,t){return{url:l(e).split("?")[0]||"",query:d(h(e),t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(31),i=r(75),o=r(41),a=r(9),s=r(17),u=r(198);function c(e){const t=n.decodeToken(e).payload.public_keys;if(1!==t.length)throw new Error("Multiple public keys are not supported");{const r=t[0];try{return!!new n.TokenVerifier("ES256k",r).verify(e)}catch(e){return!1}}}function f(e){const t=n.decodeToken(e).payload,r=t.public_keys,a=i.getAddressFromDID(t.iss);if(1!==r.length)throw new Error("Multiple public keys are not supported");if(o.publicKeyToAddress(r[0])===a)return!0;return!1}function l(e,t){return Promise.resolve().then(()=>{const r=n.decodeToken(e).payload;if(!r.username)return!0;if(null===r.username)return!0;if(null===t)return!1;const o=r.username,a=`${t.replace(/\/$/,"")}/${o}`;return s.fetchPrivate(a).then(e=>e.text()).then(e=>{const t=JSON.parse(e);if(t.hasOwnProperty("address")){return t.address===i.getAddressFromDID(r.iss)}return!1})}).catch(()=>!1)}function h(e){const t=n.decodeToken(e).payload;if(t.iat){if("number"!=typeof t.iat)return!1;const e=new Date(1e3*t.iat);return!((new Date).getTime()<e.getTime())}return!0}function d(e){const t=n.decodeToken(e).payload;if(t.exp){if("number"!=typeof t.exp)return!1;const e=new Date(1e3*t.exp);return!((new Date).getTime()>e.getTime())}return!0}function p(e){const t=n.decodeToken(e).payload;return a.isSameOriginAbsoluteUrl(t.domain_name,t.manifest_uri)}function y(e){const t=n.decodeToken(e).payload;return a.isSameOriginAbsoluteUrl(t.domain_name,t.redirect_uri)}function b(e){return Promise.resolve().then(()=>{if("none"===n.decodeToken(e).header.alg)throw new Error("Token must be signed in order to be verified")}).then(()=>Promise.all([d(e),h(e),c(e),f(e),p(e),y(e)])).then(e=>!!e.every(Boolean))}t.doSignaturesMatchPublicKeys=c,t.doPublicKeysMatchIssuer=f,t.doPublicKeysMatchUsername=l,t.isIssuanceDateValid=h,t.isExpirationDateValid=d,t.isManifestUriValid=p,t.isRedirectUriValid=y,t.verifyAuthRequest=b,t.verifyAuthRequestAndLoadManifest=function(e){return Promise.resolve().then(()=>b(e).then(t=>t?u.fetchAppManifest(e):Promise.reject()))},t.verifyAuthResponse=function(e,t){return Promise.all([d(e),h(e),c(e),f(e),l(e,t)]).then(e=>!!e.every(Boolean))}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(196)),o=r(31),a=r(9),s=r(17),u=r(20);t.getAuthRequestFromURL=function(){const e=a.getGlobalObject("location",{throwIfUnavailable:!0,usageDesc:"getAuthRequestFromURL"}),t=i.default.parse(e.search);return t.authRequest?t.authRequest.split(`${a.BLOCKSTACK_HANDLER}:`).join(""):null},t.fetchAppManifest=function(e){return new Promise((t,r)=>{if(e){const n=o.decodeToken(e).payload.manifest_uri;try{u.Logger.debug(`Fetching manifest from ${n}`),s.fetchPrivate(n).then(e=>e.text()).then(e=>JSON.parse(e)).then(e=>{t(Object.assign({},e,{manifestURI:n}))}).catch(e=>{u.Logger.debug(e.stack),r("Could not fetch manifest.json")})}catch(e){u.Logger.debug(e.stack),r("Could not fetch manifest.json")}}else r("Invalid auth request")})},t.redirectUserToApp=function(e,t){let r=o.decodeToken(e).payload.redirect_uri;if(u.Logger.debug(r),!r)throw new Error("Invalid redirect URI");r=a.updateQueryStringParameter(r,"authResponse",t),a.getGlobalObject("location",{throwIfUnavailable:!0,usageDesc:"redirectUserToApp"}).href=r}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const i=r(200);t.connectToGaiaHub=i.connectToGaiaHub,t.uploadToGaiaHub=i.uploadToGaiaHub,t.BLOCKSTACK_GAIA_HUB_LABEL=i.BLOCKSTACK_GAIA_HUB_LABEL;const o=r(120),a=r(41),s=r(201),u=r(19),c=r(20),f=r(76),l=r(9),h=r(17),d=".sig";function p(e,t,r,i){return n(this,void 0,void 0,function*(){const n=yield s.lookupProfile(t,i);let o=null;if(n.hasOwnProperty("apps")&&n.apps.hasOwnProperty(r)){o=`${n.apps[r].replace(/\/?(\?|#|$)/,"/$1")}${e}`}return o})}function y(e,t,r){return n(this,void 0,void 0,function*(){const n=Object.assign({},t);if(!n.publicKey){const e=r||new f.UserSession,t=(yield e.loadUserData()).appPrivateKey;n.publicKey=a.getPublicKeyFromPrivate(t)}const i=o.encryptECIES(n.publicKey,e);return JSON.stringify(i)})}function b(e,t,r,o){return n(this,void 0,void 0,function*(){const n=m({app:e,username:t},o);let a;if(t)a=yield p("/",n.username,n.app,r);else{o||(o=new f.UserSession);const e=yield o.getOrSetLocalGaiaHubConnection();a=yield i.getFullReadUrl("/",e)}const s=a.match(/([13][a-km-zA-HJ-NP-Z0-9]{26,35})/);if(!s)throw new Error("Failed to parse gaia address");return s[s.length-1]})}function m(e,t){const r=Object.assign({},e);if(r.username&&!r.app){const e=(t||new f.UserSession).appConfig;if(!e)throw new u.InvalidStateError("Missing AppConfig");r.app=e.appDomain}return r}function g(e,t,r){return n(this,void 0,void 0,function*(){const n=m(t,r);let o;if(n.username)o=yield p(e,n.username,n.app,n.zoneFileLookupURL);else{const t=yield(r||new f.UserSession).getOrSetLocalGaiaHubConnection();o=yield i.getFullReadUrl(e,t)}if(o)return o;throw new Error("Missing readURL")})}function v(e,t,r,n,i,o){return Promise.resolve().then(()=>{return g(e,{app:t,username:r,zoneFileLookupURL:n},o)}).then(e=>h.fetchPrivate(e)).then(t=>{if(200!==t.status){if(404===t.status)return c.Logger.debug(`getFile ${e} returned 404, returning null`),null;throw new Error(`getFile ${e} failed with HTTP status ${t.status}`)}const r=t.headers.get("Content-Type");return i||null===r||r.startsWith("text")||"application/json"===r?t.text():t.arrayBuffer()})}t.getUserAppFileUrl=p,t.encryptContent=y,t.decryptContent=function(e,t,r){return n(this,void 0,void 0,function*(){const n=Object.assign({},t);if(!n.privateKey){const e=r||new f.UserSession,t=yield e.loadUserData();n.privateKey=t.appPrivateKey}try{const t=JSON.parse(e);return o.decryptECIES(n.privateKey,t)}catch(e){throw e instanceof SyntaxError?new Error("Failed to parse encrypted content JSON. The content may not be encrypted. If using getFile, try passing { decrypt: false }."):e}})},t.getFileUrl=g,t.getFile=function(e,t,r){const i={decrypt:!0,verify:!1,username:null,app:l.getGlobalObject("location",{returnEmptyObject:!0}).origin,zoneFileLookupURL:null},s=Object.assign({},i,t);return r||(r=new f.UserSession),s.verify&&!s.decrypt?function(e,t,r){return Promise.all([v(e,t.app,t.username,t.zoneFileLookupURL,!1,r),v(`${e}${d}`,t.app,t.username,t.zoneFileLookupURL,!0,r),b(t.app,t.username,t.zoneFileLookupURL,r)]).then(([t,r,n])=>{if(!t)return t;if(!n)throw new u.SignatureVerificationError("Failed to get gaia address for verification of: "+`${e}`);if(!r||"string"!=typeof r)throw new u.SignatureVerificationError("Failed to obtain signature for file: "+`${e} -- looked in ${e}${d}`);let i,s;try{const t=JSON.parse(r);i=t.signature,s=t.publicKey}catch(t){throw t instanceof SyntaxError?new Error("Failed to parse signature content JSON "+`(path: ${e}${d})`+" The content may be corrupted."):t}const c=a.publicKeyToAddress(s);if(n!==c)throw new u.SignatureVerificationError(`Signer pubkey address (${c}) doesn't`+` match gaia address (${n})`);if(o.verifyECDSA(t,s,i))return t;throw new u.SignatureVerificationError("Contents do not match ECDSA signature: "+`path: ${e}, signature: ${e}${d}`)})}(e,s,r):v(e,s.app,s.username,s.zoneFileLookupURL,!!s.decrypt,r).then(t=>{if(null===t)return t;if(s.decrypt&&!s.verify){if("string"!=typeof t)throw new Error("Expected to get back a string for the cipherText");return r.decryptContent(t)}if(s.decrypt&&s.verify){if("string"!=typeof t)throw new Error("Expected to get back a string for the cipherText");return function(e,t,r,i,s,c){return n(this,void 0,void 0,function*(){const n=(yield e.loadUserData()).appPrivateKey,f=a.getPublicKeyFromPrivate(n);let l;if(s)l=b(i,s,c,e);else{const e=a.publicKeyToAddress(f);l=Promise.resolve(e)}return l.then(n=>{if(!n)throw new u.SignatureVerificationError("Failed to get gaia address for verification of: "+`${t}`);let i;try{i=JSON.parse(r)}catch(e){throw e instanceof SyntaxError?new Error("Failed to parse encrypted, signed content JSON. The content may not be encrypted. If using getFile, try passing { verify: false, decrypt: false }."):e}const s=i.signature,c=i.publicKey,f=i.cipherText,l=a.publicKeyToAddress(c);if(c&&f&&s){if(l!==n)throw new u.SignatureVerificationError(`Signer pubkey address (${l}) doesn't`+` match gaia address (${n})`);if(o.verifyECDSA(f,c,s))return e.decryptContent(f);throw new u.SignatureVerificationError("Contents do not match ECDSA signature in file:"+` ${t}`)}throw new u.SignatureVerificationError("Failed to get signature verification data from file:"+` ${t}`)})})}(r,e,t,s.app,s.username,s.zoneFileLookupURL)}if(s.verify||s.decrypt)throw new Error("Should be unreachable.");return t})},t.putFile=function(e,t,r,s){return n(this,void 0,void 0,function*(){const n=Object.assign({},{encrypt:!0,sign:!1,contentType:""},r);let{contentType:u}=n;u||(u="string"==typeof t?"text/plain; charset=utf-8":"application/octet-stream"),s||(s=new f.UserSession);let c="",l="";if(n.sign&&(c="string"==typeof n.sign?n.sign:(yield s.loadUserData()).appPrivateKey),n.encrypt&&("string"==typeof n.encrypt?l=n.encrypt:(c||(c=(yield s.loadUserData()).appPrivateKey),l=a.getPublicKeyFromPrivate(c))),!n.encrypt&&n.sign){const r=o.signECDSA(c,t),n=JSON.stringify(r),a=yield s.getOrSetLocalGaiaHubConnection();try{return(yield Promise.all([i.uploadToGaiaHub(e,t,a,u),i.uploadToGaiaHub(`${e}${d}`,n,a,"application/json")]))[0]}catch(r){const o=yield s.setLocalGaiaHubConnection();return(yield Promise.all([i.uploadToGaiaHub(e,t,o,u),i.uploadToGaiaHub(`${e}${d}`,n,o,"application/json")]))[0]}}if(n.encrypt&&!n.sign)t=yield y(t,{publicKey:l}),u="application/json";else if(n.encrypt&&n.sign){const e=yield y(t,{publicKey:l}),r=o.signECDSA(c,e),n={signature:r.signature,publicKey:r.publicKey,cipherText:e};t=JSON.stringify(n),u="application/json"}const h=yield s.getOrSetLocalGaiaHubConnection();try{return yield i.uploadToGaiaHub(e,t,h,u)}catch(r){const n=yield s.setLocalGaiaHubConnection();return yield i.uploadToGaiaHub(e,t,n,u)}})},t.deleteFile=function(e,t,r){return n(this,void 0,void 0,function*(){r||(r=new f.UserSession);const n=yield r.getOrSetLocalGaiaHubConnection();if(Object.assign({},t).wasSigned)try{yield i.deleteFromGaiaHub(e,n),yield i.deleteFromGaiaHub(`${e}${d}`,n)}catch(t){const o=yield r.setLocalGaiaHubConnection();yield i.deleteFromGaiaHub(e,o),yield i.deleteFromGaiaHub(`${e}${d}`,n)}else try{yield i.deleteFromGaiaHub(e,n)}catch(t){const n=yield r.setLocalGaiaHubConnection();yield i.deleteFromGaiaHub(e,n)}})},t.getAppBucketUrl=function(e,t){return i.getBucketUrl(e,t)},t.listFiles=function(e,t){return function e(t,r,i,o,a,s){return n(this,void 0,void 0,function*(){if(o>65536)throw new Error("Too many entries to list");let n;r=r||(yield t.getOrSetLocalGaiaHubConnection());try{const a=JSON.stringify({page:i}),u={method:"POST",headers:{"Content-Type":"application/json","Content-Length":`${a.length}`,Authorization:`bearer ${r.token}`},body:a};if(!(n=yield h.fetchPrivate(`${r.server}/list-files/${r.address}`,u)).ok)throw new Error(`listFiles failed with HTTP status ${n.status}`)}catch(r){if(0===o){const r=yield t.setLocalGaiaHubConnection();return e(t,r,i,o+1,0,s)}throw r}const u=yield n.text(),c=JSON.parse(u),f=c.entries,l=c.page;if(null==f)throw new Error("Bad listFiles response: no entries");for(let e=0;e<f.length;e++)if(!s(f[e]))return a+e;return l&&f.length>0?e(t,r,l,o+1,a+f.length,s):a+f.length})}(t=t||new f.UserSession,null,null,0,0,e)}},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(23),a=i(r(37)),s=r(31),u=r(9),c=r(17),f=r(41),l=r(20),h=r(19);function d(t,r,n,i){const c=t.challenge_text,l=t.latest_auth_version&&parseInt(t.latest_auth_version.slice(1),10)>=1,h=f.getPublicKeyFromPrivate(r);if(!l)return function(t,r){let n;try{n=JSON.parse(t)}catch(e){throw new Error("Failed in parsing legacy challenge text from the gaia hub.")}if("gaiahub"===n[0]&&"blockstack_storage_please_sign"===n[3]){const n=u.hexStringToECPair(r+(64===r.length?"01":"")),i=o.crypto.sha256(e.from(t)),a=n.sign(i),s=o.script.signature.encode(a,o.Transaction.SIGHASH_NONE).toString("hex").slice(0,-2),c=f.getPublicKeyFromPrivate(r);return e.from(JSON.stringify({publickey:c,signature:s})).toString("base64")}throw new Error("Failed to connect to legacy gaia hub. If you operate this hub, please update.")}(c,r);const d={gaiaChallenge:c,hubUrl:n,iss:h,salt:a.default.randomBytes(16).toString("hex"),associationToken:i};return`v1:${new s.TokenSigner("ES256K",r).sign(d)}`}t.BLOCKSTACK_GAIA_HUB_LABEL="blockstack-gaia-hub-config",t.uploadToGaiaHub=function(e,t,r,i="application/octet-stream"){return n(this,void 0,void 0,function*(){l.Logger.debug(`uploadToGaiaHub: uploading ${e} to ${r.server}`);const n=yield c.fetchPrivate(`${r.server}/store/${r.address}/${e}`,{method:"POST",headers:{"Content-Type":i,Authorization:`bearer ${r.token}`},body:t});if(!n.ok)throw new Error("Error when uploading to Gaia hub");const o=yield n.text();return JSON.parse(o).publicURL})},t.deleteFromGaiaHub=function(e,t){return n(this,void 0,void 0,function*(){l.Logger.debug(`deleteFromGaiaHub: deleting ${e} from ${t.server}`);const r=yield fetch(`${t.server}/delete/${t.address}/${e}`,{method:"DELETE",headers:{Authorization:`bearer ${t.token}`}});if(!r.ok){let e="";try{e=yield r.text()}catch(e){l.Logger.debug(`Error getting bad http response text: ${e}`)}const t="Error deleting file from Gaia hub: "+`${r.status} ${r.statusText}: ${e}`;throw l.Logger.error(t),404===r.status?new h.FileNotFound(t):new Error(t)}})},t.getFullReadUrl=function(e,t){return Promise.resolve(`${t.url_prefix}${t.address}/${e}`)},t.connectToGaiaHub=function(e,t,r){return n(this,void 0,void 0,function*(){l.Logger.debug(`connectToGaiaHub: ${e}/hub_info`);const n=yield c.fetchPrivate(`${e}/hub_info`),i=yield n.json(),o=i.read_url_prefix,a=d(i,t,e,r);return{url_prefix:o,address:u.ecPairToAddress(u.hexStringToECPair(t+(64===t.length?"01":""))),token:a,server:e}})},t.getBucketUrl=function(t,r){return n(this,void 0,void 0,function*(){const n=o.ECPair.fromPrivateKey(e.from(r,"hex")),i=yield c.fetchPrivate(`${t}/hub_info`),a=yield i.text();return`${JSON.parse(a).read_url_prefix}${u.ecPairToAddress(n)}/`})}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(77),i=r(27),o=r(17);t.lookupProfile=function(e,t){if(!e)return Promise.reject();let r;if(t){const n=`${t.replace(/\/$/,"")}/${e}`;r=o.fetchPrivate(n).then(e=>e.json())}else r=i.config.network.getNameInfo(e);return r.then(e=>{if(e.hasOwnProperty("zonefile")&&e.hasOwnProperty("address"))return n.resolveZoneFileToProfile(e.zonefile,e.address);throw new Error("Invalid zonefile lookup response: did not contain `address` or `zonefile` field")})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"makeZoneFile",{enumerable:!0,get:function(){return n.makeZoneFile}}),Object.defineProperty(t,"parseZoneFile",{enumerable:!0,get:function(){return i.parseZoneFile}}),Object.defineProperty(t,"ZoneFile",{enumerable:!0,get:function(){return o.ZoneFile}});var n=r(203),i=r(204),o=r(460)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeZoneFile=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,n.getZoneFileTemplate)();return t=function(e,t){var r="";return void 0!==e&&(r+="$ORIGIN "+e),t.replace("{$origin}",r)}(e.$origin,t),t=function(e,t){var r="";return void 0!==e&&(r+="$TTL "+e),t.replace("{$ttl}",r)}(e.$ttl,t),t=function(e,t){var r=t;if(void 0!==e)for(var n in e.name=e.name||"@",e.ttl=e.ttl||"",e){var i=e[n];r=r.replace("{"+n+"}",i+"\t")}return r}(e.soa,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tNS\t"+u.host+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{ns}",r)}(e.ns,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tA\t"+u.ip+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{a}",r)}(e.a,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tAAAA\t"+u.ip+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{aaaa}",r)}(e.aaaa,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tCNAME\t"+u.alias+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{cname}",r)}(e.cname,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tMX\t"+u.preference+"\t"+u.host+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{mx}",r)}(e.mx,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tPTR\t"+u.host+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{ptr}",r)}(e.ptr,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tTXT\t";var c=u.txt;"string"==typeof c?r+='"'+c+'"':c instanceof Array&&(r+=c.map(function(e){return'"'+e+'"'}).join(" ")),r+="\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{txt}",r)}(e.txt,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tSRV\t"+u.priority+"\t",r+=u.weight+"\t",r+=u.port+"\t",r+=u.target+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{srv}",r)}(e.srv,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tSPF\t"+u.data+"\n"}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{spf}",r)}(e.spf,t),t=function(e,t){var r="";if(e){var n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;r+=(u.name||"@")+"\t",u.ttl&&(r+=u.ttl+"\t"),r+="IN\tURI\t"+u.priority+"\t",r+=u.weight+"\t",r+='"'+u.target+'"\n'}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}}return t.replace("{uri}",r)}(e.uri,t),(t=function(e,t){t=(t=t.replace("{zone}",e.$origin||!!e.soa&&e.soa.name||"")).replace("{datetime}",(new Date).toISOString());var r=Math.round(Date.now()/1e3);return t.replace("{time}","".concat(r))}(e,t)).replace(/\n{2,}/gim,"\n\n")};var n=r(459)},function(e,t,r){"use strict";function n(e){var t={},r=e.trim().split(/\s+/g),n=r.length;return t.name=r[0],t.minimum=parseInt(r[n-1],10),t.expire=parseInt(r[n-2],10),t.retry=parseInt(r[n-3],10),t.refresh=parseInt(r[n-4],10),t.serial=parseInt(r[n-5],10),t.rname=r[n-6],t.mname=r[n-7],isNaN(r[1])||(t.ttl=parseInt(r[1],10)),t}function i(e){var t=e.trim().split(/\s+/g),r=t.length,n={name:t[0],host:t[r-1]};return isNaN(t[1])||(n.ttl=parseInt(t[1],10)),n}function o(e,t){var r=e.trim().split(/\s+/g),n=e.trim().toUpperCase().split(/\s+/g),i=r.length,o={name:r[0],ip:r[i-1]};return 0===n.lastIndexOf("A")&&(t.length?o.name=t[t.length-1].name:o.name="@"),isNaN(r[1])||(o.ttl=parseInt(r[1],10)),o}function a(e){var t=e.trim().split(/\s+/g),r=t.length,n={name:t[0],ip:t[r-1]};return isNaN(t[1])||(n.ttl=parseInt(t[1],10)),n}function s(e){var t=e.trim().split(/\s+/g),r=t.length,n={name:t[0],alias:t[r-1]};return isNaN(t[1])||(n.ttl=parseInt(t[1],10)),n}function u(e){var t=e.trim().split(/\s+/g),r=t.length,n={name:t[0],preference:parseInt(t[r-2],10),host:t[r-1]};return isNaN(t[1])||(n.ttl=parseInt(t[1],10)),n}function c(e){var t=e.trim().match(/[^\s\"']+|\"[^\"]*\"|'[^']*'/g);if(!t)throw new Error("Failure to tokenize TXT record");var r,n=t.length,i=t.indexOf("TXT");function o(e){return e.indexOf('"')>-1&&(e=e.split('"')[1]),e.indexOf('"')>-1&&(e=e.split('"')[1]),e}r=n-i-1>1?t.slice(i+1).map(o):o(t[n-1]);var a={name:t[0],txt:r};return isNaN(t[1])||(a.ttl=parseInt(t[1],10)),a}function f(e,t,r){var n=e.trim().split(/\s+/g);0===e.trim().toUpperCase().split(/\s+/g).lastIndexOf("PTR")&&t[t.length-1]&&n.unshift(t[t.length-1].name);var i=n.length,o={name:n[0],fullname:n[0]+"."+r,host:n[i-1]};return isNaN(n[1])||(o.ttl=parseInt(n[1],10)),o}function l(e){var t=e.trim().split(/\s+/g),r=t.length,n={name:t[0],target:t[r-1],priority:parseInt(t[r-4],10),weight:parseInt(t[r-3],10),port:parseInt(t[r-2],10)};return isNaN(t[1])||(n.ttl=parseInt(t[1],10)),n}function h(e){for(var t=e.trim().split(/\s+/g),r={name:t[0],data:""},n=t.length;n-- >4;)r.data=t[n]+" "+r.data.trim();return isNaN(t[1])||(r.ttl=parseInt(t[1],10)),r}function d(e){var t=e.trim().split(/\s+/g),r=t.length,n={name:t[0],target:t[r-1].replace(/"/g,""),priority:parseInt(t[r-3],10),weight:parseInt(t[r-2],10)};return isNaN(t[1])||(n.ttl=parseInt(t[1],10)),n}Object.defineProperty(t,"__esModule",{value:!0}),t.parseZoneFile=function(e){return function(e){var t={},r=e.split("\n"),p=!0,y=!1,b=void 0;try{for(var m,g=r[Symbol.iterator]();!(p=(m=g.next()).done);p=!0){var v=m.value;if(v&&v.trim()){var _=v.toUpperCase();/\s+TXT\s+/.test(_)?(t.txt=t.txt||[],t.txt.push(c(v))):0===_.indexOf("$ORIGIN")?t.$origin=v.split(/\s+/g)[1]:0===_.indexOf("$TTL")?t.$ttl=parseInt(v.split(/\s+/g)[1],10):/\s+SOA\s+/.test(_)?t.soa=n(v):/\s+NS\s+/.test(_)?(t.ns=t.ns||[],t.ns.push(i(v))):/\s+A\s+/.test(_)?(t.a=t.a||[],t.a.push(o(v,t.a))):/\s+AAAA\s+/.test(_)?(t.aaaa=t.aaaa||[],t.aaaa.push(a(v))):/\s+CNAME\s+/.test(_)?(t.cname=t.cname||[],t.cname.push(s(v))):/\s+MX\s+/.test(_)?(t.mx=t.mx||[],t.mx.push(u(v))):/\s+PTR\s+/.test(_)?(t.ptr=t.ptr||[],t.ptr.push(f(v,t.ptr,t.$origin))):/\s+SRV\s+/.test(_)?(t.srv=t.srv||[],t.srv.push(l(v))):/\s+SPF\s+/.test(_)?(t.spf=t.spf||[],t.spf.push(h(v))):/\s+URI\s+/.test(_)&&(t.uri=t.uri||[],t.uri.push(d(v)))}}}catch(e){y=!0,b=e}finally{try{p||null==g.return||g.return()}finally{if(y)throw b}}return t}(e=function(e){for(var t=[],r=/\([\s\S]*?\)/gim,n=r.exec(e);null!==n;){var i=n[0].replace(/\s+/gm," ");t.push({match:n,replacement:i}),n=r.exec(e)}for(var o=e.split(""),a=0,s=t;a<s.length;a++){var u=s[a],c=u.match,f=u.replacement;o.splice(c.index,c[0].length,f)}return o.join("").replace(/\(|\)/gim," ")}(e=function(e){return e.replace(/(^|[^\\]);.*/g,function(e,t){return t||""})}(e)))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(463);t.validateProofs=function(e,t,r=null){if(!e)throw new Error("Profile must not be null");let i=[];const o=[];return e.hasOwnProperty("account")?((i=e.account).forEach(e=>{if(e.hasOwnProperty("service")&&!n.profileServices.hasOwnProperty(e.service))return;if(!e.hasOwnProperty("proofType")||"http"!==e.proofType||!e.hasOwnProperty("proofUrl"))return;const i={service:e.service,proof_url:e.proofUrl,identifier:e.identifier,valid:!1};o.push(n.profileServices[e.service].validateProof(i,t,r))}),Promise.all(o)):Promise.resolve([])}},function(e,t,r){var n=r(207),i={input:!0,option:!0,optgroup:!0,select:!0,button:!0,datalist:!0,textarea:!0},o={tr:{tr:!0,th:!0,td:!0},th:{th:!0},td:{thead:!0,th:!0,td:!0},body:{head:!0,link:!0,script:!0},li:{li:!0},p:{p:!0},h1:{p:!0},h2:{p:!0},h3:{p:!0},h4:{p:!0},h5:{p:!0},h6:{p:!0},select:i,input:i,output:i,button:i,datalist:i,textarea:i,option:{option:!0},optgroup:{optgroup:!0}},a={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},s={__proto__:null,math:!0,svg:!0},u={__proto__:null,mi:!0,mo:!0,mn:!0,ms:!0,mtext:!0,"annotation-xml":!0,foreignObject:!0,desc:!0,title:!0},c=/\s|\//;function f(e,t){this._options=t||{},this._cbs=e||{},this._tagname="",this._attribname="",this._attribvalue="",this._attribs=null,this._stack=[],this._foreignContext=[],this.startIndex=0,this.endIndex=null,this._lowerCaseTagNames="lowerCaseTags"in this._options?!!this._options.lowerCaseTags:!this._options.xmlMode,this._lowerCaseAttributeNames="lowerCaseAttributeNames"in this._options?!!this._options.lowerCaseAttributeNames:!this._options.xmlMode,this._options.Tokenizer&&(n=this._options.Tokenizer),this._tokenizer=new n(this._options,this),this._cbs.onparserinit&&this._cbs.onparserinit(this)}r(2)(f,r(60).EventEmitter),f.prototype._updatePosition=function(e){null===this.endIndex?this._tokenizer._sectionStart<=e?this.startIndex=0:this.startIndex=this._tokenizer._sectionStart-e:this.startIndex=this.endIndex+1,this.endIndex=this._tokenizer.getAbsoluteIndex()},f.prototype.ontext=function(e){this._updatePosition(1),this.endIndex--,this._cbs.ontext&&this._cbs.ontext(e)},f.prototype.onopentagname=function(e){if(this._lowerCaseTagNames&&(e=e.toLowerCase()),this._tagname=e,!this._options.xmlMode&&e in o)for(var t;(t=this._stack[this._stack.length-1])in o[e];this.onclosetag(t));!this._options.xmlMode&&e in a||(this._stack.push(e),e in s?this._foreignContext.push(!0):e in u&&this._foreignContext.push(!1)),this._cbs.onopentagname&&this._cbs.onopentagname(e),this._cbs.onopentag&&(this._attribs={})},f.prototype.onopentagend=function(){this._updatePosition(1),this._attribs&&(this._cbs.onopentag&&this._cbs.onopentag(this._tagname,this._attribs),this._attribs=null),!this._options.xmlMode&&this._cbs.onclosetag&&this._tagname in a&&this._cbs.onclosetag(this._tagname),this._tagname=""},f.prototype.onclosetag=function(e){if(this._updatePosition(1),this._lowerCaseTagNames&&(e=e.toLowerCase()),(e in s||e in u)&&this._foreignContext.pop(),!this._stack.length||e in a&&!this._options.xmlMode)this._options.xmlMode||"br"!==e&&"p"!==e||(this.onopentagname(e),this._closeCurrentTag());else{var t=this._stack.lastIndexOf(e);if(-1!==t)if(this._cbs.onclosetag)for(t=this._stack.length-t;t--;)this._cbs.onclosetag(this._stack.pop());else this._stack.length=t;else"p"!==e||this._options.xmlMode||(this.onopentagname(e),this._closeCurrentTag())}},f.prototype.onselfclosingtag=function(){this._options.xmlMode||this._options.recognizeSelfClosing||this._foreignContext[this._foreignContext.length-1]?this._closeCurrentTag():this.onopentagend()},f.prototype._closeCurrentTag=function(){var e=this._tagname;this.onopentagend(),this._stack[this._stack.length-1]===e&&(this._cbs.onclosetag&&this._cbs.onclosetag(e),this._stack.pop())},f.prototype.onattribname=function(e){this._lowerCaseAttributeNames&&(e=e.toLowerCase()),this._attribname=e},f.prototype.onattribdata=function(e){this._attribvalue+=e},f.prototype.onattribend=function(){this._cbs.onattribute&&this._cbs.onattribute(this._attribname,this._attribvalue),this._attribs&&!Object.prototype.hasOwnProperty.call(this._attribs,this._attribname)&&(this._attribs[this._attribname]=this._attribvalue),this._attribname="",this._attribvalue=""},f.prototype._getInstructionName=function(e){var t=e.search(c),r=t<0?e:e.substr(0,t);return this._lowerCaseTagNames&&(r=r.toLowerCase()),r},f.prototype.ondeclaration=function(e){if(this._cbs.onprocessinginstruction){var t=this._getInstructionName(e);this._cbs.onprocessinginstruction("!"+t,"!"+e)}},f.prototype.onprocessinginstruction=function(e){if(this._cbs.onprocessinginstruction){var t=this._getInstructionName(e);this._cbs.onprocessinginstruction("?"+t,"?"+e)}},f.prototype.oncomment=function(e){this._updatePosition(4),this._cbs.oncomment&&this._cbs.oncomment(e),this._cbs.oncommentend&&this._cbs.oncommentend()},f.prototype.oncdata=function(e){this._updatePosition(1),this._options.xmlMode||this._options.recognizeCDATA?(this._cbs.oncdatastart&&this._cbs.oncdatastart(),this._cbs.ontext&&this._cbs.ontext(e),this._cbs.oncdataend&&this._cbs.oncdataend()):this.oncomment("[CDATA["+e+"]]")},f.prototype.onerror=function(e){this._cbs.onerror&&this._cbs.onerror(e)},f.prototype.onend=function(){if(this._cbs.onclosetag)for(var e=this._stack.length;e>0;this._cbs.onclosetag(this._stack[--e]));this._cbs.onend&&this._cbs.onend()},f.prototype.reset=function(){this._cbs.onreset&&this._cbs.onreset(),this._tokenizer.reset(),this._tagname="",this._attribname="",this._attribs=null,this._stack=[],this._cbs.onparserinit&&this._cbs.onparserinit(this)},f.prototype.parseComplete=function(e){this.reset(),this.end(e)},f.prototype.write=function(e){this._tokenizer.write(e)},f.prototype.end=function(e){this._tokenizer.end(e)},f.prototype.pause=function(){this._tokenizer.pause()},f.prototype.resume=function(){this._tokenizer.resume()},f.prototype.parseChunk=f.prototype.write,f.prototype.done=f.prototype.end,e.exports=f},function(e,t,r){e.exports=be;var n=r(208),i=r(123),o=r(209),a=r(124),s=0,u=s++,c=s++,f=s++,l=s++,h=s++,d=s++,p=s++,y=s++,b=s++,m=s++,g=s++,v=s++,_=s++,w=s++,S=s++,k=s++,E=s++,x=s++,A=s++,O=s++,P=s++,T=s++,I=s++,j=s++,M=s++,B=s++,N=s++,C=s++,D=s++,U=s++,R=s++,F=s++,L=s++,z=s++,q=s++,H=s++,K=s++,$=s++,V=s++,G=s++,W=s++,X=s++,J=s++,Z=s++,Y=s++,Q=s++,ee=s++,te=s++,re=s++,ne=s++,ie=s++,oe=s++,ae=s++,se=s++,ue=s++,ce=0,fe=ce++,le=ce++,he=ce++;function de(e){return" "===e||"\n"===e||"\t"===e||"\f"===e||"\r"===e}function pe(e,t,r){var n=e.toLowerCase();return e===n?function(e){e===n?this._state=t:(this._state=r,this._index--)}:function(i){i===n||i===e?this._state=t:(this._state=r,this._index--)}}function ye(e,t){var r=e.toLowerCase();return function(n){n===r||n===e?this._state=t:(this._state=f,this._index--)}}function be(e,t){this._state=u,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=u,this._special=fe,this._cbs=t,this._running=!0,this._ended=!1,this._xmlMode=!(!e||!e.xmlMode),this._decodeEntities=!(!e||!e.decodeEntities)}be.prototype._stateText=function(e){"<"===e?(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._state=c,this._sectionStart=this._index):this._decodeEntities&&this._special===fe&&"&"===e&&(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._baseState=u,this._state=ie,this._sectionStart=this._index)},be.prototype._stateBeforeTagName=function(e){"/"===e?this._state=h:"<"===e?(this._cbs.ontext(this._getSection()),this._sectionStart=this._index):">"===e||this._special!==fe||de(e)?this._state=u:"!"===e?(this._state=S,this._sectionStart=this._index+1):"?"===e?(this._state=E,this._sectionStart=this._index+1):(this._state=this._xmlMode||"s"!==e&&"S"!==e?f:R,this._sectionStart=this._index)},be.prototype._stateInTagName=function(e){("/"===e||">"===e||de(e))&&(this._emitToken("onopentagname"),this._state=y,this._index--)},be.prototype._stateBeforeCloseingTagName=function(e){de(e)||(">"===e?this._state=u:this._special!==fe?"s"===e||"S"===e?this._state=F:(this._state=u,this._index--):(this._state=d,this._sectionStart=this._index))},be.prototype._stateInCloseingTagName=function(e){(">"===e||de(e))&&(this._emitToken("onclosetag"),this._state=p,this._index--)},be.prototype._stateAfterCloseingTagName=function(e){">"===e&&(this._state=u,this._sectionStart=this._index+1)},be.prototype._stateBeforeAttributeName=function(e){">"===e?(this._cbs.onopentagend(),this._state=u,this._sectionStart=this._index+1):"/"===e?this._state=l:de(e)||(this._state=b,this._sectionStart=this._index)},be.prototype._stateInSelfClosingTag=function(e){">"===e?(this._cbs.onselfclosingtag(),this._state=u,this._sectionStart=this._index+1):de(e)||(this._state=y,this._index--)},be.prototype._stateInAttributeName=function(e){("="===e||"/"===e||">"===e||de(e))&&(this._cbs.onattribname(this._getSection()),this._sectionStart=-1,this._state=m,this._index--)},be.prototype._stateAfterAttributeName=function(e){"="===e?this._state=g:"/"===e||">"===e?(this._cbs.onattribend(),this._state=y,this._index--):de(e)||(this._cbs.onattribend(),this._state=b,this._sectionStart=this._index)},be.prototype._stateBeforeAttributeValue=function(e){'"'===e?(this._state=v,this._sectionStart=this._index+1):"'"===e?(this._state=_,this._sectionStart=this._index+1):de(e)||(this._state=w,this._sectionStart=this._index,this._index--)},be.prototype._stateInAttributeValueDoubleQuotes=function(e){'"'===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=y):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ie,this._sectionStart=this._index)},be.prototype._stateInAttributeValueSingleQuotes=function(e){"'"===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=y):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ie,this._sectionStart=this._index)},be.prototype._stateInAttributeValueNoQuotes=function(e){de(e)||">"===e?(this._emitToken("onattribdata"),this._cbs.onattribend(),this._state=y,this._index--):this._decodeEntities&&"&"===e&&(this._emitToken("onattribdata"),this._baseState=this._state,this._state=ie,this._sectionStart=this._index)},be.prototype._stateBeforeDeclaration=function(e){this._state="["===e?T:"-"===e?x:k},be.prototype._stateInDeclaration=function(e){">"===e&&(this._cbs.ondeclaration(this._getSection()),this._state=u,this._sectionStart=this._index+1)},be.prototype._stateInProcessingInstruction=function(e){">"===e&&(this._cbs.onprocessinginstruction(this._getSection()),this._state=u,this._sectionStart=this._index+1)},be.prototype._stateBeforeComment=function(e){"-"===e?(this._state=A,this._sectionStart=this._index+1):this._state=k},be.prototype._stateInComment=function(e){"-"===e&&(this._state=O)},be.prototype._stateAfterComment1=function(e){this._state="-"===e?P:A},be.prototype._stateAfterComment2=function(e){">"===e?(this._cbs.oncomment(this._buffer.substring(this._sectionStart,this._index-2)),this._state=u,this._sectionStart=this._index+1):"-"!==e&&(this._state=A)},be.prototype._stateBeforeCdata1=pe("C",I,k),be.prototype._stateBeforeCdata2=pe("D",j,k),be.prototype._stateBeforeCdata3=pe("A",M,k),be.prototype._stateBeforeCdata4=pe("T",B,k),be.prototype._stateBeforeCdata5=pe("A",N,k),be.prototype._stateBeforeCdata6=function(e){"["===e?(this._state=C,this._sectionStart=this._index+1):(this._state=k,this._index--)},be.prototype._stateInCdata=function(e){"]"===e&&(this._state=D)},be.prototype._stateAfterCdata1=function(e){this._state="]"===e?U:C},be.prototype._stateAfterCdata2=function(e){">"===e?(this._cbs.oncdata(this._buffer.substring(this._sectionStart,this._index-2)),this._state=u,this._sectionStart=this._index+1):"]"!==e&&(this._state=C)},be.prototype._stateBeforeSpecial=function(e){"c"===e||"C"===e?this._state=L:"t"===e||"T"===e?this._state=J:(this._state=f,this._index--)},be.prototype._stateBeforeSpecialEnd=function(e){this._special!==le||"c"!==e&&"C"!==e?this._special!==he||"t"!==e&&"T"!==e?this._state=u:this._state=ee:this._state=$},be.prototype._stateBeforeScript1=ye("R",z),be.prototype._stateBeforeScript2=ye("I",q),be.prototype._stateBeforeScript3=ye("P",H),be.prototype._stateBeforeScript4=ye("T",K),be.prototype._stateBeforeScript5=function(e){("/"===e||">"===e||de(e))&&(this._special=le),this._state=f,this._index--},be.prototype._stateAfterScript1=pe("R",V,u),be.prototype._stateAfterScript2=pe("I",G,u),be.prototype._stateAfterScript3=pe("P",W,u),be.prototype._stateAfterScript4=pe("T",X,u),be.prototype._stateAfterScript5=function(e){">"===e||de(e)?(this._special=fe,this._state=d,this._sectionStart=this._index-6,this._index--):this._state=u},be.prototype._stateBeforeStyle1=ye("Y",Z),be.prototype._stateBeforeStyle2=ye("L",Y),be.prototype._stateBeforeStyle3=ye("E",Q),be.prototype._stateBeforeStyle4=function(e){("/"===e||">"===e||de(e))&&(this._special=he),this._state=f,this._index--},be.prototype._stateAfterStyle1=pe("Y",te,u),be.prototype._stateAfterStyle2=pe("L",re,u),be.prototype._stateAfterStyle3=pe("E",ne,u),be.prototype._stateAfterStyle4=function(e){">"===e||de(e)?(this._special=fe,this._state=d,this._sectionStart=this._index-5,this._index--):this._state=u},be.prototype._stateBeforeEntity=pe("#",oe,ae),be.prototype._stateBeforeNumericEntity=pe("X",ue,se),be.prototype._parseNamedEntityStrict=function(){if(this._sectionStart+1<this._index){var e=this._buffer.substring(this._sectionStart+1,this._index),t=this._xmlMode?a:i;t.hasOwnProperty(e)&&(this._emitPartial(t[e]),this._sectionStart=this._index+1)}},be.prototype._parseLegacyEntity=function(){var e=this._sectionStart+1,t=this._index-e;for(t>6&&(t=6);t>=2;){var r=this._buffer.substr(e,t);if(o.hasOwnProperty(r))return this._emitPartial(o[r]),void(this._sectionStart+=t+1);t--}},be.prototype._stateInNamedEntity=function(e){";"===e?(this._parseNamedEntityStrict(),this._sectionStart+1<this._index&&!this._xmlMode&&this._parseLegacyEntity(),this._state=this._baseState):(e<"a"||e>"z")&&(e<"A"||e>"Z")&&(e<"0"||e>"9")&&(this._xmlMode||this._sectionStart+1===this._index||(this._baseState!==u?"="!==e&&this._parseNamedEntityStrict():this._parseLegacyEntity()),this._state=this._baseState,this._index--)},be.prototype._decodeNumericEntity=function(e,t){var r=this._sectionStart+e;if(r!==this._index){var i=this._buffer.substring(r,this._index),o=parseInt(i,t);this._emitPartial(n(o)),this._sectionStart=this._index}else this._sectionStart--;this._state=this._baseState},be.prototype._stateInNumericEntity=function(e){";"===e?(this._decodeNumericEntity(2,10),this._sectionStart++):(e<"0"||e>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(2,10),this._index--)},be.prototype._stateInHexEntity=function(e){";"===e?(this._decodeNumericEntity(3,16),this._sectionStart++):(e<"a"||e>"f")&&(e<"A"||e>"F")&&(e<"0"||e>"9")&&(this._xmlMode?this._state=this._baseState:this._decodeNumericEntity(3,16),this._index--)},be.prototype._cleanup=function(){this._sectionStart<0?(this._buffer="",this._bufferOffset+=this._index,this._index=0):this._running&&(this._state===u?(this._sectionStart!==this._index&&this._cbs.ontext(this._buffer.substr(this._sectionStart)),this._buffer="",this._bufferOffset+=this._index,this._index=0):this._sectionStart===this._index?(this._buffer="",this._bufferOffset+=this._index,this._index=0):(this._buffer=this._buffer.substr(this._sectionStart),this._index-=this._sectionStart,this._bufferOffset+=this._sectionStart),this._sectionStart=0)},be.prototype.write=function(e){this._ended&&this._cbs.onerror(Error(".write() after done!")),this._buffer+=e,this._parse()},be.prototype._parse=function(){for(;this._index<this._buffer.length&&this._running;){var e=this._buffer.charAt(this._index);this._state===u?this._stateText(e):this._state===c?this._stateBeforeTagName(e):this._state===f?this._stateInTagName(e):this._state===h?this._stateBeforeCloseingTagName(e):this._state===d?this._stateInCloseingTagName(e):this._state===p?this._stateAfterCloseingTagName(e):this._state===l?this._stateInSelfClosingTag(e):this._state===y?this._stateBeforeAttributeName(e):this._state===b?this._stateInAttributeName(e):this._state===m?this._stateAfterAttributeName(e):this._state===g?this._stateBeforeAttributeValue(e):this._state===v?this._stateInAttributeValueDoubleQuotes(e):this._state===_?this._stateInAttributeValueSingleQuotes(e):this._state===w?this._stateInAttributeValueNoQuotes(e):this._state===S?this._stateBeforeDeclaration(e):this._state===k?this._stateInDeclaration(e):this._state===E?this._stateInProcessingInstruction(e):this._state===x?this._stateBeforeComment(e):this._state===A?this._stateInComment(e):this._state===O?this._stateAfterComment1(e):this._state===P?this._stateAfterComment2(e):this._state===T?this._stateBeforeCdata1(e):this._state===I?this._stateBeforeCdata2(e):this._state===j?this._stateBeforeCdata3(e):this._state===M?this._stateBeforeCdata4(e):this._state===B?this._stateBeforeCdata5(e):this._state===N?this._stateBeforeCdata6(e):this._state===C?this._stateInCdata(e):this._state===D?this._stateAfterCdata1(e):this._state===U?this._stateAfterCdata2(e):this._state===R?this._stateBeforeSpecial(e):this._state===F?this._stateBeforeSpecialEnd(e):this._state===L?this._stateBeforeScript1(e):this._state===z?this._stateBeforeScript2(e):this._state===q?this._stateBeforeScript3(e):this._state===H?this._stateBeforeScript4(e):this._state===K?this._stateBeforeScript5(e):this._state===$?this._stateAfterScript1(e):this._state===V?this._stateAfterScript2(e):this._state===G?this._stateAfterScript3(e):this._state===W?this._stateAfterScript4(e):this._state===X?this._stateAfterScript5(e):this._state===J?this._stateBeforeStyle1(e):this._state===Z?this._stateBeforeStyle2(e):this._state===Y?this._stateBeforeStyle3(e):this._state===Q?this._stateBeforeStyle4(e):this._state===ee?this._stateAfterStyle1(e):this._state===te?this._stateAfterStyle2(e):this._state===re?this._stateAfterStyle3(e):this._state===ne?this._stateAfterStyle4(e):this._state===ie?this._stateBeforeEntity(e):this._state===oe?this._stateBeforeNumericEntity(e):this._state===ae?this._stateInNamedEntity(e):this._state===se?this._stateInNumericEntity(e):this._state===ue?this._stateInHexEntity(e):this._cbs.onerror(Error("unknown _state"),this._state),this._index++}this._cleanup()},be.prototype.pause=function(){this._running=!1},be.prototype.resume=function(){this._running=!0,this._index<this._buffer.length&&this._parse(),this._ended&&this._finish()},be.prototype.end=function(e){this._ended&&this._cbs.onerror(Error(".end() after done!")),e&&this.write(e),this._ended=!0,this._running&&this._finish()},be.prototype._finish=function(){this._sectionStart<this._index&&this._handleTrailingData(),this._cbs.onend()},be.prototype._handleTrailingData=function(){var e=this._buffer.substr(this._sectionStart);this._state===C||this._state===D||this._state===U?this._cbs.oncdata(e):this._state===A||this._state===O||this._state===P?this._cbs.oncomment(e):this._state!==ae||this._xmlMode?this._state!==se||this._xmlMode?this._state!==ue||this._xmlMode?this._state!==f&&this._state!==y&&this._state!==g&&this._state!==m&&this._state!==b&&this._state!==_&&this._state!==v&&this._state!==w&&this._state!==d&&this._cbs.ontext(e):(this._decodeNumericEntity(3,16),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._decodeNumericEntity(2,10),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData())):(this._parseLegacyEntity(),this._sectionStart<this._index&&(this._state=this._baseState,this._handleTrailingData()))},be.prototype.reset=function(){be.call(this,{xmlMode:this._xmlMode,decodeEntities:this._decodeEntities},this._cbs)},be.prototype.getAbsoluteIndex=function(){return this._bufferOffset+this._index},be.prototype._getSection=function(){return this._buffer.substring(this._sectionStart,this._index)},be.prototype._emitToken=function(e){this._cbs[e](this._getSection()),this._sectionStart=-1},be.prototype._emitPartial=function(e){this._baseState!==u?this._cbs.onattribdata(e):this._cbs.ontext(e)}},function(e,t,r){var n=r(465);e.exports=function(e){if(e>=55296&&e<=57343||e>1114111)return"�";e in n&&(e=n[e]);var t="";e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e);return t+=String.fromCharCode(e)}},function(e){e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","QUOT":"\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}')},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(28),o=/\s+/g,a=r(211),s=r(466);function u(e,t,r){"object"===n(e)?(r=t,t=e,e=null):"function"==typeof t&&(r=t,t=c),this._callback=e,this._options=t||c,this._elementCB=r,this.dom=[],this._done=!1,this._tagStack=[],this._parser=this._parser||null}var c={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1};u.prototype.onparserinit=function(e){this._parser=e},u.prototype.onreset=function(){u.call(this,this._callback,this._options,this._elementCB)},u.prototype.onend=function(){this._done||(this._done=!0,this._parser=null,this._handleCallback(null))},u.prototype._handleCallback=u.prototype.onerror=function(e){if("function"==typeof this._callback)this._callback(e,this.dom);else if(e)throw e},u.prototype.onclosetag=function(){var e=this._tagStack.pop();this._options.withEndIndices&&e&&(e.endIndex=this._parser.endIndex),this._elementCB&&this._elementCB(e)},u.prototype._createDomElement=function(e){if(!this._options.withDomLvl1)return e;var t;for(var r in t="tag"===e.type?Object.create(s):Object.create(a),e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},u.prototype._addDomElement=function(e){var t=this._tagStack[this._tagStack.length-1],r=t?t.children:this.dom,n=r[r.length-1];e.next=null,this._options.withStartIndices&&(e.startIndex=this._parser.startIndex),this._options.withEndIndices&&(e.endIndex=this._parser.endIndex),n?(e.prev=n,n.next=e):e.prev=null,r.push(e),e.parent=t||null},u.prototype.onopentag=function(e,t){var r={type:"script"===e?i.Script:"style"===e?i.Style:i.Tag,name:e,attribs:t,children:[]},n=this._createDomElement(r);this._addDomElement(n),this._tagStack.push(n)},u.prototype.ontext=function(e){var t,r=this._options.normalizeWhitespace||this._options.ignoreWhitespace;if(!this._tagStack.length&&this.dom.length&&(t=this.dom[this.dom.length-1]).type===i.Text)r?t.data=(t.data+e).replace(o," "):t.data+=e;else if(this._tagStack.length&&(t=this._tagStack[this._tagStack.length-1])&&(t=t.children[t.children.length-1])&&t.type===i.Text)r?t.data=(t.data+e).replace(o," "):t.data+=e;else{r&&(e=e.replace(o," "));var n=this._createDomElement({data:e,type:i.Text});this._addDomElement(n)}},u.prototype.oncomment=function(e){var t=this._tagStack[this._tagStack.length-1];if(t&&t.type===i.Comment)t.data+=e;else{var r={data:e,type:i.Comment},n=this._createDomElement(r);this._addDomElement(n),this._tagStack.push(n)}},u.prototype.oncdatastart=function(){var e={children:[{data:"",type:i.Text}],type:i.CDATA},t=this._createDomElement(e);this._addDomElement(t),this._tagStack.push(t)},u.prototype.oncommentend=u.prototype.oncdataend=function(){this._tagStack.pop()},u.prototype.onprocessinginstruction=function(e,t){var r=this._createDomElement({name:e,data:t,type:i.Directive});this._addDomElement(r)},e.exports=u},function(e,t){var r=e.exports={get firstChild(){var e=this.children;return e&&e[0]||null},get lastChild(){var e=this.children;return e&&e[e.length-1]||null},get nodeType(){return i[this.type]||i.element}},n={tagName:"name",childNodes:"children",parentNode:"parent",previousSibling:"prev",nextSibling:"next",nodeValue:"data"},i={element:1,text:3,cdata:4,comment:8};Object.keys(n).forEach(function(e){var t=n[e];Object.defineProperty(r,e,{get:function(){return this[t]||null},set:function(e){return this[t]=e,e}})})},function(e,t,r){var n=e.exports;[r(468),r(472),r(473),r(474),r(475),r(476)].forEach(function(e){Object.keys(e).forEach(function(t){n[t]=e[t].bind(n)})})},function(e,t,r){e.exports=s;var n=r(206),i=r(478).Writable,o=r(62).StringDecoder,a=r(0).Buffer;function s(e,t){var r=this._parser=new n(e,t),a=this._decoder=new o;i.call(this,{decodeStrings:!1}),this.once("finish",function(){r.end(a.end())})}r(2)(s,i),s.prototype._write=function(e,t,r){e instanceof a&&(e=this._decoder.write(e)),this._parser.write(e),r()}},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=9007199254740991,i="[object Arguments]",o="[object Function]",a="[object GeneratorFunction]",s=/^(?:0|[1-9]\d*)$/;function u(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var c=Object.prototype,f=c.hasOwnProperty,l=c.toString,h=c.propertyIsEnumerable,d=Math.max;function p(e,t){var n=v(e)||function(e){return function(e){return function(e){return!!e&&"object"==r(e)}(e)&&_(e)}(e)&&f.call(e,"callee")&&(!h.call(e,"callee")||l.call(e)==i)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],o=n.length,a=!!o;for(var s in e)!t&&!f.call(e,s)||a&&("length"==s||m(s,o))||n.push(s);return n}function y(e,t,r){var n=e[t];f.call(e,t)&&g(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function b(e){if(!w(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t,r,n,i=(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||c,t===n),o=[];for(var a in e)("constructor"!=a||!i&&f.call(e,a))&&o.push(a);return o}function m(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||s.test(e))&&e>-1&&e%1==0&&e<t}function g(e,t){return e===t||e!=e&&t!=t}var v=Array.isArray;function _(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!function(e){var t=w(e)?l.call(e):"";return t==o||t==a}(e)}function w(e){var t=r(e);return!!e&&("object"==t||"function"==t)}var S,k,E,x=(S=function(e,t){!function(e,t,r,n){r||(r={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=n?n(r[a],e[a],a,r,e):void 0;y(r,a,void 0===s?e[a]:s)}}(t,function(e){return _(e)?p(e,!0):b(e)}(t),e)},k=function(e,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=S.length>3&&"function"==typeof o?(i--,o):void 0,a&&function(e,t,n){if(!w(n))return!1;var i=r(t);return!!("number"==i?_(n)&&m(t,n.length):"string"==i&&t in n)&&g(n[t],e)}(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var s=t[n];s&&S(e,s,n,o)}return e},E=d(void 0===E?k.length-1:E,0),function(){for(var e=arguments,t=-1,r=d(e.length-E,0),n=Array(r);++t<r;)n[t]=e[E+t];t=-1;for(var i=Array(E+1);++t<E;)i[t]=e[t];return i[E]=n,u(k,this,i)});e.exports=x},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=9007199254740991,i="[object Arguments]",o="[object Function]",a="[object GeneratorFunction]",s=/^(?:0|[1-9]\d*)$/;function u(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var c=Object.prototype,f=c.hasOwnProperty,l=c.toString,h=c.propertyIsEnumerable,d=Math.max;function p(e,t){var n=w(e)||function(e){return function(e){return function(e){return!!e&&"object"==r(e)}(e)&&S(e)}(e)&&f.call(e,"callee")&&(!h.call(e,"callee")||l.call(e)==i)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],o=n.length,a=!!o;for(var s in e)!t&&!f.call(e,s)||a&&("length"==s||v(s,o))||n.push(s);return n}function y(e,t,r,n){return void 0===e||_(e,c[r])&&!f.call(n,r)?t:e}function b(e,t,r){var n=e[t];f.call(e,t)&&_(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function m(e){if(!k(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t,r,n,i=(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||c,t===n),o=[];for(var a in e)("constructor"!=a||!i&&f.call(e,a))&&o.push(a);return o}function g(e,t){return t=d(void 0===t?e.length-1:t,0),function(){for(var r=arguments,n=-1,i=d(r.length-t,0),o=Array(i);++n<i;)o[n]=r[t+n];n=-1;for(var a=Array(t+1);++n<t;)a[n]=r[n];return a[t]=o,u(e,this,a)}}function v(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||s.test(e))&&e>-1&&e%1==0&&e<t}function _(e,t){return e===t||e!=e&&t!=t}var w=Array.isArray;function S(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!function(e){var t=k(e)?l.call(e):"";return t==o||t==a}(e)}function k(e){var t=r(e);return!!e&&("object"==t||"function"==t)}var E,x=(E=function(e,t,r,n){!function(e,t,r,n){r||(r={});for(var i=-1,o=t.length;++i<o;){var a=t[i],s=n?n(r[a],e[a],a,r,e):void 0;b(r,a,void 0===s?e[a]:s)}}(t,function(e){return S(e)?p(e,!0):m(e)}(t),e,n)},g(function(e,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=E.length>3&&"function"==typeof o?(i--,o):void 0,a&&function(e,t,n){if(!k(n))return!1;var i=r(t);return!!("number"==i?S(n)&&v(t,n.length):"string"==i&&t in n)&&_(n[t],e)}(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var s=t[n];s&&E(e,s,n,o)}return e})),A=g(function(e){return e.push(void 0,y),u(x,void 0,e)});e.exports=A},function(e,t,r){"use strict";e.exports=b;var n=r(127),i=r(57),o=i.findOne,a=i.findAll,s=i.getChildren,u=i.removeSubsets,c=r(58).falseFunc,f=r(491),l=f.compileUnsafe,h=f.compileToken;function d(e){return function(t,r,n){return"function"!=typeof t&&(t=l(t,n,r)),r=Array.isArray(r)?u(r):s(r),e(t,r)}}var p=d(function(e,t){return e!==c&&t&&0!==t.length?a(e,t):[]}),y=d(function(e,t){return e!==c&&t&&0!==t.length?o(e,t):null});function b(e,t,r){return p(e,t,r)}b.compile=f,b.filters=n.filters,b.pseudos=n.pseudos,b.selectAll=p,b.selectOne=y,b.is=function(e,t,r){return("function"==typeof t?t:f(t,r))(e)},b.parse=f,b.iterate=p,b._compileUnsafe=l,b._compileToken=h},function(e,t,r){var n=r(57),i=n.hasAttrib,o=n.getAttributeValue,a=r(58).falseFunc,s=/[-[\]{}()*+?.,\\^$|#\s]/g,u={__proto__:null,equals:function(e,t){var r=t.name,n=t.value;return t.ignoreCase?(n=n.toLowerCase(),function(t){var i=o(t,r);return null!=i&&i.toLowerCase()===n&&e(t)}):function(t){return o(t,r)===n&&e(t)}},hyphen:function(e,t){var r=t.name,n=t.value,i=n.length;return t.ignoreCase?(n=n.toLowerCase(),function(t){var a=o(t,r);return null!=a&&(a.length===i||"-"===a.charAt(i))&&a.substr(0,i).toLowerCase()===n&&e(t)}):function(t){var a=o(t,r);return null!=a&&a.substr(0,i)===n&&(a.length===i||"-"===a.charAt(i))&&e(t)}},element:function(e,t){var r=t.name,n=t.value;if(/\s/.test(n))return a;var i="(?:^|\\s)"+(n=n.replace(s,"\\$&"))+"(?:$|\\s)",u=t.ignoreCase?"i":"",c=new RegExp(i,u);return function(t){var n=o(t,r);return null!=n&&c.test(n)&&e(t)}},exists:function(e,t){var r=t.name;return function(t){return i(t,r)&&e(t)}},start:function(e,t){var r=t.name,n=t.value,i=n.length;return 0===i?a:t.ignoreCase?(n=n.toLowerCase(),function(t){var a=o(t,r);return null!=a&&a.substr(0,i).toLowerCase()===n&&e(t)}):function(t){var a=o(t,r);return null!=a&&a.substr(0,i)===n&&e(t)}},end:function(e,t){var r=t.name,n=t.value,i=-n.length;return 0===i?a:t.ignoreCase?(n=n.toLowerCase(),function(t){var a=o(t,r);return null!=a&&a.substr(i).toLowerCase()===n&&e(t)}):function(t){var a=o(t,r);return null!=a&&a.substr(i)===n&&e(t)}},any:function(e,t){var r=t.name,n=t.value;if(""===n)return a;if(t.ignoreCase){var i=new RegExp(n.replace(s,"\\$&"),"i");return function(t){var n=o(t,r);return null!=n&&i.test(n)&&e(t)}}return function(t){var i=o(t,r);return null!=i&&i.indexOf(n)>=0&&e(t)}},not:function(e,t){var r=t.name,n=t.value;return""===n?function(t){return!!o(t,r)&&e(t)}:t.ignoreCase?(n=n.toLowerCase(),function(t){var i=o(t,r);return null!=i&&i.toLowerCase()!==n&&e(t)}):function(t){return o(t,r)!==n&&e(t)}}};e.exports={compile:function(e,t,r){if(r&&r.strict&&(t.ignoreCase||"not"===t.action))throw SyntaxError("Unsupported attribute selector");return u[t.action](e,t)},rules:u}},function(e){e.exports=JSON.parse('{"universal":50,"tag":30,"attribute":1,"pseudo":0,"descendant":-1,"child":-1,"parent":-1,"sibling":-1,"adjacent":-1}')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsValidProofStatement=function(e,t=null){if(!t)return!1;if(e=e.toLowerCase(),t.split(".").length<2)throw new Error("Please provide the fully qualified Blockstack name.");let r=null;t.endsWith(".id")&&(r=t.split(".id")[0]);const n=null!=r?[`verifying myself: my bitcoin username is +${r}`,`verifying myself: my bitcoin username is ${r}`,`verifying myself: my openname is ${r}`,`verifying that +${r} is my bitcoin username`,`verifying that ${r} is my bitcoin username`,`verifying that ${r} is my openname`,`verifying that +${r} is my openname`,`verifying i am +${r} on my passcard`,`verifying that +${r} is my blockchain id`,`verifying that "${t}" is my blockstack id`,`verifying that ${t} is my blockstack id`,`verifying that &quot;${t}&quot; is my blockstack id`]:[`verifying that "${t}" is my blockstack id`,`verifying that ${t} is my blockstack id`,`verifying that &quot;${t}&quot; is my blockstack id`];for(let t=0;t<n.length;t++){const r=n[t];if(e.includes(r))return!0}return!(null==r||!e.includes("verifymyonename")||!e.includes(`+${r}`))},t.containsValidAddressProofStatement=function(e,t){e=e.split(t)[0].toLowerCase()+t;const r=[`verifying my blockstack id is secured with the address ${t}`];for(let t=0;t<r.length;t++){const n=r[t];if(e.includes(n))return!0}return!1}},function(e,t,r){"use strict";function n(e,t){let r;return t.proof&&t.proof.url&&(r=t.proof.url),{"@type":"Account",service:e,identifier:t.username,proofType:"http",proofUrl:r}}Object.defineProperty(t,"__esModule",{value:!0}),t.getPersonFromLegacyFormat=function(e){const t={"@type":"Person"};if(e){e.name&&e.name.formatted&&(t.name=e.name.formatted),e.bio&&(t.description=e.bio),e.location&&e.location.formatted&&(t.address={"@type":"PostalAddress",addressLocality:e.location.formatted});const r=[];e.avatar&&e.avatar.url&&r.push({"@type":"ImageObject",name:"avatar",contentUrl:e.avatar.url}),e.cover&&e.cover.url&&r.push({"@type":"ImageObject",name:"cover",contentUrl:e.cover.url}),r.length&&(t.image=r),e.website&&(t.website=[{"@type":"WebSite",url:e.website}]);const i=[];e.bitcoin&&e.bitcoin.address&&i.push({"@type":"Account",role:"payment",service:"bitcoin",identifier:e.bitcoin.address}),e.twitter&&e.twitter.username&&i.push(n("twitter",e.twitter)),e.facebook&&e.facebook.username&&i.push(n("facebook",e.facebook)),e.github&&e.github.username&&i.push(n("github",e.github)),e.auth&&e.auth.length>0&&e.auth[0]&&e.auth[0].publicKeychain&&i.push({"@type":"Account",role:"key",service:"bip32",identifier:e.auth[0].publicKeychain}),e.pgp&&e.pgp.url&&i.push({"@type":"Account",role:"key",service:"pgp",identifier:e.pgp.fingerprint,contentUrl:e.pgp.url}),t.account=i}return t}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(23),o=n(r(5)),a=r(128),s=r(27);function u(e){return"number"==typeof e?{units:"BTC",amount:new o.default(String(e))}:{units:e.units,amount:e.amount}}function c(){const e=new i.TransactionBuilder(s.config.network.layer1);return e.setVersion(1),e}function f(e){const t=`${s.config.network.MAGIC_BYTES}${e}`;if(3!==t.length)throw new Error("Runtime error: invalid MAGIC_BYTES");return t}function l(t,r,n=null,o=null){let s;if(o&&!n&&(n="0000000000000000000000000000000000000000"),n){if(40!==n.length)throw new Error("Value hash length incorrect. Expecting 20-bytes, hex-encoded");if(o&&16!==o.length)throw new Error("Burn field length incorrect. Expecting 8-bytes, hex-encoded");const r=o?65:57;(s=e.alloc(r,0)).write(t,0,37,"ascii"),s.write(n,37,20,"hex"),o&&s.write(o,57,8,"hex")}else s=e.from(t,"ascii");const u=e.concat([e.from(f(":"),"ascii"),s]),l=i.payments.embed({data:[u]}).output,h=c();return h.addOutput(l,0),h.addOutput(r,a.DUST_MINIMUM),h.buildIncomplete()}t.BlockstackNamespace=class{constructor(e){if(e.length>19)throw new Error("Namespace ID too long (19 chars max)");if(!e.match("[0123456789abcdefghijklmnopqrstuvwxyz_-]+"))throw new Error("Namespace ID can only use characters 0123456789abcdefghijklmnopqrstuvwxyz-_");this.namespaceID=e,this.version=-1,this.lifetime=-1,this.coeff=-1,this.base=-1,this.buckets=[-1],this.nonalphaDiscount=-1,this.noVowelDiscount=-1}check(){try{return this.setVersion(this.version),this.setLifetime(this.lifetime),this.setCoeff(this.coeff),this.setBase(this.base),this.setBuckets(this.buckets),this.setNonalphaDiscount(this.nonalphaDiscount),this.setNoVowelDiscount(this.noVowelDiscount),!0}catch(e){return!1}}setVersion(e){if(e<0||e>Math.pow(2,16)-1)throw new Error("Invalid version: must be a 16-bit number");this.version=e}setLifetime(e){if(e<0||e>Math.pow(2,32)-1)throw new Error("Invalid lifetime: must be a 32-bit number");this.lifetime=e}setCoeff(e){if(e<0||e>255)throw new Error("Invalid coeff: must be an 8-bit number");this.coeff=e}setBase(e){if(e<0||e>255)throw new Error("Invalid base: must be an 8-bit number");this.base=e}setBuckets(e){if(16!==e.length)throw new Error("Invalid buckets: must have 16 entries");for(let t=0;t<e.length;t++)if(e[t]<0||e[t]>15)throw new Error("Invalid buckets: must be 4-bit numbers");this.buckets=e.slice(0)}setNonalphaDiscount(e){if(e<=0||e>15)throw new Error("Invalid nonalphaDiscount: must be a positive 4-bit number");this.nonalphaDiscount=e}setNoVowelDiscount(e){if(e<=0||e>15)throw new Error("Invalid noVowelDiscount: must be a positive 4-bit number");this.noVowelDiscount=e}toHexPayload(){return`00000000${this.lifetime.toString(16)}`.slice(-8)+`00${this.coeff.toString(16)}`.slice(-2)+`00${this.base.toString(16)}`.slice(-2)+this.buckets.map(e=>e.toString(16)).reduce((e,t)=>e+t,"")+(this.nonalphaDiscount.toString(16)+this.noVowelDiscount.toString(16))+`0000${this.version.toString(16)}`.slice(-4)+e.from(this.namespaceID).toString("hex")}},t.makePreorderSkeleton=function(t,r,n,o,l,h=null){const d=u(l),p=s.config.network,y=[e.from(a.decodeB40(t),"hex"),i.address.toOutputScript(n,p.layer1)];if(h){const t=e.from(h,"ascii");y.push(t)}const b=e.concat(y),m=a.hash160(b),g="BTC"===d.units?39:66,v=e.alloc(g);if(v.write(f("?"),0,3,"ascii"),m.copy(v,3),v.write(r,23,16,"hex"),"BTC"!==d.units){const e=d.amount.toString(16,2);if(e.length>16)throw new Error(`Cannot preorder '${t}': cannot fit price into 8 bytes`);const r=`0000000000000000${e}`.slice(-16);v.write(r,39,8,"hex"),v.write(d.units,47,d.units.length,"ascii")}const _=i.payments.embed({data:[v]}).output,w=c();if(w.addOutput(_,0),w.addOutput(n,a.DUST_MINIMUM),"BTC"===d.units){const e=d.amount.toNumber();w.addOutput(o,e)}else w.addOutput(o,a.DUST_MINIMUM);return w.buildIncomplete()},t.makeRegisterSkeleton=l,t.makeRenewalSkeleton=function(e,t,r,n,o,c=null){const f=u(o),h=s.config.network,d="BTC"===f.units?null:f.amount,p="BTC"===f.units?f.amount.toNumber():a.DUST_MINIMUM;let y=null;if(d){const t=d.toString(16,2);if(t.length>16)throw new Error(`Cannot renew '${e}': cannot fit price into 8 bytes`);y=`0000000000000000${t}`.slice(-16)}const b=l(e,t,c,y),m=i.TransactionBuilder.fromTransaction(b,h.layer1);return m.addOutput(r,a.DUST_MINIMUM),m.addOutput(n,p),m.buildIncomplete()},t.makeTransferSkeleton=function(t,r,n,o=!1){const s=e.alloc(36);let u="~";o&&(u=">"),s.write(f(">"),0,3,"ascii"),s.write(u,3,1,"ascii"),a.hash128(e.from(t,"ascii")).copy(s,4),s.write(r,20,16,"hex");const l=i.payments.embed({data:[s]}).output,h=c();return h.addOutput(l,0),h.addOutput(n,a.DUST_MINIMUM),h.buildIncomplete()},t.makeUpdateSkeleton=function(t,r,n){const o=e.alloc(39),s=e.from(t,"ascii"),u=e.from(r,"ascii"),l=a.hash128(e.concat([s,u]));o.write(f("+"),0,3,"ascii"),l.copy(o,3),o.write(n,19,20,"hex");const h=i.payments.embed({data:[o]}).output,d=c();return d.addOutput(h,0),d.buildIncomplete()},t.makeRevokeSkeleton=function(t){const r=e.alloc(3),n=e.from(t,"ascii");r.write(f("~"),0,3,"ascii");const o=e.concat([r,n]),a=i.payments.embed({data:[o]}).output,s=c();return s.addOutput(a,0),s.buildIncomplete()},t.makeNamespacePreorderSkeleton=function(t,r,n,o,l){const h=u(l);if("BTC"!==h.units&&"STACKS"!==h.units)throw new Error(`Invalid burnUnits ${h.units}`);const d=s.config.network,p=d.getDefaultBurnAddress(),y=[e.from(a.decodeB40(t),"hex"),i.address.toOutputScript(n,d.layer1),e.from(o,"ascii")],b=e.concat(y),m=a.hash160(b);let g=a.DUST_MINIMUM,v=39;"STACKS"===h.units?v=47:g=h.amount.toNumber();const _=e.alloc(v);if(_.write(f("*"),0,3,"ascii"),m.copy(_,3),_.write(r,23,16,"hex"),"STACKS"===h.units){const e=`0000000000000000${h.amount.toString(16,2)}`.slice(-16);_.write(e,39,8,"hex")}const w=i.payments.embed({data:[_]}).output,S=c();return S.addOutput(w,0),S.addOutput(n,a.DUST_MINIMUM),S.addOutput(p,g),S.buildIncomplete()},t.makeNamespaceRevealSkeleton=function(t,r){const n=t.toHexPayload(),o=e.alloc(3+n.length/2);o.write(f("&"),0,3,"ascii"),o.write(n,3,n.length/2,"hex");const s=i.payments.embed({data:[o]}).output,u=c();return u.addOutput(s,0),u.addOutput(r,a.DUST_MINIMUM),u.buildIncomplete()},t.makeNamespaceReadySkeleton=function(t){const r=e.alloc(3+t.length+1);r.write(f("!"),0,3,"ascii"),r.write(`.${t}`,3,t.length+1,"ascii");const n=i.payments.embed({data:[r]}).output,o=c();return o.addOutput(n,0),o.buildIncomplete()},t.makeNameImportSkeleton=function(t,r,n){if(40!==n.length)throw new Error("Invalid zonefile hash: must be 20 bytes hex-encoded");const o=s.config.network,u=e.alloc(3+t.length);u.write(f(";"),0,3,"ascii"),u.write(t,3,t.length,"ascii");const l=i.payments.embed({data:[u]}).output,h=c(),d=i.address.toBase58Check(e.from(n,"hex"),o.layer1.pubKeyHash);return h.addOutput(l,0),h.addOutput(r,a.DUST_MINIMUM),h.addOutput(d,a.DUST_MINIMUM),h.buildIncomplete()},t.makeAnnounceSkeleton=function(t){if(40!==t.length)throw new Error("Invalid message hash: must be 20 bytes hex-encoded");const r=e.alloc(3+t.length/2);r.write(f("#"),0,3,"ascii"),r.write(t,3,t.length/2,"hex");const n=i.payments.embed({data:[r]}).output,o=c();return o.addOutput(n,0),o.buildIncomplete()},t.makeTokenTransferSkeleton=function(t,r,n,o,s){if(s.length>34)throw new Error("Invalid scratch area: must be no more than 34 bytes");const u=e.alloc(46+s.length),l=`00000000000000000000000000000000000000${e.from(n).toString("hex")}`.slice(-38),h=o.toString(16,2);if(h.length>16)throw new Error(`Cannot send tokens: cannot fit ${o.toString()} into 8 bytes`);const d=`0000000000000000${h}`.slice(-16);u.write(f("$"),0,3,"ascii"),u.write(r,3,r.length/2,"hex"),u.write(l,19,l.length/2,"hex"),u.write(d,38,d.length/2,"hex"),u.write(s,46,s.length,"ascii");const p=i.payments.embed({data:[u]}).output,y=c();return y.addOutput(p,0),y.addOutput(t,a.DUST_MINIMUM),y.buildIncomplete()}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9);class i{constructor(e){this.ecPair=e}static fromHexString(e){return new i(n.hexStringToECPair(e))}signerVersion(){return 1}getAddress(){return Promise.resolve().then(()=>n.ecPairToAddress(this.ecPair))}signTransaction(e,t){return Promise.resolve().then(()=>{e.sign(t,this.ecPair)})}}t.PubkeyHashSigner=i},function(e,t,r){"use strict";(function(e){function n(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(t,"__esModule",{value:!0});var i=r(24),o=r(108),a=r(30),s=r(224),u=s._default,c="Invalid mnemonic",f="Invalid entropy",l="Invalid mnemonic checksum",h="A wordlist is required but a default could not be found.\nPlease explicitly pass a 2048 word array explicitly.";function d(e,t,r){for(;e.length<r;)e=t+e;return e}function p(e){return parseInt(e,2)}function y(e){return e.map(function(e){return d(e.toString(2),"0",8)}).join("")}function b(e){var t=8*e.length/32;return y(n(i("sha256").update(e).digest())).slice(0,t)}function m(e){return"mnemonic"+(e||"")}function g(t,r){if(!(r=r||u))throw new Error(h);var n=(t||"").normalize("NFKD").split(" ");if(n.length%3!=0)throw new Error(c);var i=n.map(function(e){var t=r.indexOf(e);if(-1===t)throw new Error(c);return d(t.toString(2),"0",11)}).join(""),o=32*Math.floor(i.length/33),a=i.slice(0,o),s=i.slice(o),y=a.match(/(.{1,8})/g).map(p);if(y.length<16)throw new Error(f);if(y.length>32)throw new Error(f);if(y.length%4!=0)throw new Error(f);var m=e.from(y);if(b(m)!==s)throw new Error(l);return m.toString("hex")}function v(t,r){if(e.isBuffer(t)||(t=e.from(t,"hex")),!(r=r||u))throw new Error(h);if(t.length<16)throw new TypeError(f);if(t.length>32)throw new TypeError(f);if(t.length%4!=0)throw new TypeError(f);var i=(y(n(t))+b(t)).match(/(.{1,11})/g).map(function(e){var t=p(e);return r[t]});return"あいこくしん"===r[0]?i.join(" "):i.join(" ")}t.mnemonicToSeedSync=function(t,r){var n=e.from((t||"").normalize("NFKD"),"utf8"),i=e.from(m((r||"").normalize("NFKD")),"utf8");return o.pbkdf2Sync(n,i,2048,64,"sha512")},t.mnemonicToSeed=function(t,r){return new Promise(function(n,i){try{var a=e.from((t||"").normalize("NFKD"),"utf8"),s=e.from(m((r||"").normalize("NFKD")),"utf8");o.pbkdf2(a,s,2048,64,"sha512",function(e,t){return e?i(e):n(t)})}catch(e){return i(e)}})},t.mnemonicToEntropy=g,t.entropyToMnemonic=v,t.generateMnemonic=function(e,t,r){if((e=e||128)%32!=0)throw new TypeError(f);return v((t=t||a)(e/8),r)},t.validateMnemonic=function(e,t){try{g(e,t)}catch(e){return!1}return!0},t.setDefaultWordlist=function(e){var t=s.wordlists[e];if(!t)throw new Error('Could not find wordlist for language "'+e+'"');u=t},t.getDefaultWordlist=function(){if(!u)throw new Error("No Default Wordlist set");return Object.keys(s.wordlists).filter(function(e){return"JA"!==e&&"EN"!==e&&s.wordlists[e].every(function(e,t){return e===u[t]})})[0]};var _=r(224);t.wordlists=_.wordlists}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i={};t.wordlists=i,t._default=n;try{t._default=n=r(524),i.chinese_simplified=n}catch(e){}try{t._default=n=r(525),i.chinese_traditional=n}catch(e){}try{t._default=n=r(526),i.korean=n}catch(e){}try{t._default=n=r(527),i.french=n}catch(e){}try{t._default=n=r(528),i.italian=n}catch(e){}try{t._default=n=r(529),i.spanish=n}catch(e){}try{t._default=n=r(530),i.japanese=n,i.JA=n}catch(e){}try{t._default=n=r(531),i.english=n,i.EN=n}catch(e){}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(37)),a=i(r(223)),s=n(r(532));t.encryptMnemonic=function(t,r){return Promise.resolve().then(()=>{if(!a.validateMnemonic(t))throw new Error("Not a valid bip39 nmemonic");const n=e.from(a.mnemonicToEntropy(t),"hex"),i=o.default.randomBytes(16),s=o.default.pbkdf2Sync(r,i,1e5,48,"sha512"),u=s.slice(0,16),c=s.slice(16,32),f=s.slice(32,48),l=o.default.createCipheriv("aes-128-cbc",u,f);let h=l.update(n).toString("hex");h+=l.final().toString("hex");const d=e.concat([i,e.from(h,"hex")]),p=o.default.createHmac("sha256",c);p.write(d);const y=p.digest();return e.concat([i,y,e.from(h,"hex")])})};class u extends Error{}t.decryptMnemonic=function(t,r){const n=e.isBuffer(t)?t:e.from(t,"hex");return function(t,r){return Promise.resolve().then(()=>{const n=t.slice(0,16),i=t.slice(16,48),s=t.slice(48),c=e.concat([n,s]),f=o.default.pbkdf2Sync(r,n,1e5,48,"sha512"),l=f.slice(0,16),h=f.slice(16,32),d=f.slice(32,48),p=o.default.createDecipheriv("aes-128-cbc",l,d);let y=p.update(s).toString("hex");y+=p.final().toString("hex");const b=o.default.createHmac("sha256",h);b.write(c);const m=b.digest();if(o.default.createHash("sha256").update(i).digest().toString("hex")!==o.default.createHash("sha256").update(m).digest().toString("hex"))throw new u("Wrong password (HMAC mismatch)");const g=a.entropyToMnemonic(y);if(!a.validateMnemonic(g))throw new u("Wrong password (invalid plaintext)");return g})}(n,r).catch(t=>{if(t instanceof u)throw t;return function(t,r){return new Promise((n,i)=>{s.default.decrypt({key:e.from(r),data:t},(e,t)=>{e?i(e):n(t)})})}(n,r).then(e=>e.toString())})}}).call(this,r(0).Buffer)},function(e,t,r){(function(){var e,n,i,o,a,s,u,c,f,l,h,d,p,y,b,m,g,v,_,w,S={}.hasOwnProperty;b=r(11),h=r(7).WordArray,v=r(59),e=r(130).AES,f=r(131).TwoFish,p=r(83),d=(w=r(84)).XOR,o=w.Concat,r(39).SHA512,u=r(134).PBKDF2,c=r(228).Scrypt,_=r(15),g=r(229),m=r(230).make_esc,s=r(43).HMAC_SHA256,l={1:{header:[479516638,1],salt_size:8,xsalsa20_rev:!0,kdf:{klass:u,opts:{c:1024,klass:d}},hmac_key_size:96,version:1},2:{header:[479516638,2],salt_size:16,xsalsa20_rev:!0,kdf:{klass:c,opts:{c:64,klass:d,N:12,r:8,p:1}},hmac_key_size:96,version:2},3:{header:[479516638,3],salt_size:16,xsalsa20_rev:!1,kdf:{klass:c,opts:{c:1,klass:s,N:15,r:8,p:1}},hmac_key_size:96,version:3}},t.CURRENT_VERSION=i=3,n=function(){function t(e){var t,r;if(t=e.key,r=e.version,this.version=l[null!=r?r:i],null==this.version)throw new Error("unknown version: "+r);this.set_key(t),this.derived_keys={}}return t.prototype.kdf=function(t,r){var n,i,o,a,s,u,c,l,d,p,y,m,g,_,w,S,k,E;S=b.findDeferral(arguments),g=t.salt,a=t.extra_keymaterial,y=t.progress_hook,(E=this,function(e){k=new b.Deferrals(e,{parent:S,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),E._check_scrubbed(E.key,"in KDF",r,k.defer({lineno:97})),k._fulfill()})(function(t){return function(){_=g.to_hex(),c=t.key.clone(),k=new b.Deferrals(function(){!function(r){if(null!=(l=t.derived_keys[_]))return r();for(u in t._kdf=new t.version.kdf.klass(t.version.kdf.opts),d={hmac:t.version.hmac_key_size,aes:e.keySize,twofish:f.keySize,salsa20:v.Salsa20.keySize},p=["hmac","aes","twofish","salsa20"],i=a||0,d)w=d[u],i+=w;n={dkLen:i,key:c,progress_hook:y,salt:g},function(e){k=new b.Deferrals(e,{parent:S,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),t._kdf.run(n,k.defer({assign_fn:function(){return m=arguments[0]},lineno:124})),k._fulfill()}(function(){var e,n;for(l={},s=0,e=0,n=p.length;e<n;e++)u=p[e],w=d[u],o=s+w/4,l[u]=new h(m.words.slice(s,o)),s=o;return l.extra=new h(m.words.slice(o)).to_buffer(),r(t.derived_keys[_]=l)})}(function(){return r(null,l)})},{parent:S,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.kdf"}),t._check_scrubbed(c,"KDF",r,k.defer({lineno:105})),k._fulfill()}}(this))},t.prototype.set_key=function(e){var t;return null==e?this.scrub():(t=h.from_buffer(e),this.key&&this.key.equal(t)?void 0:(this.scrub(),this.key=t))},t.prototype._check_scrubbed=function(e,t,r,n){return null==e||e.is_scrubbed()?r(new Error(t+": Failed due to scrubbed key!"),null):n()},t.prototype.sign=function(e,t){var r,n,i,a,s,u,c,f;u=b.findDeferral(arguments),r=e.input,n=e.key,s=e.salt,a=e.progress_hook,(f=this,function(e){c=new b.Deferrals(e,{parent:u,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.sign"}),f._check_scrubbed(n,"HMAC",t,c.defer({lineno:182})),c._fulfill()})(function(e){return function(){r=new h(e.version.header).concat(s).concat(r),c=new b.Deferrals(function(){return r.scrub(),t(null,i)},{parent:u,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.sign"}),o.bulk_sign({key:n,input:r,progress_hook:a},c.defer({assign_fn:function(){return i=arguments[0]},lineno:184})),c._fulfill()}}(this))},t.prototype.run_salsa20=function(e,t){var r,n,i,o,a,s,u,c,f,l;c=b.findDeferral(arguments),i=e.input,a=e.key,o=e.iv,s=e.output_iv,u=e.progress_hook,(l=this,function(e){f=new b.Deferrals(e,{parent:c,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_salsa20"}),l._check_scrubbed(a,"Salsa20",t,f.defer({lineno:200})),f._fulfill()})(function(e){return function(){r={input:i,progress_hook:u,key:a,iv:o},e.version.xsalsa20_rev&&(r.key=a.clone().endian_reverse(),r.iv=o.clone().endian_reverse()),f=new b.Deferrals(function(){return s&&(n=o.clone().concat(n)),e.version.xsalsa20_rev&&(r.key.scrub(),r.iv.scrub()),t(null,n)},{parent:c,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_salsa20"}),v.bulk_encrypt(r,f.defer({assign_fn:function(){return n=arguments[0]},lineno:212})),f._fulfill()}}(this))},t.prototype.run_twofish=function(e,t){var r,n,i,o,a,s,u,c,l;u=b.findDeferral(arguments),i=e.input,a=e.key,o=e.iv,s=e.progress_hook,(l=this,function(e){c=new b.Deferrals(e,{parent:u,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_twofish"}),l._check_scrubbed(a,"TwoFish",t,c.defer({lineno:235})),c._fulfill()})(function(){r=new f(a),c=new b.Deferrals(function(){return r.scrub(),t(null,o.clone().concat(n))},{parent:u,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_twofish"}),p.bulk_encrypt({block_cipher:r,iv:o,input:i,progress_hook:s,what:"twofish"},c.defer({assign_fn:function(){return n=arguments[0]},lineno:237})),c._fulfill()})},t.prototype.run_aes=function(t,r){var n,i,o,a,s,u,c,f,l;c=b.findDeferral(arguments),o=t.input,s=t.key,a=t.iv,u=t.progress_hook,(l=this,function(e){f=new b.Deferrals(e,{parent:c,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_aes"}),l._check_scrubbed(s,"AES",r,f.defer({lineno:252})),f._fulfill()})(function(){n=new e(s),f=new b.Deferrals(function(){return n.scrub(),r(null,a.clone().concat(i))},{parent:c,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Base.run_aes"}),p.bulk_encrypt({block_cipher:n,iv:a,input:o,progress_hook:u,what:"aes"},f.defer({assign_fn:function(){return i=arguments[0]},lineno:254})),f._fulfill()})},t.prototype.scrub=function(){var e,t,r,n,i;if(null!=this.key&&this.key.scrub(),null!=this.derived_keys)for(n in i=this.derived_keys)for(e in r=i[n])t=r[e],"extra"!==e&&t.scrub();return this.derived_keys={},null!=this.salt&&this.salt.scrub(),this.salt=null,this.key=null},t.prototype.clone_derived_keys=function(){var e,t,r,n,i,o;if(n=null,null!=this.derived_keys)for(i in n={},o=this.derived_keys)for(e in r=o[i],n[i]={},r)t=r[e],n[i][e]="extra"===e?t:t.clone();return n},t}(),a=function(t){function r(e){var t,n,i;t=e.key,n=e.rng,i=e.version,r.__super__.constructor.call(this,{key:t,version:i}),this.rng=n||g.generate}return function(e,t){for(var r in t)S.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(r,n),r.prototype.pick_random_ivs=function(t,r){var n,i,o,a,s,u,c;s=b.findDeferral(arguments),t.progress_hook,n={aes:e.ivSize,twofish:f.ivSize,salsa20:v.Salsa20.ivSize},i={},(c=this,function(e){var t,r,f,l,h;l=n,f=function(){var e;for(r in e=[],l)e.push(r);return e}(),t=0,(h=function(e){var r,n;if(r=e,n=function(){return b.trampoline(function(){return++t,h(e)})},!(t<f.length))return r();o=f[t],a=l[o],function(e){var t,r;u=new b.Deferrals(e,{parent:s,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.pick_random_ivs"}),c.rng(a,u.defer({assign_fn:(t=i,r=o,function(){return t[r]=arguments[0]}),lineno:377})),u._fulfill()}(n)})(e)})(function(){return r(i)})},r.prototype.resalt=function(e,t){var r,n,i,o,a,s,u;a=b.findDeferral(arguments),o=e.salt,n=e.extra_keymaterial,i=e.progress_hook,r=null,(u=this,function(e){if(null!=o)return e(o.length!==u.version.salt_size?r=new Error("Need a salt of exactly "+u.version.salt_size+" bytes (got "+o.length+")"):u.salt=h.alloc(o));!function(e){var t;s=new b.Deferrals(e,{parent:a,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.resalt"}),u.rng(u.version.salt_size,s.defer({assign_fn:(t=u,function(){return t.salt=arguments[0]}),lineno:393})),s._fulfill()}(e)})(function(e){return function(){!function(t){if(null!=r)return t();!function(t){var o;s=new b.Deferrals(t,{parent:a,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.resalt"}),e.kdf({extra_keymaterial:n,progress_hook:i,salt:e.salt},s.defer({assign_fn:(o=e,function(){return r=arguments[0],o.keys=arguments[1]}),lineno:399})),s._fulfill()}(t)}(function(){return t(r,e.keys)})}}(this))},r.prototype.run=function(e,t){var r,n,i,o,a,s,u,c,f,l,d,p,y,g,v;y=b.findDeferral(arguments),o=e.data,d=e.salt,s=e.extra_keymaterial,c=e.progress_hook,a=m(t,"Encryptor::run"),(v=this,function(e){if(null==d&&null!=v.salt)return e();!function(e){g=new b.Deferrals(e,{parent:y,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),v.resalt({salt:d,extra_keymaterial:s,progress_hook:c},a(g.defer({lineno:430}))),g._fulfill()}(e)})(function(e){return function(){g=new b.Deferrals(function(){f=h.from_buffer(o),g=new b.Deferrals(function(){g=new b.Deferrals(function(){g=new b.Deferrals(function(){g=new b.Deferrals(function(){return l=new h(e.version.header).concat(e.salt).concat(p).concat(i).to_buffer(),_.scrub_buffer(o),t(null,l)},{parent:y,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),e.sign({input:i,key:e.keys.hmac,progress_hook:c,salt:e.salt},a(g.defer({assign_fn:function(){return p=arguments[0]},lineno:436}))),g._fulfill()},{parent:y,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),e.run_aes({input:n,key:e.keys.aes,progress_hook:c,iv:u.aes},a(g.defer({assign_fn:function(){return i=arguments[0]},lineno:435}))),g._fulfill()},{parent:y,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),e.run_twofish({input:r,key:e.keys.twofish,progress_hook:c,iv:u.twofish},a(g.defer({assign_fn:function(){return n=arguments[0]},lineno:434}))),g._fulfill()},{parent:y,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),e.run_salsa20({input:f,key:e.keys.salsa20,progress_hook:c,iv:u.salsa20,output_iv:!0},a(g.defer({assign_fn:function(){return r=arguments[0]},lineno:433}))),g._fulfill()},{parent:y,filename:"/Users/max/src/keybase/triplesec/src/enc.iced",funcname:"Encryptor.run"}),e.pick_random_ivs({progress_hook:c},g.defer({assign_fn:function(){return u=arguments[0]},lineno:431})),g._fulfill()}}(this))},r.prototype.clone=function(){var e,t,n;return(e=new r({key:null!=(t=this.key)?t.to_buffer():void 0,rng:this.rng,version:null!=(n=this.version)?n.version:void 0})).derived_keys=this.clone_derived_keys(),e},r}(),y=function(e,t){var r,n,i,o,s,u,c,f,l,h;l=b.findDeferral(arguments),o=e.key,r=e.data,c=e.rng,s=e.progress_hook,f=e.version,n=new a({key:o,rng:c,version:f}),function(e){h=new b.Deferrals(e,{parent:l,filename:"/Users/max/src/keybase/triplesec/src/enc.iced"}),n.run({data:r,progress_hook:s},h.defer({assign_fn:function(){return i=arguments[0],u=arguments[1]},lineno:475})),h._fulfill()}(function(){return n.scrub(),t(i,u)})},t.V=l,t.encrypt=y,t.Base=n,t.Encryptor=a}).call(this)},function(e,t,r){(function(e){(function(){var n,i,o,a,s,u,c,f,l,h,d=[].slice;n=r(129),o=function(e,t,r,i,o){var a,s,u,f;for(a in u={},i)f=i[a],u[a]=f;return u[n.lineno]=null!=t?t[n.lineno]:void 0,(s=function(){var n,i,a;return n=1<=arguments.length?d.call(arguments,0):[],null!=t&&null!=(a=t.assign_fn)&&a.apply(null,n),e?(i=e,o||(e=null),i._fulfill(r,u)):c("overused deferral at "+h(u))})[n.trace]=u,s},l=0,s=function(e){return++l%e==0&&(l=0,!0)},f=null,h=function(e){return(e[n.funcname]||"<anonymous>")+" ("+e[n.filename]+":"+(e[n.lineno]+1)+")"},c=function(e){return"undefined"!=typeof console&&null!==console?console.error("ICED warning: "+e):void 0},t.trampoline=u=function(t){return s(500)?null!=(null!=e?e.nextTick:void 0)?e.nextTick(t):setTimeout(t):t()},t.Deferrals=function(){function e(e,t){this.trace=t,this.continuation=e,this.count=1,this.ret=null}return e.prototype._call=function(e){var t;return this.continuation?(f=e,t=this.continuation,this.continuation=null,t(this.ret)):c("Entered dead await at "+h(e))},e.prototype._fulfill=function(e,t){if(!(--this.count>0))return u((r=this,function(){return r._call(t)}));var r},e.prototype.defer=function(e){return this.count++,this,o(this,e,null,this.trace)},e}(),t.findDeferral=function(e){var t,r,i;for(r=0,i=e.length;r<i;r++)if(null!=(t=e[r])?t[n.trace]:void 0)return t;return null},t.Rendezvous=function(){var e;function t(){this.completed=[],this.waiters=[],this.defer_id=0}return e=function(){function e(e,t,r){this.rv=e,this.id=t,this.multi=r}return e.prototype.defer=function(e){return this.rv._defer_with_id(this.id,e,this.multi)},e}(),t.prototype.wait=function(e){return this.completed.length?e(this.completed.shift()):this.waiters.push(e)},t.prototype.defer=function(e){var t;return t=this.defer_id++,this._defer_with_id(t,e)},t.prototype.id=function(t,r){return new e(this,t,r=!!r)},t.prototype._fulfill=function(e,t){return this.waiters.length?this.waiters.shift()(e):this.completed.push(e)},t.prototype._defer_with_id=function(e,t,r){return this.count++,o(this,t,e,{},r)},t}(),t.stackWalk=a=function(e){var t,r,i,o;for(r=[],i=e?e[n.trace]:f;i;)t=" at "+h(i),r.push(t),i=null!=i&&null!=(o=i[n.parent])?o[n.trace]:void 0;return r},t.exceptionHandler=i=function(e,t){var r;if(t||(t=console.error),t(e.stack),(r=a()).length)return t("Iced 'stack' trace (w/ real line numbers):"),t(r.join("\n"))},t.catchExceptions=function(t){return null!=e?e.on("uncaughtException",function(r){return i(r,t),e.exit(1)}):void 0}}).call(this)}).call(this,r(16))},function(e,t,r){(function(){var e,n,i,o,a,s,u,c,f,l,h,d,p,y,b,m,g;l=r(11),e=r(43).HMAC_SHA256,h=r(134).pbkdf2,b=r(59),c=b.endian_reverse,n=b.Salsa20InnerCore,(m=r(7)).ui8a_to_buffer,o=m.WordArray,g=r(15),f=g.fixup_uint32,u=g.default_delay,d=g.scrub_vec,new(function(){function e(){this.tot=0}return e.prototype.start=function(){return this._t=Date.now()},e.prototype.stop=function(){return this.tot+=Date.now()-this._t},e}()),a=function(e,t,r,n,i){var o,a,s;for(s=r<<4|0,o=(a=n<<4|0)+(i<<4)|0;a<o;)e[s]=t[a],e[s+1]=t[a+1],e[s+2]=t[a+2],e[s+3]=t[a+3],e[s+4]=t[a+4],e[s+5]=t[a+5],e[s+6]=t[a+6],e[s+7]=t[a+7],e[s+8]=t[a+8],e[s+9]=t[a+9],e[s+10]=t[a+10],e[s+11]=t[a+11],e[s+12]=t[a+12],e[s+13]=t[a+13],e[s+14]=t[a+14],e[s+15]=t[a+15],a+=16,s+=16;return!0},s=function(e,t,r,n){var i,o;for(n=n<<4|0,i=0,o=r<<4|0;i<n;)e[i]^=t[o],e[i+1]^=t[o+1],e[i+2]^=t[o+2],e[i+3]^=t[o+3],e[i+4]^=t[o+4],e[i+5]^=t[o+5],e[i+6]^=t[o+6],e[i+7]^=t[o+7],e[i+8]^=t[o+8],e[i+9]^=t[o+9],e[i+10]^=t[o+10],e[i+11]^=t[o+11],e[i+12]^=t[o+12],e[i+13]^=t[o+13],e[i+14]^=t[o+14],e[i+15]^=t[o+15],i+=16,o+=16;return!0},y=function(e){var t,r,n,i;for(r=n=0,i=e.length;n<i;r=++n)t=e[r],e[r]=c(t);return!0},i=function(){function t(t){var r,i,o,a;r=t.N,this.r=t.r,this.p=t.p,i=t.c,o=t.c0,a=t.c1,this.klass=t.klass,this.N||(this.N=1<<(r||15)),this.r||(this.r=8),this.p||(this.p=1),this.c0=o||i||1,this.c1=a||i||1,this.klass||(this.klass=e),this.X16_tmp=new Int32Array(16),this.s20ic=new n(8)}return t.prototype.salsa20_8=function(e){var t,r,n,i,o;for(r=i=0,o=(t=this.s20ic._core(e)).length;i<o;r=++i)n=t[r],e[r]+=n;return!0},t.prototype.pbkdf2=function(e,t){var r,n,i,o,a,s,u,c,f;u=l.findDeferral(arguments),i=e.key,a=e.salt,n=e.dkLen,o=e.progress_hook,r=e.c,(f=this,function(e){c=new l.Deferrals(e,{parent:u,filename:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.pbkdf2"}),h({key:i,salt:a,c:r,dkLen:n,klass:f.klass,progress_hook:o},c.defer({assign_fn:function(){return s=arguments[0]},lineno:109})),c._fulfill()})(function(){return t(s)})},t.prototype.blockmix_salsa8=function(e,t){var r,n,i,o;for(r=this.X16_tmp,a(r,e,0,2*this.r-1,1),n=i=0,o=2*this.r;0<=o?i<o:i>o;n=0<=o?++i:--i)s(r,e,n,1),this.salsa20_8(r),a(t,r,n,0,1);for(n=0;n<this.r;)a(e,t,n,2*n,1),n++;for(n=0;n<this.r;)a(e,t,n+this.r,2*n+1,1),n++;return!0},t.prototype.smix=function(e,t){var r,n,i,o,c,h,d,p,y,b,m,g,v;m=l.findDeferral(arguments),r=e.B,n=e.V,o=e.XY,y=e.progress_hook,i=o,p=2*this.r,c=o.subarray(16*p),a(i,r,0,0,p),h=0,(v=this,function(e){var t;(t=function(e){var r,o;if(r=e,o=function(){return l.trampoline(function(){return t(e)})},!(h<v.N))return r();for(b=Math.min(v.N,h+2048);h<b;)a(n,i,p*h,0,p),v.blockmix_salsa8(i,c),h++;"function"==typeof y&&y(h),function(e){g=new l.Deferrals(e,{parent:m,filename:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.smix"}),u(0,0,g.defer({lineno:166})),g._fulfill()}(o)})(e)})(function(e){return function(){var o;h=0,(o=function(t){var r,a;if(r=t,a=function(){return l.trampoline(function(){return o(t)})},!(h<e.N))return r();for(b=Math.min(e.N,h+256);h<b;)d=f(i[16*(p-1)])&e.N-1,s(i,n,d*p,p),e.blockmix_salsa8(i,c),h++;"function"==typeof y&&y(h+e.N),function(e){g=new l.Deferrals(e,{parent:m,filename:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.smix"}),u(0,0,g.defer({lineno:183})),g._fulfill()}(a)})(function(){return a(r,i,0,0,p),t()})}}(this))},t.prototype.run=function(e,t){var r,n,i,a,s,u,c,f,h,p,b,m,g,v,_,w,S;m=l.findDeferral(arguments),c=e.key,b=e.salt,s=e.dkLen,p=e.progress_hook,s>(n=4294967295)?new Error("asked for too much data"):this.r*this.p>=1<<30?new Error("r & p are too big"):(this.r>n/128/this.p||this.r>n/256||this.N>n/128/this.r)&&new Error("N is too big"),a=new Int32Array(64*this.r),i=new Int32Array(32*this.r*this.N),f=function(e){return e.what+=" (pass 1)","function"==typeof p?p(e):void 0},(S=this,function(e){g=new l.Deferrals(e,{parent:m,filename:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.run"}),S.pbkdf2({key:c.clone(),salt:b,dkLen:128*S.r*S.p,c:S.c0,progress_hook:f},g.defer({assign_fn:function(){return r=arguments[0]},lineno:214})),g._fulfill()})(function(e){return function(){var n;r=new Int32Array(r.words),y(r),f=function(t){return function(r){return"function"==typeof p?p({i:r+t*e.N*2,what:"scrypt",total:e.p*e.N*2}):void 0}},u=0,v=0,_=e.p,w=_>v,(n=function(t){var o,s;if(o=t,s=function(){return l.trampoline(function(){return w?u+=1:u-=1,n(t)})},!0===w&&u>=e.p||!1===w&&u<=e.p)return o();!function(t){g=new l.Deferrals(t,{parent:m,filename:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.run"}),e.smix({B:r.subarray(32*e.r*u),V:i,XY:a,progress_hook:f(u)},g.defer({lineno:221})),g._fulfill()}(s)})(function(){y(r),f=function(e){return e.what+=" (pass 2)","function"==typeof p?p(e):void 0},g=new l.Deferrals(function(){return d(a),d(i),d(r),c.scrub(),t(h)},{parent:m,filename:"/Users/max/src/keybase/triplesec/src/scrypt.iced",funcname:"Scrypt.run"}),e.pbkdf2({key:c,salt:o.from_i32a(r),dkLen:s,c:e.c1,progress_hook:f},g.defer({assign_fn:function(){return h=arguments[0]},lineno:229})),g._fulfill()})}}(this))},t}(),p=function(e,t){var r,n,o,a,s,u,c,f,h,d,p,y,b,m,g;m=l.findDeferral(arguments),c=e.key,y=e.salt,p=e.r,r=e.N,h=e.p,o=e.c0,a=e.c1,n=e.c,f=e.klass,d=e.progress_hook,s=e.dkLen,u=new i({r:p,N:r,p:h,c:n,c0:o,c1:a,klass:f}),function(e){g=new l.Deferrals(e,{parent:m,filename:"/Users/max/src/keybase/triplesec/src/scrypt.iced"}),u.run({key:c,salt:y,progress_hook:d,dkLen:s},g.defer({assign_fn:function(){return b=arguments[0]},lineno:259})),g._fulfill()}(function(){return t(b)})},t.Scrypt=i,t.scrypt=p,t.v_endian_reverse=y}).call(this)},function(e,t,r){(function(e){(function(){var n,i,o,a,s,u,c,f,l,h,d,p,y,b,m,g,v;if(c=r(11),function(){},l=r(534),n=r(536).ADRBG,o=r(7).WordArray,a=r(84).XOR,p=r(15),y=null,s=function(t){var r;return r=new Uint8Array(t),y(r),new e(r)},null!=(y=null!=(f="undefined"!=typeof window&&null!==window&&null!=(g=window.crypto)?g.getRandomValues:void 0)?f.bind(window.crypto):null!=(f="undefined"!=typeof window&&null!==window&&null!=(v=window.msCrypto)?v.getRandomValues:void 0)?f.bind(window.msCrypto):null))b=s;else try{null!=(d=r(37).rng)&&(b=d)}catch(e){e}h=function(e){if(null==b)throw new Error('No rng found; tried requiring "crypto" and window.crypto');return b(e)},i=function(){function t(){var e;this.meg=new l.Generator,this.adrbg=new n((e=this,function(t,r){return e.gen_seed(t,r)}),a.sign)}return t.prototype.now_to_buffer=function(){var t,r,n,i;return n=(r=Date.now())%1e3,i=Math.floor(r/1e3),(t=new e(8)).writeUInt32BE(i,0),t.writeUInt32BE(n,4),t},t.prototype.gen_seed=function(t,r){var n,i,a,s,u,f,l,d,y;l=c.findDeferral(arguments),s=t/8,(i=[]).push(this.now_to_buffer()),(y=this,function(e){d=new c.Deferrals(e,{parent:l,filename:"/Users/max/src/keybase/triplesec/src/prng.iced",funcname:"PRNG.gen_seed"}),y.meg.generate(t,d.defer({assign_fn:function(){return f=arguments[0]},lineno:83})),d._fulfill()})(function(t){return function(){var c,l;for(i.push(t.now_to_buffer()),i.push(new e(f)),i.push(h(s)),i.push(t.now_to_buffer()),a=e.concat(i),u=o.from_buffer(a),p.scrub_buffer(a),c=0,l=i.length;c<l;c++)n=i[c],p.scrub_buffer(n);return r(u)}}(this))},t.prototype.generate=function(e,t){return this.adrbg.generate(e,t)},t}(),m=null,u=function(e,t){return null==m&&(m=new i),m.generate(e,t)},t.PRNG=i,t.generate=u,t.native_rng=h}).call(this)}).call(this,r(0).Buffer)},function(e,t,r){(function(){var e,n,i,o,a,s,u,c,f,l=[].slice;f=r(538),n=r(11).const,t.BaseError=e=function(e,t){return"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.message=e||"Error"},f.inherits(e,Error),e.prototype.name="BaseError",c=function(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()},i=function(e){var t;return function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split(/_/)).length;r<n;r++)t=i[r],o.push(c(t));return o}().join("")},s=function(t,r,n){var i;return i=function(t){return e.call(this,t||n,this.constructor),this.istack=[],this.code=r,this},f.inherits(i,e),i.prototype.name=t,i.prototype.inspect=function(){return"["+t+": "+this.message+" (code "+this.code+")]"},i},o=function(e,t){return t[n.trace]=e[n.trace],t},t.make_errors=function(e){var t,r,n,o,a,u;for(n in a={msg:{},name:{},code:{}},e.OK="Success",r=100,e)o=e[n],"OK"!==n?(u=r++,a[t=i(n)+"Error"]=s(t,u,o)):u=0,a[n]=u,a.msg[n]=a.msg[u]=o,a.name[n]=a.name[u]=n,a.code[n]=u;return a},a=function(e,t){if(null!=t)return null==e.istack&&(e.istack=[]),e.istack.push(t)},t.make_esc=u=function(e,t){var r;return null==t&&(t=null!=(r=u.caller)?r.name:void 0),function(r){return o(r,function(){var n,i;return i=arguments[0],n=2<=arguments.length?l.call(arguments,1):[],null==i?r.apply(null,n):e.__esc?void 0:(e.__esc=!0,a(i,null!=t?t:"unnamed error"),e(i))})}},t.EscOk=function(){function e(e,t){this.gcb=e,this.where=t}return e.prototype.bailout=function(){var e;if(this.gcb)return e=this.gcb,this.gcb=null,e(!1)},e.prototype.check_ok=function(e){return o(e,(t=this,function(){var r,n;return n=arguments[0],r=2<=arguments.length?l.call(arguments,1):[],n?e.apply(null,r):t.bailout()}));var t},e.prototype.check_err=function(e){return o(e,(t=this,function(){var r,n;return n=arguments[0],r=2<=arguments.length?l.call(arguments,1):[],null!=n?(a(n,t.where),t.bailout()):e.apply(null,r)}));var t},e.prototype.check_non_null=function(e){return o(e,(t=this,function(){var r;return null==(r=1<=arguments.length?l.call(arguments,0):[])[0]?t.bailout():e.apply(null,r)}));var t},e}(),t.EscErr=function(){function e(e,t){this.gcb=e,this.where=t}return e.prototype.finish=function(e){var t;if(this.gcb)return t=this.gcb,this.gcb=null,t(e)},e.prototype.check_ok=function(e,t,r){return null==t&&(t=Error),null==r&&(r=null),o(e,function(){var n,i,o;return o=arguments[0],n=2<=arguments.length?l.call(arguments,1):[],o?e.apply(null,n):(i=new t(r),a(i,this.where),this.finish(i))})},e.prototype.check_err=function(e){return o(e,function(){var t,r;return r=arguments[0],t=2<=arguments.length?l.call(arguments,1):[],null!=r?(a(r,this.where),this.finish(r)):e.apply(null,t)})},e}(),t.Canceler=function(){function e(e){this.klass=null!=e?e:Error,this._canceled=!1}return e.prototype.is_canceled=function(){return this._canceled},e.prototype.is_ok=function(){return!this._canceled},e.prototype.cancel=function(){return this._canceled=!0},e.prototype.err=function(){return this._canceled?new this.klass("Aborted"):null},e}(),t.chain=function(e,t){return function(){var r;return r=1<=arguments.length?l.call(arguments,0):[],t(function(){return e.apply(null,r)})}},t.chain_err=function(e,t){return function(){var r;return r=1<=arguments.length?l.call(arguments,0):[],t(function(){var t;return t=1<=arguments.length?l.call(arguments,0):[],e.apply(null,null!=t[0]&&null==r[0]?t:r)})}}}).call(this)},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(135));t.default=i,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(135))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(137);t.AppConfig=n.AppConfig;var i=r(68);t.makeAuthResponse=i.makeAuthResponse;var o=r(198);t.getAuthRequestFromURL=o.getAuthRequestFromURL,t.fetchAppManifest=o.fetchAppManifest,t.redirectUserToApp=o.redirectUserToApp;var a=r(514);t.makeCoreSessionRequest=a.makeCoreSessionRequest,t.sendCoreSessionRequest=a.sendCoreSessionRequest,t.getCoreSession=a.getCoreSession;var s=r(197);t.verifyAuthRequest=s.verifyAuthRequest,t.verifyAuthResponse=s.verifyAuthResponse,t.isExpirationDateValid=s.isExpirationDateValid,t.isIssuanceDateValid=s.isIssuanceDateValid,t.doPublicKeysMatchUsername=s.doPublicKeysMatchUsername,t.doPublicKeysMatchIssuer=s.doPublicKeysMatchIssuer,t.doSignaturesMatchPublicKeys=s.doSignaturesMatchPublicKeys,t.isManifestUriValid=s.isManifestUriValid,t.isRedirectUriValid=s.isRedirectUriValid,t.verifyAuthRequestAndLoadManifest=s.verifyAuthRequestAndLoadManifest;var u=r(195);t.isUserSignedIn=u.isUserSignedIn,t.redirectToSignIn=u.redirectToSignIn,t.redirectToSignInWithAuthRequest=u.redirectToSignInWithAuthRequest,t.isSignInPending=u.isSignInPending,t.handlePendingSignIn=u.handlePendingSignIn,t.loadUserData=u.loadUserData,t.signUserOut=u.signUserOut;var c=r(68);t.makeAuthRequest=c.makeAuthRequest},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=c(e),n=r[0],a=r[1],s=new o(function(e,t,r){return 3*(t+r)/4-r}(0,n,a)),u=0,f=a>0?n-4:n,l=0;l<f;l+=4)t=i[e.charCodeAt(l)]<<18|i[e.charCodeAt(l+1)]<<12|i[e.charCodeAt(l+2)]<<6|i[e.charCodeAt(l+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=i[e.charCodeAt(l)]<<2|i[e.charCodeAt(l+1)]>>4,s[u++]=255&t);1===a&&(t=i[e.charCodeAt(l)]<<10|i[e.charCodeAt(l+1)]<<4|i[e.charCodeAt(l+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(f(e,a,a+16383>s?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=c}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+d]=255&a,d+=p,a/=256,c-=8);e[r+d-p]|=128*y}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(236),o=r(237);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=_,t.resolve=function(e,t){return _(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?_(e,!1,!0).resolveObject(t):t},t.format=function(e){o.isString(e)&&(e=_(e));return e instanceof a?e.format():a.prototype.format.call(e)},t.Url=a;var s=/^([a-z0-9.+-]+:)/i,u=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,f=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(f),h=["%","/","?",";","#"].concat(l),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,y=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(238);function _(e,t,r){if(e&&o.isObject(e)&&e instanceof a)return e;var n=new a;return n.parse(e,t,r),n}a.prototype.parse=function(e,t,r){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+n(e));var a=e.indexOf("?"),u=-1!==a&&a<e.indexOf("#")?"?":"#",f=e.split(u);f[0]=f[0].replace(/\\/g,"/");var _=e=f.join(u);if(_=_.trim(),!r&&1===e.split("#").length){var w=c.exec(_);if(w)return this.path=_,this.href=_,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=s.exec(_);if(S){var k=(S=S[0]).toLowerCase();this.protocol=k,_=_.substr(S.length)}if(r||S||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===_.substr(0,2);!E||S&&m[S]||(_=_.substr(2),this.slashes=!0)}if(!m[S]&&(E||S&&!g[S])){for(var x,A,O=-1,P=0;P<d.length;P++){-1!==(T=_.indexOf(d[P]))&&(-1===O||T<O)&&(O=T)}-1!==(A=-1===O?_.lastIndexOf("@"):_.lastIndexOf("@",O))&&(x=_.slice(0,A),_=_.slice(A+1),this.auth=decodeURIComponent(x)),O=-1;for(P=0;P<h.length;P++){var T;-1!==(T=_.indexOf(h[P]))&&(-1===O||T<O)&&(O=T)}-1===O&&(O=_.length),this.host=_.slice(0,O),_=_.slice(O),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var j=this.hostname.split(/\./),M=(P=0,j.length);P<M;P++){var B=j[P];if(B&&!B.match(p)){for(var N="",C=0,D=B.length;C<D;C++)B.charCodeAt(C)>127?N+="x":N+=B[C];if(!N.match(p)){var U=j.slice(0,P),R=j.slice(P+1),F=B.match(y);F&&(U.push(F[1]),R.unshift(F[2])),R.length&&(_="/"+R.join(".")+_),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=i.toASCII(this.hostname));var L=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+L,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!b[k])for(P=0,M=l.length;P<M;P++){var q=l[P];if(-1!==_.indexOf(q)){var H=encodeURIComponent(q);H===q&&(H=escape(q)),_=_.split(q).join(H)}}var K=_.indexOf("#");-1!==K&&(this.hash=_.substr(K),_=_.slice(0,K));var $=_.indexOf("?");if(-1!==$?(this.search=_.substr($),this.query=_.substr($+1),t&&(this.query=v.parse(this.query)),_=_.slice(0,$)):t&&(this.search="",this.query={}),_&&(this.pathname=_),g[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var V=this.search||"";this.path=L+V}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&o.isObject(this.query)&&Object.keys(this.query).length&&(a=v.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},a.prototype.resolve=function(e){return this.resolveObject(_(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(o.isString(e)){var t=new a;t.parse(e,!1,!0),e=t}for(var r=new a,n=Object.keys(this),i=0;i<n.length;i++){var s=n[i];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var f=u[c];"protocol"!==f&&(r[f]=e[f])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var l=Object.keys(e),h=0;h<l.length;h++){var d=l[h];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",b=r.search||"";r.path=y+b}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=_||v||r.host&&e.pathname,S=w,k=r.pathname&&r.pathname.split("/")||[],E=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===k[0]?k[0]=r.host:k.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),w=w&&(""===p[0]||""===k[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,k=p;else if(p.length)k||(k=[]),k.pop(),k=k.concat(p),r.search=e.search,r.query=e.query;else if(!o.isNullOrUndefined(e.search)){if(E)r.hostname=r.host=k.shift(),(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift());return r.search=e.search,r.query=e.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!k.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var x=k.slice(-1)[0],A=(r.host||e.host||k.length>1)&&("."===x||".."===x)||""===x,O=0,P=k.length;P>=0;P--)"."===(x=k[P])?k.splice(P,1):".."===x?(k.splice(P,1),O++):O&&(k.splice(P,1),O--);if(!w&&!S)for(;O--;O)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),A&&"/"!==k.join("/").substr(-1)&&k.push("");var T,I=""===k[0]||k[0]&&"/"===k[0].charAt(0);E&&(r.hostname=r.host=I?"":k.length?k.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift()));return(w=w||r.host&&k.length)&&!I&&k.unshift(""),k.length?r.pathname=k.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},a.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){(function(e,n){var i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}
/*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){var s="object"==o(t)&&t&&!t.nodeType&&t,u="object"==o(e)&&e&&!e.nodeType&&e,c="object"==(void 0===n?"undefined":o(n))&&n;c.global!==c&&c.window!==c&&c.self!==c||(a=c);var f,l,h=2147483647,d=36,p=1,y=26,b=38,m=700,g=72,v=128,_="-",w=/^xn--/,S=/[^\x20-\x7E]/,k=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=d-p,A=Math.floor,O=String.fromCharCode;function P(e){throw new RangeError(E[e])}function T(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+T((e=e.replace(k,".")).split("."),t).join(".")}function j(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function M(e){return T(e,function(e){var t="";return e>65535&&(t+=O((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function B(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function N(e,t,r){var n=0;for(e=r?A(e/m):e>>1,e+=A(e/t);e>x*y>>1;n+=d)e=A(e/x);return A(n+(x+1)*e/(e+b))}function C(e){var t,r,n,i,o,a,s,u,c,f,l,b=[],m=e.length,w=0,S=v,k=g;for((r=e.lastIndexOf(_))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&P("not-basic"),b.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=w,a=1,s=d;i>=m&&P("invalid-input"),((u=(l=e.charCodeAt(i++))-48<10?l-22:l-65<26?l-65:l-97<26?l-97:d)>=d||u>A((h-w)/a))&&P("overflow"),w+=u*a,!(u<(c=s<=k?p:s>=k+y?y:s-k));s+=d)a>A(h/(f=d-c))&&P("overflow"),a*=f;k=N(w-o,t=b.length+1,0==o),A(w/t)>h-S&&P("overflow"),S+=A(w/t),w%=t,b.splice(w++,0,S)}return M(b)}function D(e){var t,r,n,i,o,a,s,u,c,f,l,b,m,w,S,k=[];for(b=(e=j(e)).length,t=v,r=0,o=g,a=0;a<b;++a)(l=e[a])<128&&k.push(O(l));for(n=i=k.length,i&&k.push(_);n<b;){for(s=h,a=0;a<b;++a)(l=e[a])>=t&&l<s&&(s=l);for(s-t>A((h-r)/(m=n+1))&&P("overflow"),r+=(s-t)*m,t=s,a=0;a<b;++a)if((l=e[a])<t&&++r>h&&P("overflow"),l==t){for(u=r,c=d;!(u<(f=c<=o?p:c>=o+y?y:c-o));c+=d)S=u-f,w=d-f,k.push(O(B(f+S%w,0))),u=A(S/w);k.push(O(B(u,0))),o=N(r,m,n==i),r=0,++n}++r,++t}return k.join("")}if(f={version:"1.4.1",ucs2:{decode:j,encode:M},decode:C,encode:D,toASCII:function(e){return I(e,function(e){return S.test(e)?"xn--"+D(e):e})},toUnicode:function(e){return I(e,function(e){return w.test(e)?C(e.slice(4).toLowerCase()):e})}},"object"==o(r(139))&&r(139))void 0===(i=function(){return f}.call(t,r,t,e))||(e.exports=i);else if(s&&u)if(e.exports==s)u.exports=f;else for(l in f)f.hasOwnProperty(l)&&(s[l]=f[l]);else a.punycode=f}(this)}).call(this,r(22)(e),r(6))},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"===n(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(239),t.encode=t.stringify=r(240)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var f=0;f<c;++f){var l,h,d,p,y=e[f].replace(s,"%20"),b=y.indexOf(r);b>=0?(l=y.substr(0,b),h=y.substr(b+1)):(l=y,h=""),d=decodeURIComponent(l),p=decodeURIComponent(h),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){switch(n(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,u){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"===n(e)?a(s(e),function(n){var s=encodeURIComponent(i(n))+r;return o(e[n])?a(e[n],function(e){return s+encodeURIComponent(i(e))}).join(t):s+encodeURIComponent(i(e[n]))}).join(t):u?encodeURIComponent(i(u))+r+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var s=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(242);t.fromSeed=n.fromSeed,t.fromBase58=n.fromBase58,t.fromPublicKey=n.fromPublicKey,t.fromPrivateKey=n.fromPrivateKey},function(e,t,r){"use strict";(function(e){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(243),o=r(47),a=r(34),s=r(8),u=r(154),c=s.BufferN(32),f=s.compile({wif:s.UInt8,bip32:{public:s.UInt32,private:s.UInt32}}),l={wif:128,bip32:{public:76067358,private:76066276}},h=Math.pow(2,31)-1;function d(e){return s.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function p(e){return s.UInt32(e)&&e<=h}var y=function(){function t(e,r,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.__D=e,this.__Q=r,this.chainCode=n,this.network=i,this.__DEPTH=o,this.__INDEX=a,this.__PARENT_FINGERPRINT=u,s(f,i),this.lowR=!1}var r,c,l;return r=t,(c=[{key:"isNeutered",value:function(){return void 0===this.__D}},{key:"neutered",value:function(){return g(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}},{key:"toBase58",value:function(){var t=this.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,n=e.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),o.encode(n)}},{key:"toWIF",value:function(){if(!this.privateKey)throw new TypeError("Missing private key");return u.encode(this.network.wif,this.privateKey,!0)}},{key:"derive",value:function(t){s(s.UInt32,t);var r=t>=2147483648,n=e.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");n[0]=0,this.privateKey.copy(n,1),n.writeUInt32BE(t,33)}else this.publicKey.copy(n,0),n.writeUInt32BE(t,33);var o,u=i.hmacSHA512(this.chainCode,n),c=u.slice(0,32),f=u.slice(32);if(!a.isPrivate(c))return this.derive(t+1);if(this.isNeutered()){var l=a.pointAddScalar(this.publicKey,c,!0);if(null===l)return this.derive(t+1);o=g(l,f,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}else{var h=a.privateAdd(this.privateKey,c);if(null==h)return this.derive(t+1);o=m(h,f,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}return o}},{key:"deriveHardened",value:function(e){return s(p,e),this.derive(e+2147483648)}},{key:"derivePath",value:function(e){s(d,e);var t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce(function(e,t){var r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))},this)}},{key:"sign",value:function(t,r){if(!this.privateKey)throw new Error("Missing private key");if(void 0===r&&(r=this.lowR),!1===r)return a.sign(t,this.privateKey);for(var n=a.sign(t,this.privateKey),i=e.alloc(32,0),o=0;n[0]>127;)o++,i.writeUIntLE(o,0,6),n=a.signWithEntropy(t,this.privateKey,i);return n}},{key:"verify",value:function(e,t){return a.verify(e,this.publicKey,t)}},{key:"depth",get:function(){return this.__DEPTH}},{key:"index",get:function(){return this.__INDEX}},{key:"parentFingerprint",get:function(){return this.__PARENT_FINGERPRINT}},{key:"publicKey",get:function(){return void 0===this.__Q&&(this.__Q=a.pointFromScalar(this.__D,!0)),this.__Q}},{key:"privateKey",get:function(){return this.__D}},{key:"identifier",get:function(){return i.hash160(this.publicKey)}},{key:"fingerprint",get:function(){return this.identifier.slice(0,4)}}])&&n(r.prototype,c),l&&n(r,l),t}();function b(e,t,r){return m(e,t,r)}function m(e,t,r,n,i,o){if(s({privateKey:c,chainCode:c},{privateKey:e,chainCode:t}),r=r||l,!a.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new y(e,void 0,t,r,n,i,o)}function g(e,t,r,n,i,o){if(s({publicKey:s.BufferN(33),chainCode:c},{publicKey:e,chainCode:t}),r=r||l,!a.isPoint(e))throw new TypeError("Point is not on the curve");return new y(void 0,e,t,r,n,i,o)}t.fromBase58=function(e,t){var r=o.decode(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||l;var n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");var i=r[4],a=r.readUInt32BE(5);if(0===i&&0!==a)throw new TypeError("Invalid parent fingerprint");var s=r.readUInt32BE(9);if(0===i&&0!==s)throw new TypeError("Invalid index");var u,c=r.slice(13,45);if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");u=m(r.slice(46,78),c,t,i,s,a)}else u=g(r.slice(45,78),c,t,i,s,a);return u},t.fromPrivateKey=b,t.fromPublicKey=function(e,t,r){return g(e,t,r)},t.fromSeed=function(t,r){if(s(s.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");r=r||l;var n=i.hmacSHA512(e.from("Bitcoin seed","utf8"),t);return b(n.slice(0,32),n.slice(32),r)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(24),i=r(63);t.hash160=function(e){var t=n("sha256").update(e).digest();try{return n("rmd160").update(t).digest()}catch(e){return n("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return i("sha512",e).update(t).digest()}},function(e,t){},function(e,t,r){"use strict";var n=r(88).Buffer,i=r(246);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,u=1,c={},f=!1,l=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){p(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[u]=i,n(u),u++},h.clearImmediate=d}function d(e){delete c[e]}function p(e){if(f)setTimeout(p,0,e);else{var t=c[e];if(t){f=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}(t)}finally{d(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(6),r(16))},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(6))},function(e,t,r){var n=r(0),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";e.exports=o;var n=r(144),i=r(45);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(2),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(89)},function(e,t,r){e.exports=r(33)},function(e,t,r){e.exports=r(87).Transform},function(e,t,r){e.exports=r(87).PassThrough},function(e,t,r){var n=r(2),i=r(40),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var d=~~(h/20),p=0|((t=n)<<5|t>>>27)+f(d,i,o,s)+u+r[h]+a[d];u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(40),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var d=0;d<80;++d){var p=~~(d/20),y=c(n)+l(p,i,o,s)+u+r[d]+a[p]|0;u=s,s=o,o=f(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(145),o=r(40),a=r(3).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(2),i=r(146),o=r(40),a=r(3).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){"use strict";var n=r(2),i=r(3).Buffer,o=r(29),a=i.alloc(128),s=64;function u(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length<s&&(t=i.concat([t,a],s));for(var r=this._ipad=i.allocUnsafe(s),n=this._opad=i.allocUnsafe(s),u=0;u<s;u++)r[u]=54^t[u],n[u]=92^t[u];this._hash=[r]}n(u,o),u.prototype._update=function(e){this._hash.push(e)},u.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=u},function(e,t,r){"use strict";var n=r(261),i=r(3).Buffer;e.exports=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return n.encode(i.concat([t,r],t.length+4))},decode:function(e){var r=t(n.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=n.decodeUnsafe(e);if(r)return t(r)}}}},function(e,t,r){var n=r(262);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(e,t,r){"use strict";var n=r(3).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");var t=new Uint8Array(256);t.fill(255);for(var r=0;r<e.length;r++){var i=e.charAt(r),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=r}var a=e.length,s=e.charAt(0),u=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);var r=0;if(" "!==e[r]){for(var i=0,o=0;e[r]===s;)i++,r++;for(var c=(e.length-r)*u+1>>>0,f=new Uint8Array(c);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var h=0,d=c-1;(0!==l||h<o)&&-1!==d;d--,h++)l+=a*f[d]>>>0,f[d]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=h,r++}if(" "!==e[r]){for(var p=c-o;p!==c&&0===f[p];)p++;var y=n.allocUnsafe(i+(c-p));y.fill(0,0,i);for(var b=i;p!==c;)y[b++]=f[p++];return y}}}return{encode:function(t){if(!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,u=t.length;o!==u&&0===t[o];)o++,r++;for(var f=(u-o)*c+1>>>0,l=new Uint8Array(f);o!==u;){for(var h=t[o],d=0,p=f-1;(0!==h||d<i)&&-1!==p;p--,d++)h+=256*l[p]>>>0,l[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");i=d,o++}for(var y=f-i;y!==f&&0===l[y];)y++;for(var b=s.repeat(r);y<f;++y)b+=e.charAt(l[y]);return b},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},function(e,t){},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.0","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^1.4.3","coveralls":"^2.11.3","grunt":"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2","istanbul":"^0.4.2","jscs":"^2.9.0","jshint":"^2.6.0","mocha":"^2.1.0"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}')},function(e,t){},function(e,t,r){"use strict";var n=r(12),i=r(5),o=r(2),a=r(64),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,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 f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,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}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,d=this.n.clone(),p=new i(1),y=new i(0),b=new i(0),m=new i(1),g=0;0!==h.cmpn(0);){var v=d.div(h);c=d.sub(v.mul(h)),f=b.sub(v.mul(p));var _=m.sub(v.mul(y));if(!n&&c.cmp(l)<0)t=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++g)break;u=c,d=h,h=c,b=p,p=f,m=y,y=_}a=c.neg(),s=f;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},o(c,a.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},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(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),h=s.redMul(f.redISub(l)).redISub(i.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(r=0;r<e;r++){var f=o.redSqr(),l=c.redSqr(),h=l.redSqr(),d=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(l),y=d.redSqr().redISub(p.redAdd(p)),b=p.redISub(y),m=d.redMul(b);m=m.redIAdd(m).redISub(h);var g=c.redMul(s);r+1<e&&(u=u.redMul(h)),o=y,s=g,c=m}return this.curve.jpoint(o,c.redMul(i),s)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),l=this.y.redSqr(),h=l.redSqr(),d=this.x.redAdd(l).redSqr().redISub(f).redISub(h);d=d.redIAdd(d);var p=f.redAdd(f).redIAdd(f),y=p.redSqr(),b=h.redIAdd(h);b=(b=b.redIAdd(b)).redIAdd(b),e=y.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),l=this.y.redSqr(),h=this.x.redMul(l),d=this.x.redSub(f).redMul(this.x.redAdd(f));d=d.redAdd(d).redIAdd(d);var p=h.redIAdd(h),y=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(f);var b=l.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),t=d.redMul(p.redISub(e)).redISub(b)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),f=s.redSqr().redISub(c.redAdd(c)),l=c.redISub(f),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=s.redMul(l).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,d,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.x.redMul(s).redISub(f);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(l,h,d)},f.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){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}},f.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)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(5),i=r(2),o=r(64),a=r(12);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.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 u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,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(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(12),i=r(5),o=r(2),a=r(64),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[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 e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),f=s.redMul(u),l=o.redMul(u),h=a.redMul(s);return this.curve.point(c,f,h,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},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(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";t.sha1=r(270),t.sha224=r(271),t.sha256=r(151),t.sha384=r(272),t.sha512=r(152)},function(e,t,r){"use strict";var n=r(18),i=r(48),o=r(150),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],h=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(a(i,5),c(p,o,f,h),d,r[n],l[p]);d=h,h=f,f=a(o,30),o=i,i=y}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],f),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],d)},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(18),i=r(151);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(18),i=r(152);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(18),i=r(48),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],f=this.h[4],g=r,v=n,_=i,w=c,S=f,k=0;k<80;k++){var E=a(o(u(r,l(k,n,i,c),e[p[k]+t],h(k)),b[k]),f);r=f,f=c,c=o(i,10),i=n,n=E,E=a(o(u(g,l(79-k,v,_,w),e[y[k]+t],d(k)),m[k]),S),g=S,S=w,w=o(_,10),_=v,v=E}E=s(this.h[1],i,w),this.h[1]=s(this.h[2],c,S),this.h[2]=s(this.h[3],f,g),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,_),this.h[0]=E},f.prototype._digest=function(e){return"hex"===e?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],y=[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],b=[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],m=[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(e,t,r){"use strict";var n=r(18),i=r(10);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t){e.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(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(5),o=r(277),a=r(12),s=r(93),u=r(92),c=a.assert,f=r(278),l=r(279);function h(e){if(!(this instanceof h))return new h(e);"string"==typeof e&&(c(s.hasOwnProperty(e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=h,h.prototype.keyPair=function(e){return new f(this,e)},h.prototype.keyFromPrivate=function(e,t){return f.fromPrivate(this,e,t)},h.prototype.keyFromPublic=function(e,t){return f.fromPublic(this,e,t)},h.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||u(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var a=new i(t.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,a){"object"===n(r)&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var s=this.n.byteLength(),u=t.getPrivate().toArray("be",s),c=e.toArray("be",s),f=new o({hash:this.hash,entropy:u,nonce:c,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new i(1)),d=0;;d++){var p=a.k?a.k(d):new i(f.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(h)>=0)){var y=this.g.mul(p);if(!y.isInfinity()){var b=y.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=p.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(y.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return a.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new l({r:m,s:g,recoveryParam:v})}}}}}},h.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n);var o=(t=new l(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(e,t,r,n){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,n);var o=this.n,a=new i(e),s=t.r,u=t.s,f=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var d=t.r.invm(o),p=o.sub(a).mul(d).umod(o),y=u.mul(d).umod(o);return this.g.mulAdd(p,s,y)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(94),i=r(148),o=r(10);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(5),i=r(12).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(5),i=r(12),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a];return t.place=a,i}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(u(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=u(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var c=u(e,r);if(e.length!==c+r.place)return!1;var f=e.slice(r.place,c+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(94),i=r(93),o=r(12),a=o.assert,s=o.parseBytes,u=r(281),c=r(282);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return o.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(12),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(5),o=r(12),a=o.assert,s=o.cachedProperty,u=o.parseBytes;function c(e,t){this.eddsa=e,"object"!==n(t)&&(t=u(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(c,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(c,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(c,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},function(e,t,r){(function(t){var n=r(63),i=t.alloc(1,1),o=t.alloc(1,0);e.exports=function(e,r,a,s,u){var c=t.alloc(32,0),f=t.alloc(32,1);c=n("sha256",c).update(f).update(o).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest(),c=n("sha256",c).update(f).update(i).update(r).update(e).update(u||"").digest(),f=n("sha256",c).update(f).digest();for(var l=f=n("sha256",c).update(f).digest();!s(l)||!a(l);)c=n("sha256",c).update(f).update(o).digest(),f=n("sha256",c).update(f).digest(),l=f=n("sha256",c).update(f).digest();return l}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){var n=r(95),i=r(153);function o(e){return t.isBuffer(e)}function a(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function s(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw i.tfCustomError(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var u=s.bind(null,n.Array),c=s.bind(null,o),f=s.bind(null,a),l=s.bind(null,n.String);var h=Math.pow(2,53)-1;var d={ArrayN:u,Buffer:o,BufferN:c,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:a,HexN:f,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-h&&e<=h&&Math.floor(e)===e},Range:function(e,t,r){function i(n,i){return r(n,i)&&n>e&&n<t}return r=r||n.Number,i.toJSON=function(){return"".concat(r.toJSON()," between [").concat(e,", ").concat(t,"]")},i},StringN:l,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=h&&Math.floor(e)===e}};for(var p in d)d[p].toJSON=function(e){return e}.bind(null,p);e.exports=d}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),i=r(4),o=r(36),a=r(8),s=i.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),a({network:a.maybe(a.Object),output:a.maybe(a.Buffer),data:a.maybe(a.arrayOf(a.Buffer))},e);var r={name:"embed",network:e.network||n.bitcoin};if(o.prop(r,"output",function(){if(e.data)return i.compile([s.OP_RETURN].concat(e.data))}),o.prop(r,"data",function(){if(e.output)return i.decompile(e.output).slice(1)}),t.validate&&e.output){var u=i.decompile(e.output);if(u[0]!==s.OP_RETURN)throw new TypeError("Output is invalid");if(!u.slice(1).every(a.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every(function(e,r){return e.equals(t[r])})}(e.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,r){t=t||4,r=void 0===r||r;var n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){var i=e.readUInt32LE(0),o=e.readUInt8(4);return 128&o?-(4294967296*(-129&o)+i):4294967296*o+i}for(var a=0,s=0;s<n;++s)a|=e[s]<<8*s;return 128&e[n-1]?-(a&~(128<<8*(n-1))):a},t.encode=function(t){for(var r=Math.abs(t),n=function(e){return e>2147483647?5:e>8388607?4:e>32767?3:e>127?2:e>0?1:0}(r),i=e.allocUnsafe(n),o=t<0,a=0;a<n;++a)i.writeUInt8(255&r,a),r>>=8;return 128&i[n-1]?i.writeUInt8(o?128:0,n-1):o&&(i[n-1]|=128),i}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(25),i=r(155),o=r(8),a=e.alloc(1,0);function s(t){for(var r=0;0===t[r];)++r;return r===t.length?a:128&(t=t.slice(r))[0]?e.concat([a,t],1+t.length):t}function u(t){0===t[0]&&(t=t.slice(1));var r=e.alloc(32,0),n=Math.max(0,32-t.length);return t.copy(r,n),r}t.decode=function(t){var r=t.readUInt8(t.length-1),n=-129&r;if(n<=0||n>=4)throw new Error("Invalid hashType "+r);var o=i.decode(t.slice(0,-1)),a=u(o.r),s=u(o.s);return{signature:e.concat([a,s],64),hashType:r}},t.encode=function(t,r){o({signature:n.BufferN(64),hashType:n.UInt8},{signature:t,hashType:r});var a=-129&r;if(a<=0||a>=4)throw new Error("Invalid hashType "+r);var u=e.allocUnsafe(1);u.writeUInt8(r,0);var c=s(t.slice(0,32)),f=s(t.slice(32,64));return e.concat([i.encode(c,f),u])}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(97);function i(e){return e<n.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}e.exports={encodingLength:i,encode:function(e,t,r){var o=i(t);return 1===o?e.writeUInt8(t,r):2===o?(e.writeUInt8(n.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===o?(e.writeUInt8(n.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(n.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),o},decode:function(e,t){var r,i,o=e.readUInt8(t);if(o<n.OP_PUSHDATA1)r=o,i=1;else if(o===n.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),i=2}else if(o===n.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),i=3}else{if(t+5>e.length)return null;if(o!==n.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),i=5}return{opcode:o,number:r,size:i}}}},function(e,t,r){var n=r(97),i={};for(var o in n){i[n[o]]=o}e.exports=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),i=r(4),o=r(36),a=i.OPS,s=r(8),u=r(34),c=a.OP_RESERVED;function f(e,t){return e.length===t.length&&e.every(function(e,r){return e.equals(t[r])})}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function r(e){return i.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===a.OP_0)}t=Object.assign({validate:!0},t||{}),s({network:s.maybe(s.Object),m:s.maybe(s.Number),n:s.maybe(s.Number),output:s.maybe(s.Buffer),pubkeys:s.maybe(s.arrayOf(u.isPoint)),signatures:s.maybe(s.arrayOf(r)),input:s.maybe(s.Buffer)},e);var l={network:e.network||n.bitcoin},h=[],d=!1;function p(e){d||(d=!0,h=i.decompile(e),l.m=h[0]-c,l.n=h[h.length-2]-c,l.pubkeys=h.slice(1,-2))}if(o.prop(l,"output",function(){if(e.m&&l.n&&e.pubkeys)return i.compile([].concat(c+e.m,e.pubkeys,c+l.n,a.OP_CHECKMULTISIG))}),o.prop(l,"m",function(){if(l.output)return p(l.output),l.m}),o.prop(l,"n",function(){if(l.pubkeys)return l.pubkeys.length}),o.prop(l,"pubkeys",function(){if(e.output)return p(e.output),l.pubkeys}),o.prop(l,"signatures",function(){if(e.input)return i.decompile(e.input).slice(1)}),o.prop(l,"input",function(){if(e.signatures)return i.compile([a.OP_0].concat(e.signatures))}),o.prop(l,"witness",function(){if(l.input)return[]}),o.prop(l,"name",function(){if(l.m&&l.n)return"p2ms(".concat(l.m," of ").concat(l.n,")")}),t.validate){if(e.output){if(p(e.output),!s.Number(h[0]))throw new TypeError("Output is invalid");if(!s.Number(h[h.length-2]))throw new TypeError("Output is invalid");if(h[h.length-1]!==a.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(l.m<=0||l.n>16||l.m>l.n||l.n!==h.length-3)throw new TypeError("Output is invalid");if(!l.pubkeys.every(function(e){return u.isPoint(e)}))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==l.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==l.n)throw new TypeError("n mismatch");if(e.pubkeys&&!f(e.pubkeys,l.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(l.n=e.pubkeys.length,l.n<l.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<l.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>l.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==a.OP_0)throw new TypeError("Input is invalid");if(0===l.signatures.length||!l.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!f(e.signatures,l.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(l,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),i=r(4),o=r(36),a=r(8),s=i.OPS,u=r(34);t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),a({network:a.maybe(a.Object),output:a.maybe(a.Buffer),pubkey:a.maybe(u.isPoint),signature:a.maybe(i.isCanonicalScriptSignature),input:a.maybe(a.Buffer)},e);var r=o.value(function(){return i.decompile(e.input)}),c={name:"p2pk",network:e.network||n.bitcoin};if(o.prop(c,"output",function(){if(e.pubkey)return i.compile([e.pubkey,s.OP_CHECKSIG])}),o.prop(c,"pubkey",function(){if(e.output)return e.output.slice(1,-1)}),o.prop(c,"signature",function(){if(e.input)return r()[0]}),o.prop(c,"input",function(){if(e.signature)return i.compile([e.signature])}),o.prop(c,"witness",function(){if(c.input)return[]}),t.validate){if(e.output){if(e.output[e.output.length-1]!==s.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!u.isPoint(c.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(c.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(c.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!i.isCanonicalScriptSignature(c.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(c,e)}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),i=r(13),o=r(4),a=r(36),s=r(8),u=o.OPS,c=r(34),f=r(47);t.p2pkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),output:s.maybe(s.BufferN(25)),pubkey:s.maybe(c.isPoint),signature:s.maybe(o.isCanonicalScriptSignature),input:s.maybe(s.Buffer)},t);var l=a.value(function(){var e=f.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),h=a.value(function(){return o.decompile(t.input)}),d=t.network||i.bitcoin,p={name:"p2pkh",network:d};if(a.prop(p,"address",function(){if(p.hash){var t=e.allocUnsafe(21);return t.writeUInt8(d.pubKeyHash,0),p.hash.copy(t,1),f.encode(t)}}),a.prop(p,"hash",function(){return t.output?t.output.slice(3,23):t.address?l().hash:t.pubkey||p.pubkey?n.hash160(t.pubkey||p.pubkey):void 0}),a.prop(p,"output",function(){if(p.hash)return o.compile([u.OP_DUP,u.OP_HASH160,p.hash,u.OP_EQUALVERIFY,u.OP_CHECKSIG])}),a.prop(p,"pubkey",function(){if(t.input)return h()[1]}),a.prop(p,"signature",function(){if(t.input)return h()[0]}),a.prop(p,"input",function(){if(t.pubkey&&t.signature)return o.compile([t.signature,t.pubkey])}),a.prop(p,"witness",function(){if(p.input)return[]}),r.validate){var y=e.from([]);if(t.address){if(l().version!==d.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==l().hash.length)throw new TypeError("Invalid address");y=l().hash}if(t.hash){if(y.length>0&&!y.equals(t.hash))throw new TypeError("Hash mismatch");y=t.hash}if(t.output){if(25!==t.output.length||t.output[0]!==u.OP_DUP||t.output[1]!==u.OP_HASH160||20!==t.output[2]||t.output[23]!==u.OP_EQUALVERIFY||t.output[24]!==u.OP_CHECKSIG)throw new TypeError("Output is invalid");var b=t.output.slice(3,23);if(y.length>0&&!y.equals(b))throw new TypeError("Hash mismatch");y=b}if(t.pubkey){var m=n.hash160(t.pubkey);if(y.length>0&&!y.equals(m))throw new TypeError("Hash mismatch");y=m}if(t.input){var g=h();if(2!==g.length)throw new TypeError("Input is invalid");if(!o.isCanonicalScriptSignature(g[0]))throw new TypeError("Input has invalid signature");if(!c.isPoint(g[1]))throw new TypeError("Input has invalid pubkey");if(t.signature&&!t.signature.equals(g[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(g[1]))throw new TypeError("Pubkey mismatch");var v=n.hash160(g[1]);if(y.length>0&&!y.equals(v))throw new TypeError("Hash mismatch")}}return Object.assign(p,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),i=r(13),o=r(4),a=r(36),s=r(8),u=o.OPS,c=r(47);t.p2sh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),output:s.maybe(s.BufferN(23)),redeem:s.maybe({network:s.maybe(s.Object),output:s.maybe(s.Buffer),input:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))}),input:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))},t);var f=t.network;f||(f=t.redeem&&t.redeem.network||i.bitcoin);var l={network:f},h=a.value(function(){var e=c.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),d=a.value(function(){return o.decompile(t.input)}),p=a.value(function(){var e=d();return{network:f,output:e[e.length-1],input:o.compile(e.slice(0,-1)),witness:t.witness||[]}});if(a.prop(l,"address",function(){if(l.hash){var t=e.allocUnsafe(21);return t.writeUInt8(l.network.scriptHash,0),l.hash.copy(t,1),c.encode(t)}}),a.prop(l,"hash",function(){return t.output?t.output.slice(2,22):t.address?h().hash:l.redeem&&l.redeem.output?n.hash160(l.redeem.output):void 0}),a.prop(l,"output",function(){if(l.hash)return o.compile([u.OP_HASH160,l.hash,u.OP_EQUAL])}),a.prop(l,"redeem",function(){if(t.input)return p()}),a.prop(l,"input",function(){if(t.redeem&&t.redeem.input&&t.redeem.output)return o.compile([].concat(o.decompile(t.redeem.input),t.redeem.output))}),a.prop(l,"witness",function(){return l.redeem&&l.redeem.witness?l.redeem.witness:l.input?[]:void 0}),a.prop(l,"name",function(){var e=["p2sh"];return void 0!==l.redeem&&e.push(l.redeem.name),e.join("-")}),r.validate){var y=e.from([]);if(t.address){if(h().version!==f.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==h().hash.length)throw new TypeError("Invalid address");y=h().hash}if(t.hash){if(y.length>0&&!y.equals(t.hash))throw new TypeError("Hash mismatch");y=t.hash}if(t.output){if(23!==t.output.length||t.output[0]!==u.OP_HASH160||20!==t.output[1]||t.output[22]!==u.OP_EQUAL)throw new TypeError("Output is invalid");var b=t.output.slice(2,22);if(y.length>0&&!y.equals(b))throw new TypeError("Hash mismatch");y=b}var m=function(e){if(e.output){var t=o.decompile(e.output);if(!t||t.length<1)throw new TypeError("Redeem.output too short");var r=n.hash160(e.output);if(y.length>0&&!y.equals(r))throw new TypeError("Hash mismatch");y=r}if(e.input){var i=e.input.length>0,a=e.witness&&e.witness.length>0;if(!i&&!a)throw new TypeError("Empty input");if(i&&a)throw new TypeError("Input and witness provided");if(i){var s=o.decompile(e.input);if(!o.isPushOnly(s))throw new TypeError("Non push-only scriptSig")}}};if(t.input){var g=d();if(!g||g.length<1)throw new TypeError("Input too short");if(!e.isBuffer(p().output))throw new TypeError("Input is invalid");m(p())}if(t.redeem){if(t.redeem.network&&t.redeem.network!==f)throw new TypeError("Network mismatch");if(t.input){var v=p();if(t.redeem.output&&!t.redeem.output.equals(v.output))throw new TypeError("Redeem.output mismatch");if(t.redeem.input&&!t.redeem.input.equals(v.input))throw new TypeError("Redeem.input mismatch")}m(t.redeem)}if(t.witness&&t.redeem&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(function(e,r){return e.equals(t[r])})}(t.redeem.witness,t.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(l,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),i=r(13),o=r(4),a=r(36),s=r(8),u=o.OPS,c=r(34),f=r(98),l=e.alloc(0);t.p2wpkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({address:s.maybe(s.String),hash:s.maybe(s.BufferN(20)),input:s.maybe(s.BufferN(0)),network:s.maybe(s.Object),output:s.maybe(s.BufferN(22)),pubkey:s.maybe(c.isPoint),signature:s.maybe(o.isCanonicalScriptSignature),witness:s.maybe(s.arrayOf(s.Buffer))},t);var h=a.value(function(){var r=f.decode(t.address),n=r.words.shift(),i=f.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),d=t.network||i.bitcoin,p={name:"p2wpkh",network:d};if(a.prop(p,"address",function(){if(p.hash){var e=f.toWords(p.hash);return e.unshift(0),f.encode(d.bech32,e)}}),a.prop(p,"hash",function(){return t.output?t.output.slice(2,22):t.address?h().data:t.pubkey||p.pubkey?n.hash160(t.pubkey||p.pubkey):void 0}),a.prop(p,"output",function(){if(p.hash)return o.compile([u.OP_0,p.hash])}),a.prop(p,"pubkey",function(){return t.pubkey?t.pubkey:t.witness?t.witness[1]:void 0}),a.prop(p,"signature",function(){if(t.witness)return t.witness[0]}),a.prop(p,"input",function(){if(p.witness)return l}),a.prop(p,"witness",function(){if(t.pubkey&&t.signature)return[t.signature,t.pubkey]}),r.validate){var y=e.from([]);if(t.address){if(d&&d.bech32!==h().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==h().version)throw new TypeError("Invalid address version");if(20!==h().data.length)throw new TypeError("Invalid address data");y=h().data}if(t.hash){if(y.length>0&&!y.equals(t.hash))throw new TypeError("Hash mismatch");y=t.hash}if(t.output){if(22!==t.output.length||t.output[0]!==u.OP_0||20!==t.output[1])throw new TypeError("Output is invalid");if(y.length>0&&!y.equals(t.output.slice(2)))throw new TypeError("Hash mismatch");y=t.output.slice(2)}if(t.pubkey){var b=n.hash160(t.pubkey);if(y.length>0&&!y.equals(b))throw new TypeError("Hash mismatch");y=b}if(t.witness){if(2!==t.witness.length)throw new TypeError("Witness is invalid");if(!o.isCanonicalScriptSignature(t.witness[0]))throw new TypeError("Witness has invalid signature");if(!c.isPoint(t.witness[1]))throw new TypeError("Witness has invalid pubkey");if(t.signature&&!t.signature.equals(t.witness[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(t.witness[1]))throw new TypeError("Pubkey mismatch");var m=n.hash160(t.witness[1]);if(y.length>0&&!y.equals(m))throw new TypeError("Hash mismatch")}}return Object.assign(p,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(26),i=r(13),o=r(4),a=r(36),s=r(8),u=o.OPS,c=r(98),f=e.alloc(0);t.p2wsh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),s({network:s.maybe(s.Object),address:s.maybe(s.String),hash:s.maybe(s.BufferN(32)),output:s.maybe(s.BufferN(34)),redeem:s.maybe({input:s.maybe(s.Buffer),network:s.maybe(s.Object),output:s.maybe(s.Buffer),witness:s.maybe(s.arrayOf(s.Buffer))}),input:s.maybe(s.BufferN(0)),witness:s.maybe(s.arrayOf(s.Buffer))},t);var l=a.value(function(){var r=c.decode(t.address),n=r.words.shift(),i=c.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),h=a.value(function(){return o.decompile(t.redeem.input)}),d=t.network;d||(d=t.redeem&&t.redeem.network||i.bitcoin);var p={network:d};if(a.prop(p,"address",function(){if(p.hash){var e=c.toWords(p.hash);return e.unshift(0),c.encode(d.bech32,e)}}),a.prop(p,"hash",function(){return t.output?t.output.slice(2):t.address?l().data:p.redeem&&p.redeem.output?n.sha256(p.redeem.output):void 0}),a.prop(p,"output",function(){if(p.hash)return o.compile([u.OP_0,p.hash])}),a.prop(p,"redeem",function(){if(t.witness)return{output:t.witness[t.witness.length-1],input:f,witness:t.witness.slice(0,-1)}}),a.prop(p,"input",function(){if(p.witness)return f}),a.prop(p,"witness",function(){if(t.redeem&&t.redeem.input&&t.redeem.input.length>0&&t.redeem.output&&t.redeem.output.length>0){var e=o.toStack(h());return p.redeem=Object.assign({witness:e},t.redeem),p.redeem.input=f,[].concat(e,t.redeem.output)}if(t.redeem&&t.redeem.output&&t.redeem.witness)return[].concat(t.redeem.witness,t.redeem.output)}),a.prop(p,"name",function(){var e=["p2wsh"];return void 0!==p.redeem&&e.push(p.redeem.name),e.join("-")}),r.validate){var y=e.from([]);if(t.address){if(l().prefix!==d.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==l().version)throw new TypeError("Invalid address version");if(32!==l().data.length)throw new TypeError("Invalid address data");y=l().data}if(t.hash){if(y.length>0&&!y.equals(t.hash))throw new TypeError("Hash mismatch");y=t.hash}if(t.output){if(34!==t.output.length||t.output[0]!==u.OP_0||32!==t.output[1])throw new TypeError("Output is invalid");var b=t.output.slice(2);if(y.length>0&&!y.equals(b))throw new TypeError("Hash mismatch");y=b}if(t.redeem){if(t.redeem.network&&t.redeem.network!==d)throw new TypeError("Network mismatch");if(t.redeem.input&&t.redeem.input.length>0&&t.redeem.witness&&t.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(t.redeem.output){if(0===o.decompile(t.redeem.output).length)throw new TypeError("Redeem.output is invalid");var m=n.sha256(t.redeem.output);if(y.length>0&&!y.equals(m))throw new TypeError("Hash mismatch");y=m}if(t.redeem.input&&!o.isPushOnly(h()))throw new TypeError("Non push-only scriptSig");if(t.witness&&t.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(function(e,r){return e.equals(t[r])})}(t.witness,t.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch")}if(t.witness&&t.redeem&&t.redeem.output&&!t.redeem.output.equals(t.witness[t.witness.length-1]))throw new TypeError("Witness and redeem.output mismatch")}return Object.assign(p,t)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(49),a=r(26),s=r(66),u=r(25),c=r(297),f=r(8),l=r(156),h=new TypeError("Cannot compute merkle root for zero transactions"),d=new TypeError("Cannot compute witness commit for non-segwit block"),p=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}var r,p,b;return r=t,b=[{key:"fromBuffer",value:function(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");var r=0,n=function(t){return r+=t,e.slice(r-t,r)},i=function(){var t=e.readUInt32LE(r);return r+=4,t},o=new t;if(o.version=function(){var t=e.readInt32LE(r);return r+=4,t}(),o.prevHash=n(32),o.merkleRoot=n(32),o.timestamp=i(),o.bits=i(),o.nonce=i(),80===e.length)return o;var a,u=function(){var t=s.Transaction.fromBuffer(e.slice(r),!0);return r+=t.byteLength(),t},c=(a=l.decode(e,r),r+=l.decode.bytes,a);o.transactions=[];for(var f=0;f<c;++f){var h=u();o.transactions.push(h)}var d=o.getWitnessCommit();return d&&(o.witnessCommit=d),o}},{key:"fromHex",value:function(r){return t.fromBuffer(e.from(r,"hex"))}},{key:"calculateTarget",value:function(t){var r=((4278190080&t)>>24)-3,n=8388607&t,i=e.alloc(32,0);return i.writeUIntBE(n,29-r,3),i}},{key:"calculateMerkleRoot",value:function(t,r){if(f([{getHash:u.Function}],t),0===t.length)throw h;if(r&&!y(t))throw d;var n=t.map(function(e){return e.getHash(r)}),i=c(n,a.hash256);return r?a.hash256(e.concat([i,t[0].ins[0].witness[0]])):i}}],(p=[{key:"getWitnessCommit",value:function(){if(!y(this.transactions))return null;var t=this.transactions[0].outs.filter(function(t){return t.script.slice(0,6).equals(e.from("6a24aa21a9ed","hex"))}).map(function(e){return e.script.slice(6,38)});if(0===t.length)return null;var r=t[t.length-1];return r instanceof e&&32===r.length?r:null}},{key:"hasWitnessCommit",value:function(){return this.witnessCommit instanceof e&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}},{key:"hasWitness",value:function(){return(e=this.transactions)instanceof Array&&e.some(function(e){return"object"===n(e)&&e.ins instanceof Array&&e.ins.some(function(e){return"object"===n(e)&&e.witness instanceof Array&&e.witness.length>0})});var e}},{key:"byteLength",value:function(e){return e||!this.transactions?80:80+l.encodingLength(this.transactions.length)+this.transactions.reduce(function(e,t){return e+t.byteLength()},0)}},{key:"getHash",value:function(){return a.hash256(this.toBuffer(!0))}},{key:"getId",value:function(){return o.reverseBuffer(this.getHash()).toString("hex")}},{key:"getUTCDate",value:function(){var e=new Date(0);return e.setUTCSeconds(this.timestamp),e}},{key:"toBuffer",value:function(t){var r,n=e.allocUnsafe(this.byteLength(t)),i=0,o=function(e){e.copy(n,i),i+=e.length},a=function(e){n.writeUInt32LE(e,i),i+=4};return r=this.version,n.writeInt32LE(r,i),i+=4,o(this.prevHash),o(this.merkleRoot),a(this.timestamp),a(this.bits),a(this.nonce),t||!this.transactions?n:(l.encode(this.transactions.length,n,i),i+=l.encode.bytes,this.transactions.forEach(function(e){var t=e.byteLength();e.toBuffer(n,i),i+=t}),n)}},{key:"toHex",value:function(e){return this.toBuffer(e).toString("hex")}},{key:"checkTxRoots",value:function(){var e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&(this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit()))}},{key:"checkProofOfWork",value:function(){var e=o.reverseBuffer(this.getHash()),r=t.calculateTarget(this.bits);return e.compare(r)<=0}},{key:"__checkMerkleRoot",value:function(){if(!this.transactions)throw h;var e=t.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}},{key:"__checkWitnessCommit",value:function(){if(!this.transactions)throw h;if(!this.hasWitnessCommit())throw d;var e=t.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}])&&i(r.prototype,p),b&&i(r,b),t}();function y(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=p}).call(this,r(0).Buffer)},function(e,t,r){(function(t){e.exports=function(e,r){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof r)throw TypeError("Expected digest Function");for(var n=e.length,i=e.concat();n>1;){for(var o=0,a=0;a<n;a+=2,++o){var s=i[a],u=a+1===n?s:i[a+1],c=t.concat([s,u]);i[o]=r(c)}n=o}return i[0]}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}Object.defineProperty(t,"__esModule",{value:!0});var u=r(299),c=r(67),f=r(158),l=r(96),h=r(49),d=r(26),p=r(99),y=r(13),b=r(65),m=r(4),g=r(66),v={network:y.bitcoin,maximumFeeRate:5e3},_=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new u.Psbt(new S);o(this,t),this.data=r,this.opts=Object.assign({},v,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx},0===this.data.inputs.length&&this.setVersion(2);var n=function(e,t,r,n){return Object.defineProperty(e,t,{enumerable:r,writable:n})};n(this,"__CACHE",!1,!0),n(this,"opts",!1,!0)}return s(t,[{key:"combine",value:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return(e=this.data).combine.apply(e,i(r.map(function(e){return e.data}))),this}},{key:"clone",value:function(){var e=t.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}},{key:"setMaximumFeeRate",value:function(e){j(e),this.opts.maximumFeeRate=e}},{key:"setVersion",value:function(e){j(e),M(this.data.inputs,"setVersion");var t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}},{key:"setLocktime",value:function(e){j(e),M(this.data.inputs,"setLocktime");var t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}},{key:"setInputSequence",value:function(e,t){j(t),M(this.data.inputs,"setInputSequence");var r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}},{key:"addInputs",value:function(e){var t=this;return e.forEach(function(e){return t.addInput(e)}),this}},{key:"addInput",value:function(e){M(this.data.inputs,"addInput");var t=this.__CACHE;this.data.addInput(e),C(t,t.__TX.ins[t.__TX.ins.length-1]);var r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&K(this.__CACHE,n,r),t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}},{key:"addOutputs",value:function(e){var t=this;return e.forEach(function(e){return t.addOutput(e)}),this}},{key:"addOutput",value:function(e){M(this.data.inputs,"addOutput");var t=e.address;if("string"==typeof t){var r=this.opts.network,n=l.toOutputScript(t,r);e=Object.assign(e,{script:n})}var i=this.__CACHE;return this.data.addOutput(e),i.__FEE_RATE=void 0,i.__EXTRACTED_TX=void 0,this}},{key:"extractTransaction",value:function(e){if(!this.data.inputs.every(E))throw new Error("Not finalized");var t=this.__CACHE;if(e||function(e,t,r){var n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error("Warning: You are paying around ".concat((o/1e8).toFixed(8)," in ")+"fees, which is ".concat(n," satoshi per byte for a transaction ")+"with a VSize of ".concat(i," bytes (segwit counted as 0.25 byte per ")+"byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.")}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;var r=t.__TX.clone();return $(this.data.inputs,r,t,!0),r}},{key:"getFeeRate",value:function(){if(!this.data.inputs.every(E))throw new Error("PSBT must be finalized to calculate fee rate");var e,t=this.__CACHE;if(t.__FEE_RATE)return t.__FEE_RATE;var r=!0;return t.__EXTRACTED_TX?(e=t.__EXTRACTED_TX,r=!1):e=t.__TX.clone(),$(this.data.inputs,e,t,r),t.__FEE_RATE}},{key:"finalizeAllInputs",value:function(){var e=this;return f.checkForInput(this.data.inputs,0),G(this.data.inputs.length).forEach(function(t){return e.finalizeInput(t)}),this}},{key:"finalizeInput",value:function(e){var t=f.checkForInput(this.data.inputs,e),r=function(e,t,r){var n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(t.nonWitnessUtxo)if(t.redeemScript)i.isP2SH=!0,i.script=t.redeemScript;else{var o=V(r,t,e),a=n.ins[e].index;i.script=o.outs[a].script}else t.witnessUtxo&&(i.isSegwit=!0,i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript?i.script=t.witnessScript:t.redeemScript?i.script=b.p2wpkh({hash:t.redeemScript.slice(2)}).output:i.script=b.p2wpkh({hash:t.witnessUtxo.script.slice(2)}).output);return i}(e,t,this.__CACHE),n=r.script,i=r.isP2SH,o=r.isP2WSH,a=r.isSegwit;if(!n)throw new Error("No script found for input #".concat(e));var s=function(e){return T(e)?"witnesspubkeyhash":P(e)?"pubkeyhash":A(e)?"multisig":O(e)?"pubkey":"nonstandard"}(n);if(!function(e,t,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return k(1,e.partialSig);case"multisig":var n=b.p2ms({output:t});return k(n.m,e.partialSig);default:return!1}}(t,n,s))throw new Error("Can not finalize input #".concat(e));!function(e){if(!e.sighashType||!e.partialSig)return;var t=e.partialSig,r=e.sighashType;t.forEach(function(e){var t=m.signature.decode(e.signature),n=t.hashType;if(r!==n)throw new Error("Signature sighash does not match input sighash type")})}(t);var u=function(e,t,r,n,i,o){var a,s,u=function(e,t,r){var n;switch(t){case"multisig":var i=function(e,t){return b.p2ms({output:e}).pubkeys.map(function(e){return(t.filter(function(t){return t.pubkey.equals(e)})[0]||{}).signature}).filter(function(e){return!!e})}(e,r);n=b.p2ms({output:e,signatures:i});break;case"pubkey":n=b.p2pk({output:e,signature:r[0].signature});break;case"pubkeyhash":n=b.p2pkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=b.p2wpkh({output:e,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(e,t,r),c=o?b.p2wsh({redeem:u}):null,f=i?b.p2sh({redeem:c||u}):null;n?(s=H(c?c.witness:u.witness),f&&(a=f.input)):a=f?f.input:u.input;return{finalScriptSig:a,finalScriptWitness:s}}(n,s,t.partialSig,a,i,o),c=u.finalScriptSig,l=u.finalScriptWitness;if(c&&this.data.updateInput(e,{finalScriptSig:c}),l&&this.data.updateInput(e,{finalScriptWitness:l}),!c&&!l)throw new Error("Unknown error finalizing input #".concat(e));return this.data.clearFinalizedInput(e),this}},{key:"validateSignaturesOfAllInputs",value:function(){var e=this;return f.checkForInput(this.data.inputs,0),G(this.data.inputs.length).map(function(t){return e.validateSignaturesOfInput(t)}).reduce(function(e,t){return!0===t&&e},!0)}},{key:"validateSignaturesOfInput",value:function(e,t){var r=this.data.inputs[e],n=(r||{}).partialSig;if(!r||!n||n.length<1)throw new Error("No signatures to validate");var i=t?n.filter(function(e){return e.pubkey.equals(t)}):n;if(i.length<1)throw new Error("No signatures for this pubkey");var o,a,s,u=[],c=!0,f=!1,l=void 0;try{for(var h,d=i[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var y=h.value,b=m.signature.decode(y.signature),g=s!==b.hashType?L(e,Object.assign({},r,{sighashType:b.hashType}),this.__CACHE):{hash:o,script:a},v=g.hash,_=g.script;s=b.hashType,o=v,a=_,B(y.pubkey,_,"verify");var w=p.fromPublicKey(y.pubkey);u.push(w.verify(v,b.signature))}}catch(e){f=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(f)throw l}}return u.every(function(e){return!0===e})}},{key:"signAllInputsHD",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[g.Transaction.SIGHASH_ALL];if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=G(this.data.inputs.length)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;try{this.signInputHD(u,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}if(r.every(function(e){return!1===e}))throw new Error("No inputs were signed");return this}},{key:"signAllInputsHDAsync",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[g.Transaction.SIGHASH_ALL];return new Promise(function(n,i){if(!e||!e.publicKey||!e.fingerprint)return i(new Error("Need HDSigner to sign input"));var o=[],a=[],s=!0,u=!1,c=void 0;try{for(var f,l=G(t.data.inputs.length)[Symbol.iterator]();!(s=(f=l.next()).done);s=!0){var h=f.value;a.push(t.signInputHDAsync(h,e,r).then(function(){o.push(!0)},function(){o.push(!1)}))}}catch(e){u=!0,c=e}finally{try{s||null==l.return||l.return()}finally{if(u)throw c}}return Promise.all(a).then(function(){if(o.every(function(e){return!1===e}))return i(new Error("No inputs were signed"));n()})})}},{key:"signInputHD",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[g.Transaction.SIGHASH_ALL];if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");var i=z(e,this.data.inputs,t);return i.forEach(function(t){return r.signInput(e,t,n)}),this}},{key:"signInputHDAsync",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[g.Transaction.SIGHASH_ALL];return new Promise(function(i,o){if(!t||!t.publicKey||!t.fingerprint)return o(new Error("Need HDSigner to sign input"));var a=z(e,r.data.inputs,t).map(function(t){return r.signInputAsync(e,t,n)});return Promise.all(a).then(function(){i()}).catch(o)})}},{key:"signAllInputs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[g.Transaction.SIGHASH_ALL];if(!e||!e.publicKey)throw new Error("Need Signer to sign input");var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=G(this.data.inputs.length)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;try{this.signInput(u,e,t),r.push(!0)}catch(e){r.push(!1)}}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}if(r.every(function(e){return!1===e}))throw new Error("No inputs were signed");return this}},{key:"signAllInputsAsync",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[g.Transaction.SIGHASH_ALL];return new Promise(function(i,o){if(!e||!e.publicKey)return o(new Error("Need Signer to sign input"));var a=[],s=[],u=!0,c=!1,f=void 0;try{for(var l,h=t.data.inputs.entries()[Symbol.iterator]();!(u=(l=h.next()).done);u=!0){var d=n(l.value,1)[0];s.push(t.signInputAsync(d,e,r).then(function(){a.push(!0)},function(){a.push(!1)}))}}catch(e){c=!0,f=e}finally{try{u||null==h.return||h.return()}finally{if(c)throw f}}return Promise.all(s).then(function(){if(a.every(function(e){return!1===e}))return o(new Error("No inputs were signed"));i()})})}},{key:"signInput",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[g.Transaction.SIGHASH_ALL];if(!t||!t.publicKey)throw new Error("Need Signer to sign input");var n=F(this.data.inputs,e,t.publicKey,this.__CACHE,r),i=n.hash,o=n.sighashType,a=[{pubkey:t.publicKey,signature:m.signature.encode(t.sign(i),o)}];return this.data.updateInput(e,{partialSig:a}),this}},{key:"signInputAsync",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[g.Transaction.SIGHASH_ALL];return new Promise(function(i,o){if(!t||!t.publicKey)return o(new Error("Need Signer to sign input"));var a=F(r.data.inputs,e,t.publicKey,r.__CACHE,n),s=a.hash,u=a.sighashType;Promise.resolve(t.sign(s)).then(function(n){var o=[{pubkey:t.publicKey,signature:m.signature.encode(n,u)}];r.data.updateInput(e,{partialSig:o}),i()})})}},{key:"toBuffer",value:function(){return this.data.toBuffer()}},{key:"toHex",value:function(){return this.data.toHex()}},{key:"toBase64",value:function(){return this.data.toBase64()}},{key:"updateGlobal",value:function(e){return this.data.updateGlobal(e),this}},{key:"updateInput",value:function(e,t){return this.data.updateInput(e,t),t.nonWitnessUtxo&&K(this.__CACHE,this.data.inputs[e],e),this}},{key:"updateOutput",value:function(e,t){return this.data.updateOutput(e,t),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return this.data.addUnknownKeyValToGlobal(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){return this.data.addUnknownKeyValToInput(e,t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}},{key:"clearFinalizedInput",value:function(e){return this.data.clearFinalizedInput(e),this}},{key:"inputCount",get:function(){return this.data.inputs.length}}],[{key:"fromBase64",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.from(t,"base64");return this.fromBuffer(n,r)}},{key:"fromHex",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.from(t,"hex");return this.fromBuffer(n,r)}},{key:"fromBuffer",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=u.Psbt.fromBuffer(e,w),i=new t(r,n);return N(i.__CACHE.__TX,i.__CACHE),i}}]),t}();t.Psbt=_;var w=function(e){return new S(e)},S=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.from([2,0,0,0,0,0,0,0,0,0]);o(this,t),this.tx=g.Transaction.fromBuffer(r),function(e){if(!e.ins.every(function(e){return e.script&&0===e.script.length&&e.witness&&0===e.witness.length}))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}return s(t,[{key:"getInputOutputCounts",value:function(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}},{key:"addInput",value:function(t){if(void 0===t.hash||void 0===t.index||!e.isBuffer(t.hash)&&"string"!=typeof t.hash||"number"!=typeof t.index)throw new Error("Error adding input.");var r="string"==typeof t.hash?h.reverseBuffer(e.from(t.hash,"hex")):t.hash;this.tx.addInput(r,t.index,t.sequence)}},{key:"addOutput",value:function(t){if(void 0===t.script||void 0===t.value||!e.isBuffer(t.script)||"number"!=typeof t.value)throw new Error("Error adding output.");this.tx.addOutput(t.script,t.value)}},{key:"toBuffer",value:function(){return this.tx.toBuffer()}}]),t}();function k(e,t){if(!t)return!1;if(t.length>e)throw new Error("Too many signatures");return t.length===e}function E(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function x(e){return function(t){try{return e({output:t}),!0}catch(e){return!1}}}var A=x(b.p2ms),O=x(b.p2pk),P=x(b.p2pkh),T=x(b.p2wpkh),I=x(b.p2wsh);function j(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function M(t,r){t.forEach(function(t){var n=!1,i=[];if(0===(t.partialSig||[]).length){if(!t.finalScriptSig&&!t.finalScriptWitness)return;i=function(t){var r=t.finalScriptSig&&m.decompile(t.finalScriptSig)||[],n=t.finalScriptWitness&&m.decompile(t.finalScriptWitness)||[];return r.concat(n).filter(function(t){return e.isBuffer(t)&&m.isCanonicalScriptSignature(t)}).map(function(e){return{signature:e}})}(t)}else i=t.partialSig;if(i.forEach(function(e){var t=m.signature.decode(e.signature).hashType,i=[];switch(t&g.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&t){case g.Transaction.SIGHASH_ALL:break;case g.Transaction.SIGHASH_SINGLE:case g.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(r)&&(n=!0)}),n)throw new Error("Can not modify transaction, signatures exist.")})}function B(e,t,r){var n=d.hash160(e),i=m.decompile(t);if(null===i)throw new Error("Unknown script error");if(!i.some(function(t){return"number"!=typeof t&&(t.equals(e)||t.equals(n))}))throw new Error("Can not ".concat(r," for this input with the key ").concat(e.toString("hex")))}function N(e,t){e.ins.forEach(function(e){C(t,e)})}function C(t,r){var n=h.reverseBuffer(e.from(r.hash)).toString("hex")+":"+r.index;if(t.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");t.__TX_IN_CACHE[n]=1}function D(e,t){return function(r,n,i){var o=e({redeem:{output:i}}).output;if(!n.equals(o))throw new Error("".concat(t," for input #").concat(r," doesn't match the scriptPubKey in the prevout"))}}var U=D(b.p2sh,"Redeem script"),R=D(b.p2wsh,"Witness script");function F(e,t,r,n,i){var o=L(t,f.checkForInput(e,t),n,i),a=o.hash,s=o.sighashType;return B(r,o.script,"sign"),{hash:a,sighashType:s}}function L(e,t,r,n){var i,o,a=r.__TX,s=t.sighashType||g.Transaction.SIGHASH_ALL;if(n&&n.indexOf(s)<0){var u=function(e){var t=e&g.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case g.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case g.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case g.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(s);throw new Error("Sighash type is not allowed. Retry the sign method passing the "+"sighashTypes array of whitelisted types. Sighash type: ".concat(u))}if(t.nonWitnessUtxo){var c=V(r,t,e),f=a.ins[e].hash,l=c.getHash();if(!f.equals(l))throw new Error("Non-witness UTXO hash for input #".concat(e," doesn't match the hash specified in the prevout"));var h=a.ins[e].index,d=c.outs[h];if(t.redeemScript?(U(e,d.script,t.redeemScript),o=t.redeemScript):o=d.script,T(o)||I(o))throw new Error("Input #".concat(e," has nonWitnessUtxo but segwit script: ")+"".concat(o.toString("hex")));i=a.hashForSignature(e,o,s)}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");var p;if(t.redeemScript?(U(e,t.witnessUtxo.script,t.redeemScript),p=t.redeemScript):p=t.witnessUtxo.script,T(p)){var y=b.p2pkh({hash:p.slice(2)}).output;i=a.hashForWitnessV0(e,y,t.witnessUtxo.value,s),o=p}else{if(!I(p))throw new Error("Input #".concat(e," has witnessUtxo but non-segwit script: ")+"".concat(p.toString("hex")));if(!t.witnessScript)throw new Error("Segwit input needs witnessScript if not P2WPKH");R(e,p,t.witnessScript),i=a.hashForWitnessV0(e,t.witnessScript,t.witnessUtxo.value,s),o=t.witnessScript}}return{script:o,sighashType:s,hash:i}}function z(e,t,r){var n=f.checkForInput(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");var i=n.bip32Derivation.map(function(e){return e.masterFingerprint.equals(r.fingerprint)?e:void 0}).filter(function(e){return!!e});if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map(function(e){var t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t})}function q(e){var t=0;function r(){var r=c.decode(e,t);return t+=c.decode.bytes,r}function n(){return n=r(),t+=n,e.slice(t-n,t);var n}return function(){for(var e=r(),t=[],i=0;i<e;i++)t.push(n());return t}()}function H(t){var r,n=e.allocUnsafe(0);function i(t){var r=n.length,i=c.encodingLength(t);n=e.concat([n,e.allocUnsafe(i)]),c.encode(t,n,r)}function o(t){i(t.length),function(t){n=e.concat([n,e.from(t)])}(t)}return i((r=t).length),r.forEach(o),n}function K(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;var n=g.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;var i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get:function(){var e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;var r=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=r,r},set:function(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function $(e,t,r,n){var i=0;e.forEach(function(e,o){if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=q(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){var a=V(r,e,o),s=t.ins[o].index,u=a.outs[s];i+=u.value}});var o=t.outs.reduce(function(e,t){return e+t.value},0),a=i-o;if(a<0)throw new Error("Outputs are spending more than Inputs");var s=t.virtualSize();r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(a/s)}function V(e,t,r){var n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||K(e,t,r),n[r]}function G(e){return i(Array(e).keys())}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(300),o=r(157),a=r(14),s=r(158),u=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:e}}var r,u,c;return r=t,c=[{key:"fromBase64",value:function(t,r){var n=e.from(t,"base64");return this.fromBuffer(n,r)}},{key:"fromHex",value:function(t,r){var n=e.from(t,"hex");return this.fromBuffer(n,r)}},{key:"fromBuffer",value:function(e,t){var r=o.psbtFromBuffer(e,t),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}}],(u=[{key:"toBase64",value:function(){return this.toBuffer().toString("base64")}},{key:"toHex",value:function(){return this.toBuffer().toString("hex")}},{key:"toBuffer",value:function(){return o.psbtToBuffer(this)}},{key:"updateGlobal",value:function(e){return s.updateGlobal(e,this.globalMap),this}},{key:"updateInput",value:function(e,t){var r=s.checkForInput(this.inputs,e);return s.updateInput(t,r),this}},{key:"updateOutput",value:function(e,t){var r=s.checkForOutput(this.outputs,e);return s.updateOutput(t,r),this}},{key:"addUnknownKeyValToGlobal",value:function(e){return s.checkHasKey(e,this.globalMap.unknownKeyVals,s.getEnumLength(a.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}},{key:"addUnknownKeyValToInput",value:function(e,t){var r=s.checkForInput(this.inputs,e);return s.checkHasKey(t,r.unknownKeyVals,s.getEnumLength(a.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}},{key:"addUnknownKeyValToOutput",value:function(e,t){var r=s.checkForOutput(this.outputs,e);return s.checkHasKey(t,r.unknownKeyVals,s.getEnumLength(a.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}},{key:"addInput",value:function(e){var t=this;this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});var r=e.unknownKeyVals||[],n=this.inputs.length-1;if(!Array.isArray(r))throw new Error("unknownKeyVals must be an Array");return r.forEach(function(e){return t.addUnknownKeyValToInput(n,e)}),s.addInputAttributes(this.inputs,e),this}},{key:"addOutput",value:function(e){var t=this;this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});var r=e.unknownKeyVals||[],n=this.outputs.length-1;if(!Array.isArray(r))throw new Error("unknownKeyVals must be an Array");return r.forEach(function(e){return t.addUnknownKeyValToInput(n,e)}),s.addOutputAttributes(this.outputs,e),this}},{key:"clearFinalizedInput",value:function(e){var t=s.checkForInput(this.inputs,e);s.inputCheckUncleanFinalized(e,t);for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(i)||delete t[i]}return this}},{key:"combine",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=i.combine([this].concat(t));return Object.assign(this,n),this}},{key:"getTransaction",value:function(){return this.globalMap.unsignedTx.toBuffer()}}])&&n(r.prototype,u),c&&n(r,c),t}();t.Psbt=u}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(157);function i(e,t,r){return function(n){if(!e.has(n)){var i=r.filter(function(e){return e.key.toString("hex")===n})[0];t.push(i),e.add(n)}}}function o(e){return e.globalMap.unsignedTx}function a(e){var t=new Set;return e.forEach(function(e){var r=e.key.toString("hex");if(t.has(r))throw new Error("Combine: KeyValue Map keys should be unique");t.add(r)}),t}t.combine=function(e){var t=e[0],r=n.psbtToKeyVals(t),s=e.slice(1);if(0===s.length)throw new Error("Combine: Nothing to combine");var u=o(t);if(void 0===u)throw new Error("Combine: Self missing transaction");var c=a(r.globalKeyVals),f=r.inputKeyVals.map(function(e){return a(e)}),l=r.outputKeyVals.map(function(e){return a(e)}),h=!0,d=!1,p=void 0;try{for(var y,b=function(){var e=y.value,t=o(e);if(void 0===t||!t.toBuffer().equals(u.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");var s=n.psbtToKeyVals(e);a(s.globalKeyVals).forEach(i(c,r.globalKeyVals,s.globalKeyVals)),s.inputKeyVals.map(function(e){return a(e)}).forEach(function(e,t){return e.forEach(i(f[t],r.inputKeyVals[t],s.inputKeyVals[t]))}),s.outputKeyVals.map(function(e){return a(e)}).forEach(function(e,t){return e.forEach(i(l[t],r.outputKeyVals[t],s.outputKeyVals[t]))})},m=s[Symbol.iterator]();!(h=(y=m.next()).done);h=!0)b()}catch(e){d=!0,p=e}finally{try{h||null==m.return||m.return()}finally{if(d)throw p}}return n.psbtFromKeyVals(u,{globalMapKeyVals:r.globalKeyVals,inputKeyVals:r.inputKeyVals,outputKeyVals:r.outputKeyVals})}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(100),i=r(101),o=r(67),a=r(14);function s(t,r,n){if(!r.equals(e.from([n])))throw new Error("Format Error: Invalid ".concat(t," key: ").concat(r.toString("hex")))}function u(e,t){var r=t.globalMapKeyVals,o=t.inputKeyVals,u=t.outputKeyVals,c={unsignedTx:e},f=0,l=!0,h=!1,d=void 0;try{for(var p,y=r[Symbol.iterator]();!(l=(p=y.next()).done);l=!0){var b=p.value;switch(b.key[0]){case a.GlobalTypes.UNSIGNED_TX:if(s("global",b.key,a.GlobalTypes.UNSIGNED_TX),f>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");f++;break;case a.GlobalTypes.GLOBAL_XPUB:void 0===c.globalXpub&&(c.globalXpub=[]),c.globalXpub.push(n.globals.globalXpub.decode(b));break;default:c.unknownKeyVals||(c.unknownKeyVals=[]),c.unknownKeyVals.push(b)}}}catch(e){h=!0,d=e}finally{try{l||null==y.return||y.return()}finally{if(h)throw d}}var m=o.length,g=u.length,v=[],_=[],w=!0,S=!1,k=void 0;try{for(var E,x=i.range(m)[Symbol.iterator]();!(w=(E=x.next()).done);w=!0){var A=E.value,O={},P=!0,T=!1,I=void 0;try{for(var j,M=o[A][Symbol.iterator]();!(P=(j=M.next()).done);P=!0){var B=j.value;switch(n.inputs.checkPubkey(B),B.key[0]){case a.InputTypes.NON_WITNESS_UTXO:if(s("input",B.key,a.InputTypes.NON_WITNESS_UTXO),void 0!==O.nonWitnessUtxo||void 0!==O.witnessUtxo)throw new Error("Format Error: Input has multiple [NON_]WITNESS_UTXO");O.nonWitnessUtxo=n.inputs.nonWitnessUtxo.decode(B);break;case a.InputTypes.WITNESS_UTXO:if(s("input",B.key,a.InputTypes.WITNESS_UTXO),void 0!==O.nonWitnessUtxo||void 0!==O.witnessUtxo)throw new Error("Format Error: Input has multiple [NON_]WITNESS_UTXO");O.witnessUtxo=n.inputs.witnessUtxo.decode(B);break;case a.InputTypes.PARTIAL_SIG:void 0===O.partialSig&&(O.partialSig=[]),O.partialSig.push(n.inputs.partialSig.decode(B));break;case a.InputTypes.SIGHASH_TYPE:if(s("input",B.key,a.InputTypes.SIGHASH_TYPE),void 0!==O.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");O.sighashType=n.inputs.sighashType.decode(B);break;case a.InputTypes.REDEEM_SCRIPT:if(s("input",B.key,a.InputTypes.REDEEM_SCRIPT),void 0!==O.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");O.redeemScript=n.inputs.redeemScript.decode(B);break;case a.InputTypes.WITNESS_SCRIPT:if(s("input",B.key,a.InputTypes.WITNESS_SCRIPT),void 0!==O.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");O.witnessScript=n.inputs.witnessScript.decode(B);break;case a.InputTypes.BIP32_DERIVATION:void 0===O.bip32Derivation&&(O.bip32Derivation=[]),O.bip32Derivation.push(n.inputs.bip32Derivation.decode(B));break;case a.InputTypes.FINAL_SCRIPTSIG:s("input",B.key,a.InputTypes.FINAL_SCRIPTSIG),O.finalScriptSig=n.inputs.finalScriptSig.decode(B);break;case a.InputTypes.FINAL_SCRIPTWITNESS:s("input",B.key,a.InputTypes.FINAL_SCRIPTWITNESS),O.finalScriptWitness=n.inputs.finalScriptWitness.decode(B);break;case a.InputTypes.POR_COMMITMENT:s("input",B.key,a.InputTypes.POR_COMMITMENT),O.porCommitment=n.inputs.porCommitment.decode(B);break;default:O.unknownKeyVals||(O.unknownKeyVals=[]),O.unknownKeyVals.push(B)}}}catch(e){T=!0,I=e}finally{try{P||null==M.return||M.return()}finally{if(T)throw I}}v.push(O)}}catch(e){S=!0,k=e}finally{try{w||null==x.return||x.return()}finally{if(S)throw k}}var N=!0,C=!1,D=void 0;try{for(var U,R=i.range(g)[Symbol.iterator]();!(N=(U=R.next()).done);N=!0){var F=U.value,L={},z=!0,q=!1,H=void 0;try{for(var K,$=u[F][Symbol.iterator]();!(z=(K=$.next()).done);z=!0){var V=K.value;switch(n.outputs.checkPubkey(V),V.key[0]){case a.OutputTypes.REDEEM_SCRIPT:if(s("output",V.key,a.OutputTypes.REDEEM_SCRIPT),void 0!==L.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");L.redeemScript=n.outputs.redeemScript.decode(V);break;case a.OutputTypes.WITNESS_SCRIPT:if(s("output",V.key,a.OutputTypes.WITNESS_SCRIPT),void 0!==L.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");L.witnessScript=n.outputs.witnessScript.decode(V);break;case a.OutputTypes.BIP32_DERIVATION:void 0===L.bip32Derivation&&(L.bip32Derivation=[]),L.bip32Derivation.push(n.outputs.bip32Derivation.decode(V));break;default:L.unknownKeyVals||(L.unknownKeyVals=[]),L.unknownKeyVals.push(V)}}}catch(e){q=!0,H=e}finally{try{z||null==$.return||$.return()}finally{if(q)throw H}}_.push(L)}}catch(e){C=!0,D=e}finally{try{N||null==R.return||R.return()}finally{if(C)throw D}}return{globalMap:c,inputs:v,outputs:_}}t.psbtFromBuffer=function(e,t){var r,n=0;function s(){var t=o.decode(e,n);n+=o.encodingLength(t);var r=e.slice(n,n+t);return n+=t,r}function c(){return{key:s(),value:s()}}function f(){if(n>=e.length)throw new Error("Format Error: Unexpected End of PSBT");var t=0===e.readUInt8(n);return t&&n++,t}if(1886610036!==(r=e.readUInt32BE(n),n+=4,r))throw new Error("Format Error: Invalid Magic Number");if(255!==function(){var t=e.readUInt8(n);return n+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");for(var l=[],h={};!f();){var d=c(),p=d.key.toString("hex");if(h[p])throw new Error("Format Error: Keys must be unique for global keymap: key "+p);h[p]=1,l.push(d)}var y=l.filter(function(e){return e.key[0]===a.GlobalTypes.UNSIGNED_TX});if(1!==y.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");var b=t(y[0].value),m=b.getInputOutputCounts(),g=m.inputCount,v=m.outputCount,_=[],w=[],S=!0,k=!1,E=void 0;try{for(var x,A=i.range(g)[Symbol.iterator]();!(S=(x=A.next()).done);S=!0){for(var O=x.value,P={},T=[];!f();){var I=c(),j=I.key.toString("hex");if(P[j])throw new Error("Format Error: Keys must be unique for each input: input index "+O+" key "+j);P[j]=1,T.push(I)}_.push(T)}}catch(e){k=!0,E=e}finally{try{S||null==A.return||A.return()}finally{if(k)throw E}}var M=!0,B=!1,N=void 0;try{for(var C,D=i.range(v)[Symbol.iterator]();!(M=(C=D.next()).done);M=!0){for(var U=C.value,R={},F=[];!f();){var L=c(),z=L.key.toString("hex");if(R[z])throw new Error("Format Error: Keys must be unique for each output: output index "+U+" key "+z);R[z]=1,F.push(L)}w.push(F)}}catch(e){B=!0,N=e}finally{try{M||null==D.return||D.return()}finally{if(B)throw N}}return u(b,{globalMapKeyVals:l,inputKeyVals:_,outputKeyVals:w})},t.checkKeyBuffer=s,t.psbtFromKeyVals=u}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function n(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(t,"__esModule",{value:!0});var i=r(14),o=function(e){return n(Array(e).keys())};t.decode=function(e){if(e.key[0]!==i.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");var t=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:t,path:"m"},n=!0,a=!1,s=void 0;try{for(var u,c=o(e.value.length/4-1)[Symbol.iterator]();!(n=(u=c.next()).done);n=!0){var f=u.value,l=e.value.readUInt32LE(4*f+4),h=!!(2147483648&l),d=2147483647&l;r.path+="/"+d.toString(10)+(h?"'":"")}}catch(e){a=!0,s=e}finally{try{n||null==c.return||c.return()}finally{if(a)throw s}}return r},t.encode=function(t){var r=e.from([i.GlobalTypes.GLOBAL_XPUB]),n=e.concat([r,t.extendedPubkey]),o=t.path.split("/"),a=e.allocUnsafe(4*o.length);t.masterFingerprint.copy(a,0);var s=4;return o.slice(1).forEach(function(e){var t="'"===e.slice(-1),r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),a.writeUInt32LE(r,s),s+=4}),{key:n,value:a}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(t){var r=t.extendedPubkey,n=t.masterFingerprint,i=t.path;return e.isBuffer(r)&&78===r.length&&[2,3].indexOf(r[45])>-1&&e.isBuffer(n)&&4===n.length&&"string"==typeof i&&!!i.match(/^m(\/\d+'?)+$/)},t.canAddToArray=function(e,t,r){var n=t.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(function(e){return e.extendedPubkey.equals(t.extendedPubkey)}).length)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.encode=function(t){return{key:e.from([n.GlobalTypes.UNSIGNED_TX]),value:t.toBuffer()}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.decode=function(e){if(e.key[0]!==n.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.FINAL_SCRIPTSIG]),value:t}},t.expected="Buffer",t.check=function(t){return e.isBuffer(t)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.decode=function(e){if(e.key[0]!==n.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.FINAL_SCRIPTWITNESS]),value:t}},t.expected="Buffer",t.check=function(t){return e.isBuffer(t)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.decode=function(e){if(e.key[0]!==n.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(t){return{key:e.from([n.InputTypes.NON_WITNESS_UTXO]),value:t}},t.expected="Buffer",t.check=function(t){return e.isBuffer(t)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo&&void 0===e.nonWitnessUtxo}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.decode=function(e){if(e.key[0]!==n.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(t){var r=e.from([n.InputTypes.PARTIAL_SIG]);return{key:e.concat([r,t.pubkey]),value:t.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(t){return e.isBuffer(t.pubkey)&&e.isBuffer(t.signature)&&[33,65].includes(t.pubkey.length)&&[2,3,4].includes(t.pubkey[0])&&function(t){if(!e.isBuffer(t)||t.length<9)return!1;if(48!==t[0])return!1;if(t.length!==t[1]+3)return!1;if(2!==t[2])return!1;var r=t[3];if(r>33||r<1)return!1;if(2!==t[3+r+1])return!1;var n=t[3+r+2];return!(n>33||n<1)&&t.length===3+r+2+n+2}(t.signature)},t.canAddToArray=function(e,t,r){var n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(function(e){return e.pubkey.equals(t.pubkey)}).length)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.decode=function(e){if(e.key[0]!==n.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(t){return{key:e.from([n.InputTypes.POR_COMMITMENT]),value:e.from(t,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14);t.decode=function(e){if(e.key[0]!==n.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(t){var r=e.from([n.InputTypes.SIGHASH_TYPE]),i=e.allocUnsafe(4);return i.writeUInt32LE(t,0),{key:r,value:i}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),i=r(101),o=r(67);t.decode=function(e){if(e.key[0]!==n.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));var t=i.readUInt64LE(e.value,0),r=8,a=o.decode(e.value,r);r+=o.encodingLength(a);var s=e.value.slice(r);if(s.length!==a)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:s,value:t}},t.encode=function(t){var r=t.script,a=t.value,s=o.encodingLength(r.length),u=e.allocUnsafe(8+s+r.length);return i.writeUInt64LE(u,a,0),o.encode(r.length,u,8),r.copy(u,8+s),{key:e.from([n.InputTypes.WITNESS_UTXO]),value:u}},t.expected="{ script: Buffer; value: number; }",t.check=function(t){return e.isBuffer(t.script)&&"number"==typeof t.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo&&void 0===e.nonWitnessUtxo}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function r(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return r(Array(e).keys())};t.makeConverter=function(t){return{decode:function(e){if(e.key[0]!==t)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");var r=e.key.slice(1),i={masterFingerprint:e.value.slice(0,4),pubkey:r,path:"m"},o=!0,a=!1,s=void 0;try{for(var u,c=n(e.value.length/4-1)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var f=u.value,l=e.value.readUInt32LE(4*f+4),h=!!(2147483648&l),d=2147483647&l;i.path+="/"+d.toString(10)+(h?"'":"")}}catch(e){a=!0,s=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw s}}return i},encode:function(r){var n=e.from([t]),i=e.concat([n,r.pubkey]),o=r.path.split("/"),a=e.allocUnsafe(4*o.length);r.masterFingerprint.copy(a,0);var s=4;return o.slice(1).forEach(function(e){var t="'"===e.slice(-1),r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),a.writeUInt32LE(r,s),s+=4}),{key:i,value:a}},check:function(t){return e.isBuffer(t.pubkey)&&e.isBuffer(t.masterFingerprint)&&"string"==typeof t.path&&[33,65].includes(t.pubkey.length)&&[2,3,4].includes(t.pubkey[0])&&4===t.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,r){var n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter(function(e){return e.pubkey.equals(t.pubkey)}).length)}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){var r;if(e.includes(t.key[0])&&(33!==(r=t.key.slice(1)).length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return r}}},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(t){return{decode:function(e){if(e.key[0]!==t)throw new Error("Decode Error: could not decode redeemScript with key 0x"+e.key.toString("hex"));return e.value},encode:function(r){return{key:e.from([t]),value:r}},check:function(t){return e.isBuffer(t)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(t){return{decode:function(e){if(e.key[0]!==t)throw new Error("Decode Error: could not decode witnessScript with key 0x"+e.key.toString("hex"));return e.value},encode:function(r){return{key:e.from([t]),value:r}},check:function(t){return e.isBuffer(t)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function n(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}Object.defineProperty(t,"__esModule",{value:!0});var i=r(100),o=r(101);t.psbtToBuffer=function(t){var r=u({globalMap:t.globalMap,inputs:t.inputs,outputs:t.outputs}),n=r.globalKeyVals,i=r.inputKeyVals,a=r.outputKeyVals,s=o.keyValsToBuffer(n),c=function(t){return 0===t.length?[e.from([0])]:t.map(o.keyValsToBuffer)},f=c(i),l=c(a),h=e.allocUnsafe(5);return h.writeUIntBE(482972169471,0,5),e.concat([h,s].concat(f,l))};var a=function(e,t){return e.key.compare(t.key)};function s(e,t){var r=Object.keys(e).filter(function(e){return"unknownKeyVals"!==e}),i=[],o=new Set,s=!0,u=!1,c=void 0;try{for(var f,l=r[Symbol.iterator]();!(s=(f=l.next()).done);s=!0){var h=f.value,d=t[h];if(void 0!==d){var p=e[h],y=Array.isArray(p)?p.map(d.encode):d.encode(p);if(Array.isArray(y)){y.map(function(e){return e.key.toString("hex")}).forEach(function(e){if(o.has(e))throw new Error("Serialize Error: Duplicate key: "+e);o.add(e)}),i.push.apply(i,n(y))}else{var b=y.key.toString("hex");if(o.has(b))throw new Error("Serialize Error: Duplicate key: "+b);o.add(b),i.push(y)}}}}catch(e){u=!0,c=e}finally{try{s||null==l.return||l.return()}finally{if(u)throw c}}var m=e.unknownKeyVals?e.unknownKeyVals.filter(function(e){return!o.has(e.key.toString("hex"))}):[];return i.concat(m).sort(a)}function u(e){var t=e.globalMap,r=e.inputs,n=e.outputs,a=s(t,i.globals),u=[],c=[],f=!0,l=!1,h=void 0;try{for(var d,p=o.range(r.length)[Symbol.iterator]();!(f=(d=p.next()).done);f=!0){var y=s(r[d.value],i.inputs);u.push(y)}}catch(e){l=!0,h=e}finally{try{f||null==p.return||p.return()}finally{if(l)throw h}}var b=!0,m=!1,g=void 0;try{for(var v,_=o.range(n.length)[Symbol.iterator]();!(b=(v=_.next()).done);b=!0){var w=s(n[v.value],i.outputs);c.push(w)}}catch(e){m=!0,g=e}finally{try{b||null==_.return||_.return()}finally{if(m)throw g}}return{globalKeyVals:a,inputKeyVals:u,outputKeyVals:c}}t.psbtToKeyVals=u}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0});var a=r(96),s=r(49),u=r(317),c=r(26),f=r(99),l=r(13),h=r(65),d=r(4),p=r(4),y=r(66),b=r(25),m=r(8),g=u.types,v=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function _(e,t,r){try{m(e,t)}catch(e){throw new Error(r)}}var w=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.bitcoin,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2500;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.network=e,this.maximumFeeRate=r,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new y.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}var r,c,w;return r=t,w=[{key:"fromTransaction",value:function(e,r){var n=new t(r);return n.setVersion(e.version),n.setLockTime(e.locktime),e.outs.forEach(function(e){n.addOutput(e.script,e.value)}),e.ins.forEach(function(e){n.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})}),n.__INPUTS.forEach(function(t,r){!function(e,t,r){if(e.redeemScriptType!==g.P2MS||!e.redeemScript)return;if(e.pubkeys.length===e.signatures.length)return;var n=e.signatures.concat();e.signatures=e.pubkeys.map(function(i){var o,a=f.fromPublicKey(i);return n.some(function(i,s){if(!i)return!1;var u=d.signature.decode(i),c=t.hashForSignature(r,e.redeemScript,u.hashType);return!!a.verify(c,u.signature)&&(n[s]=void 0,o=i,!0)}),o})}(t,e,r)}),n}}],(c=[{key:"setLowR",value:function(e){return m(m.maybe(m.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}},{key:"setLockTime",value:function(e){if(m(b.UInt32,e),this.__INPUTS.some(function(e){return!!e.signatures&&e.signatures.some(function(e){return void 0!==e})}))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}},{key:"setVersion",value:function(e){m(b.UInt32,e),this.__TX.version=e}},{key:"addInput",value:function(t,r,n,i){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");var o,a;if("string"==typeof(a=t)||a instanceof String)t=s.reverseBuffer(e.from(t,"hex"));else if(function(e){return e instanceof y.Transaction}(t)){var u=t.outs[r];i=u.script,o=u.value,t=t.getHash(!1)}return this.__addInputUnsafe(t,r,{sequence:n,prevOutScript:i,value:o})}},{key:"addOutput",value:function(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=a.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}},{key:"build",value:function(){return this.__build(!1)}},{key:"buildIncomplete",value:function(){return this.__build(!0)}},{key:"sign",value:function(e,t,r,o,a,s){!function(e){var t=e.input,r=e.ourPubKey,n=e.keyPair,o=e.signatureHash,a=e.hashType,s=e.useLowR,u=!1,c=!0,f=!1,l=void 0;try{for(var h,p=t.pubkeys.entries()[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var y=i(h.value,2),b=y[0],m=y[1];if(r.equals(m)){if(t.signatures[b])throw new Error("Signature already exists");if(33!==r.length&&t.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");var g=n.sign(o,s);t.signatures[b]=d.signature.encode(g,a),u=!0}}}catch(e){f=!0,l=e}finally{try{c||null==p.return||p.return()}finally{if(f)throw l}}if(!u)throw new Error("Key pair cannot sign for this input")}(function(e,t,r,i,o,a,s,u,c,f,l){var p;if("number"==typeof o)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),p=o;else{if("object"!==n(o))throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!v.has(t.prevOutScriptType))throw new TypeError('Unknown prevOutScriptType "'.concat(t.prevOutScriptType,'"'));_(m.Number,t.vin,"sign must include vin parameter as Number (input index)"),_(b.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),_(m.maybe(m.Number),t.hashType,"sign hashType parameter must be a number");var r=(e[t.vin]||[]).prevOutType,n=t.prevOutScriptType;switch(n){case"p2pkh":if(r&&"pubkeyhash"!==r)throw new TypeError("input #".concat(t.vin," is not of type p2pkh: ").concat(r));_(m.value(void 0),t.witnessScript,"".concat(n," requires NO witnessScript")),_(m.value(void 0),t.redeemScript,"".concat(n," requires NO redeemScript")),_(m.value(void 0),t.witnessValue,"".concat(n," requires NO witnessValue"));break;case"p2pk":if(r&&"pubkey"!==r)throw new TypeError("input #".concat(t.vin," is not of type p2pk: ").concat(r));_(m.value(void 0),t.witnessScript,"".concat(n," requires NO witnessScript")),_(m.value(void 0),t.redeemScript,"".concat(n," requires NO redeemScript")),_(m.value(void 0),t.witnessValue,"".concat(n," requires NO witnessValue"));break;case"p2wpkh":if(r&&"witnesspubkeyhash"!==r)throw new TypeError("input #".concat(t.vin," is not of type p2wpkh: ").concat(r));_(m.value(void 0),t.witnessScript,"".concat(n," requires NO witnessScript")),_(m.value(void 0),t.redeemScript,"".concat(n," requires NO redeemScript")),_(b.Satoshi,t.witnessValue,"".concat(n," requires witnessValue"));break;case"p2ms":if(r&&"multisig"!==r)throw new TypeError("input #".concat(t.vin," is not of type p2ms: ").concat(r));_(m.value(void 0),t.witnessScript,"".concat(n," requires NO witnessScript")),_(m.value(void 0),t.redeemScript,"".concat(n," requires NO redeemScript")),_(m.value(void 0),t.witnessValue,"".concat(n," requires NO witnessValue"));break;case"p2sh-p2wpkh":if(r&&"scripthash"!==r)throw new TypeError("input #".concat(t.vin," is not of type p2sh-p2wpkh: ").concat(r));_(m.value(void 0),t.witnessScript,"".concat(n," requires NO witnessScript")),_(m.Buffer,t.redeemScript,"".concat(n," requires redeemScript")),_(b.Satoshi,t.witnessValue,"".concat(n," requires witnessValue"));break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError("input #".concat(t.vin," is not of type ").concat(n,": ").concat(r));_(m.value(void 0),t.witnessScript,"".concat(n," requires NO witnessScript")),_(m.Buffer,t.redeemScript,"".concat(n," requires redeemScript")),_(m.value(void 0),t.witnessValue,"".concat(n," requires NO witnessValue"));break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(r&&"witnessscripthash"!==r)throw new TypeError("input #".concat(t.vin," is not of type ").concat(n,": ").concat(r));_(m.Buffer,t.witnessScript,"".concat(n," requires witnessScript")),_(m.value(void 0),t.redeemScript,"".concat(n," requires NO redeemScript")),_(b.Satoshi,t.witnessValue,"".concat(n," requires witnessValue"));break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError("input #".concat(t.vin," is not of type ").concat(n,": ").concat(r));_(m.Buffer,t.witnessScript,"".concat(n," requires witnessScript")),_(m.Buffer,t.redeemScript,"".concat(n," requires witnessScript")),_(b.Satoshi,t.witnessValue,"".concat(n," requires witnessScript"))}}(t,o),p=o.vin,a=o.keyPair,s=o.redeemScript,u=o.hashType,c=o.witnessValue,f=o.witnessScript}if(void 0===a)throw new Error("sign requires keypair");if(a.network&&a.network!==e)throw new TypeError("Inconsistent network");if(!t[p])throw new Error("No input at index: "+p);if(u=u||y.Transaction.SIGHASH_ALL,r(u))throw new Error("Transaction needs outputs");var w=t[p];if(void 0!==w.redeemScript&&s&&!w.redeemScript.equals(s))throw new Error("Inconsistent redeemScript");var E,x=a.publicKey||a.getPublicKey&&a.getPublicKey();if(!k(w)){if(void 0!==c){if(void 0!==w.value&&w.value!==c)throw new Error("Input did not match witnessValue");m(b.Satoshi,c),w.value=c}if(!k(w)){var A=function(e,t,r,n){if(r&&n){var i=h.p2wsh({redeem:{output:n}}),o=h.p2wsh({output:r}),a=h.p2sh({redeem:{output:r}}),s=h.p2sh({redeem:i});if(!i.hash.equals(o.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!a.hash.equals(s.hash))throw new Error("Redeem script inconsistent with prevOutScript");var u=S(i.redeem.output,t);if(!u.pubkeys)throw new Error(u.type+" not supported as witnessScript ("+d.toASM(n)+")");e.signatures&&e.signatures.some(function(e){return void 0!==e})&&(u.signatures=e.signatures);var c=n;if(u.type===g.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:r,redeemScriptType:g.P2WSH,witnessScript:n,witnessScriptType:u.type,prevOutType:g.P2SH,prevOutScript:a.output,hasWitness:!0,signScript:c,signType:u.type,pubkeys:u.pubkeys,signatures:u.signatures,maxSignatures:u.maxSignatures}}if(r){var f=h.p2sh({redeem:{output:r}});if(e.prevOutScript){var l;try{l=h.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!f.hash.equals(l.hash))throw new Error("Redeem script inconsistent with prevOutScript")}var p=S(f.redeem.output,t);if(!p.pubkeys)throw new Error(p.type+" not supported as redeemScript ("+d.toASM(r)+")");e.signatures&&e.signatures.some(function(e){return void 0!==e})&&(p.signatures=e.signatures);var y=r;return p.type===g.P2WPKH&&(y=h.p2pkh({pubkey:p.pubkeys[0]}).output),{redeemScript:r,redeemScriptType:p.type,prevOutType:g.P2SH,prevOutScript:f.output,hasWitness:p.type===g.P2WPKH,signScript:y,signType:p.type,pubkeys:p.pubkeys,signatures:p.signatures,maxSignatures:p.maxSignatures}}if(n){var b=h.p2wsh({redeem:{output:n}});if(e.prevOutScript){var m=h.p2wsh({output:e.prevOutScript});if(!b.hash.equals(m.hash))throw new Error("Witness script inconsistent with prevOutScript")}var v=S(b.redeem.output,t);if(!v.pubkeys)throw new Error(v.type+" not supported as witnessScript ("+d.toASM(n)+")");e.signatures&&e.signatures.some(function(e){return void 0!==e})&&(v.signatures=e.signatures);var _=n;if(v.type===g.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:n,witnessScriptType:v.type,prevOutType:g.P2WSH,prevOutScript:b.output,hasWitness:!0,signScript:_,signType:v.type,pubkeys:v.pubkeys,signatures:v.signatures,maxSignatures:v.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===g.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===g.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");var w=S(e.prevOutScript,t);if(!w.pubkeys)throw new Error(w.type+" not supported ("+d.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some(function(e){return void 0!==e})&&(w.signatures=e.signatures);var k=e.prevOutScript;return w.type===g.P2WPKH&&(k=h.p2pkh({pubkey:w.pubkeys[0]}).output),{prevOutType:w.type,prevOutScript:e.prevOutScript,hasWitness:w.type===g.P2WPKH,signScript:k,signType:w.type,pubkeys:w.pubkeys,signatures:w.signatures,maxSignatures:w.maxSignatures}}var E=h.p2pkh({pubkey:t}).output;return{prevOutType:g.P2PKH,prevOutScript:E,hasWitness:!1,signScript:E,signType:g.P2PKH,pubkeys:[t],signatures:[void 0]}}(w,x,s,f);Object.assign(w,A)}if(!k(w))throw Error(w.prevOutType+" not supported")}E=w.hasWitness?i.hashForWitnessV0(p,w.signScript,w.value,u):i.hashForSignature(p,w.signScript,u);return{input:w,ourPubKey:x,keyPair:a,signatureHash:E,hashType:u,useLowR:!!l}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,r,o,a,s,this.__USE_LOW_R))}},{key:"__addInputUnsafe",value:function(e,t,r){if(y.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");var n=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[n])throw new Error("Duplicate TxOut: "+n);var i={};if(void 0!==r.script&&(i=function e(t,r,n,i){if(0===t.length&&0===r.length)return{};if(!n){var o=u.input(t,!0),a=u.witness(r,!0);o===g.NONSTANDARD&&(o=void 0),a===g.NONSTANDARD&&(a=void 0),n=o||a}switch(n){case g.P2WPKH:var s=h.p2wpkh({witness:r}),c=s.output,f=s.pubkey,l=s.signature;return{prevOutScript:c,prevOutType:g.P2WPKH,pubkeys:[f],signatures:[l]};case g.P2PKH:var p=h.p2pkh({input:t}),y=p.output,b=p.pubkey,m=p.signature;return{prevOutScript:y,prevOutType:g.P2PKH,pubkeys:[b],signatures:[m]};case g.P2PK:var v=h.p2pk({input:t}),_=v.signature;return{prevOutType:g.P2PK,pubkeys:[void 0],signatures:[_]};case g.P2MS:var w=h.p2ms({input:t,output:i},{allowIncomplete:!0}),S=w.m,k=w.pubkeys,E=w.signatures;return{prevOutType:g.P2MS,pubkeys:k,signatures:E,maxSignatures:S}}if(n===g.P2SH){var x=h.p2sh({input:t,witness:r}),A=x.output,O=x.redeem,P=u.output(O.output),T=e(O.input,O.witness,P,O.output);return T.prevOutType?{prevOutScript:A,prevOutType:g.P2SH,redeemScript:O.output,redeemScriptType:T.prevOutType,witnessScript:T.witnessScript,witnessScriptType:T.witnessScriptType,pubkeys:T.pubkeys,signatures:T.signatures}:{}}if(n===g.P2WSH){var I,j=h.p2wsh({input:t,witness:r}),M=j.output,B=j.redeem,N=u.output(B.output);return(I=N===g.P2WPKH?e(B.input,B.witness,N):e(d.compile(B.witness),[],N,B.output)).prevOutType?{prevOutScript:M,prevOutType:g.P2WSH,witnessScript:B.output,witnessScriptType:I.prevOutType,pubkeys:I.pubkeys,signatures:I.signatures}:{}}return{prevOutType:g.NONSTANDARD,prevOutScript:t}}(r.script,r.witness||[])),void 0!==r.value&&(i.value=r.value),!i.prevOutScript&&r.prevOutScript){var o;if(!i.pubkeys&&!i.signatures){var a=S(r.prevOutScript);a.pubkeys&&(i.pubkeys=a.pubkeys,i.signatures=a.signatures),o=a.type}i.prevOutScript=r.prevOutScript,i.prevOutType=o||u.output(r.prevOutScript)}var s=this.__TX.addInput(e,t,r.sequence,r.scriptSig);return this.__INPUTS[s]=i,this.__PREV_TX_SET[n]=!0,s}},{key:"__build",value:function(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}var t=this.__TX.clone();if(this.__INPUTS.forEach(function(r,n){if(!r.prevOutType&&!e)throw new Error("Transaction is not complete");var i=function e(t,r,n){var i=r.pubkeys||[];var o=r.signatures||[];switch(t){case g.P2PKH:if(0===i.length)break;if(0===o.length)break;return h.p2pkh({pubkey:i[0],signature:o[0]});case g.P2WPKH:if(0===i.length)break;if(0===o.length)break;return h.p2wpkh({pubkey:i[0],signature:o[0]});case g.P2PK:if(0===i.length)break;if(0===o.length)break;return h.p2pk({signature:o[0]});case g.P2MS:var a=r.maxSignatures;o=n?o.map(function(e){return e||p.OPS.OP_0}):o.filter(function(e){return e});var s=!n||a===o.length;return h.p2ms({m:a,pubkeys:i,signatures:o},{allowIncomplete:n,validate:s});case g.P2SH:var u=e(r.redeemScriptType,r,n);if(!u)return;return h.p2sh({redeem:{output:u.output||r.redeemScript,input:u.input,witness:u.witness}});case g.P2WSH:var c=e(r.witnessScriptType,r,n);if(!c)return;return h.p2wsh({redeem:{output:r.witnessScript,input:c.input,witness:c.witness}})}}(r.prevOutType,r,e);if(i)t.setInputScript(n,i.input),t.setWitness(n,i.witness);else{if(!e&&r.prevOutType===g.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}}),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}},{key:"__canModifyInputs",value:function(){return this.__INPUTS.every(function(e){return!e.signatures||e.signatures.every(function(e){return!e||0!=(E(e)&y.Transaction.SIGHASH_ANYONECANPAY)})})}},{key:"__needsOutputs",value:function(e){return e===y.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some(function(e){return!!e.signatures&&e.signatures.some(function(e){return!!e&&!(E(e)&y.Transaction.SIGHASH_NONE)})})}},{key:"__canModifyOutputs",value:function(){var e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every(function(r){return void 0===r.signatures||r.signatures.every(function(r){if(!r)return!0;var n=31&E(r);return n===y.Transaction.SIGHASH_NONE||n===y.Transaction.SIGHASH_SINGLE&&e<=t})})}},{key:"__overMaximumFees",value:function(e){return(this.__INPUTS.reduce(function(e,t){return e+(t.value>>>0)},0)-this.__TX.outs.reduce(function(e,t){return e+t.value},0))/e>this.maximumFeeRate}}])&&o(r.prototype,c),w&&o(r,w),t}();function S(e,t){m(b.Buffer,e);var r=u.output(e);switch(r){case g.P2PKH:if(!t)return{type:r};var n=h.p2pkh({output:e}).hash,i=c.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r};case g.P2WPKH:if(!t)return{type:r};var o=h.p2wpkh({output:e}).hash,a=c.hash160(t);return o.equals(a)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r};case g.P2PK:return{type:r,pubkeys:[h.p2pk({output:e}).pubkey],signatures:[void 0]};case g.P2MS:var s=h.p2ms({output:e});return{type:r,pubkeys:s.pubkeys,signatures:s.pubkeys.map(function(){}),maxSignatures:s.m}}return{type:r}}function k(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function E(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=w}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(102),o=r(320),a=r(103),s=r(104),u=r(325),c=r(328),f=r(330),l=r(332),h={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=h,t.output=function(e){if(f.output.check(e))return h.P2WPKH;if(l.output.check(e))return h.P2WSH;if(s.output.check(e))return h.P2PKH;if(u.output.check(e))return h.P2SH;var t=n.decompile(e);if(!t)throw new TypeError("Invalid script");return i.output.check(t)?h.P2MS:a.output.check(t)?h.P2PK:c.output.check(t)?h.WITNESS_COMMITMENT:o.output.check(t)?h.NULLDATA:h.NONSTANDARD},t.input=function(e,t){var r=n.decompile(e);if(!r)throw new TypeError("Invalid script");return s.input.check(r)?h.P2PKH:u.input.check(r,t)?h.P2SH:i.input.check(r,t)?h.P2MS:a.input.check(r)?h.P2PK:h.NONSTANDARD},t.witness=function(e,t){var r=n.decompile(e);if(!r)throw new TypeError("Invalid script");return f.input.check(r)?h.P2WPKH:l.input.check(r,t)?h.P2WSH:h.NONSTANDARD}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4);function o(e){return e===i.OPS.OP_0||n.isCanonicalScriptSignature(e)}function a(e,t){var r=n.decompile(e);return!(r.length<2)&&(r[0]===i.OPS.OP_0&&(t?r.slice(1).every(o):r.slice(1).every(n.isCanonicalScriptSignature)))}t.check=a,a.toJSON=function(){return"multisig input"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4),o=r(25),a=i.OPS.OP_RESERVED;function s(e,t){var r=n.decompile(e);if(r.length<4)return!1;if(r[r.length-1]!==i.OPS.OP_CHECKMULTISIG)return!1;if(!o.Number(r[0]))return!1;if(!o.Number(r[r.length-2]))return!1;var s=r[0]-a,u=r[r.length-2]-a;return!(s<=0)&&(!(u>16)&&(!(s>u)&&(u===r.length-3&&(!!t||r.slice(1,-2).every(n.isCanonicalPubKey)))))}t.check=s,s.toJSON=function(){return"multi-sig output"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=n.OPS;function o(e){var t=n.compile(e);return t.length>1&&t[0]===i.OP_RETURN}t.check=o,o.toJSON=function(){return"null data output"};var a={check:o};t.output=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4);function i(e){var t=n.decompile(e);return 1===t.length&&n.isCanonicalScriptSignature(t[0])}t.check=i,i.toJSON=function(){return"pubKey input"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4);function o(e){var t=n.decompile(e);return 2===t.length&&n.isCanonicalPubKey(t[0])&&t[1]===i.OPS.OP_CHECKSIG}t.check=o,o.toJSON=function(){return"pubKey output"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4);function i(e){var t=n.decompile(e);return 2===t.length&&n.isCanonicalScriptSignature(t[0])&&n.isCanonicalPubKey(t[1])}t.check=i,i.toJSON=function(){return"pubKeyHash input"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4);function o(e){var t=n.compile(e);return 25===t.length&&t[0]===i.OPS.OP_DUP&&t[1]===i.OPS.OP_HASH160&&20===t[2]&&t[23]===i.OPS.OP_EQUALVERIFY&&t[24]===i.OPS.OP_CHECKSIG}t.check=o,o.toJSON=function(){return"pubKeyHash output"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(326);t.input=n;var i=r(327);t.output=i},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(102),o=r(103),a=r(104),s=r(159),u=r(160);function c(t,r){var c=n.decompile(t);if(c.length<1)return!1;var f=c[c.length-1];if(!e.isBuffer(f))return!1;var l=n.decompile(n.compile(c.slice(0,-1))),h=n.decompile(f);return!!h&&(!!n.isPushOnly(l)&&(1===c.length?u.check(h)||s.check(h):!(!a.input.check(l)||!a.output.check(h))||(!(!i.input.check(l,r)||!i.output.check(h))||!(!o.input.check(l)||!o.output.check(h)))))}t.check=c,c.toJSON=function(){return"scriptHash input"}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4);function o(e){var t=n.compile(e);return 23===t.length&&t[0]===i.OPS.OP_HASH160&&20===t[1]&&t[22]===i.OPS.OP_EQUAL}t.check=o,o.toJSON=function(){return"scriptHash output"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(329);t.output=n},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(4),o=r(25),a=r(8),s=e.from("aa21a9ed","hex");function u(e){var t=n.compile(e);return t.length>37&&t[0]===i.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(s)}t.check=u,u.toJSON=function(){return"Witness commitment output"},t.encode=function(t){a(o.Hash256bit,t);var r=e.allocUnsafe(36);return s.copy(r,0),t.copy(r,4),n.compile([i.OPS.OP_RETURN,r])},t.decode=function(e){return a(u,e),n.decompile(e)[1].slice(4,36)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(331);t.input=n;var i=r(159);t.output=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4);function i(e){var t,r=n.decompile(e);return 2===r.length&&n.isCanonicalScriptSignature(r[0])&&(t=r[1],n.isCanonicalPubKey(t)&&33===t.length)}t.check=i,i.toJSON=function(){return"witnessPubKeyHash input"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(333);t.input=n;var i=r(160);t.output=i},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(8),o=r(102),a=r(103),s=r(104);function u(t,r){if(i(i.Array,t),t.length<1)return!1;var u=t[t.length-1];if(!e.isBuffer(u))return!1;var c=n.decompile(u);if(!c||0===c.length)return!1;var f=n.compile(t.slice(0,-1));return!(!s.input.check(f)||!s.output.check(c))||(!(!o.input.check(f,r)||!o.output.check(c))||!(!a.input.check(f)||!a.output.check(c)))}t.check=u,u.toJSON=function(){return"witnessScriptHash input"}}).call(this,r(0).Buffer)},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports="object"==("undefined"==typeof self?"undefined":r(self))?self.FormData:window.FormData},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenSigner=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.createUnsecuredToken=function(e){return c(e,{typ:"JWT",alg:"none"})+"."};var i,o=r(106),a=(i=o)&&i.__esModule?i:{default:i},s=r(107),u=r(74);function c(e,t){var r=[],n=a.default.encode(JSON.stringify(t));r.push(n);var i=a.default.encode(JSON.stringify(e));return r.push(i),r.join(".")}var f=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t||!r)throw new u.MissingParametersError("a signing algorithm and private key are required");if("string"!=typeof t)throw"signing algorithm parameter must be a string";if(t=t.toUpperCase(),!s.cryptoClients.hasOwnProperty(t))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=s.cryptoClients[t],this.rawPrivateKey=r}return n(e,[{key:"header",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={typ:this.tokenType,alg:this.cryptoClient.algorithmName};return Object.assign({},t,e)}},{key:"sign",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.header(r),i=c(e,n),o=this.cryptoClient.createHash(i),s=this.cryptoClient.signHash(o,this.rawPrivateKey);return t?{header:[a.default.encode(JSON.stringify(n))],payload:JSON.stringify(e),signature:[s]}:[i,s].join(".")}}]),e}();t.TokenSigner=f},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=r(337);function i(t,r){return void 0===r&&(r="utf8"),e.isBuffer(t)?a(t.toString("base64")):a(e.from(t,r).toString("base64"))}function o(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function a(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(t,r){return void 0===r&&(r="utf8"),e.from(o(t),"base64").toString(r)},s.toBase64=o,s.fromBase64=a,s.toBuffer=function(t){return e.from(o(t),"base64")},t.default=s}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var r=t.length,n=r%4;if(!n)return t;var i=r,o=4-n,a=r+o,s=e.alloc(a);for(s.write(t);o--;)s.write("=",i++);return s.toString()}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.SECP256K1Client=void 0;var n,i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(35),a=r(37),s=r(382),u=(n=s)&&n.__esModule?n:{default:n},c=r(389),f=r(450),l=r(74);var h=t.SECP256K1Client=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"createHash",value:function(e){return(0,a.createHash)("sha256").update(e).digest()}},{key:"loadPrivateKey",value:function(e){return 66===e.length&&(e=e.slice(0,64)),t.ec.keyFromPrivate(e)}},{key:"loadPublicKey",value:function(e){return t.ec.keyFromPublic(e,"hex")}},{key:"encodePublicKey",value:function(e,r,n){return t.keyEncoder.encodePublic(e,r,n)}},{key:"derivePublicKey",value:function(e,r){if("string"!=typeof e)throw Error("private key must be a string");if(!(0,c.isHexadecimal)(e))throw Error("private key must be a hex string");if(66==e.length)e=e.slice(0,64);else if(!(e.length<=64))throw Error("private key must be 66 characters or less");return void 0===r&&(r=!0),t.ec.keyFromPrivate(e).getPublic(r,"hex")}},{key:"signHash",value:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"jose";if(!r||!n)throw new l.MissingParametersError("a signing input hash and private key are all required");var o=t.loadPrivateKey(n),a=o.sign(r),s=e.from(a.toDER());if("der"===i)return s.toString("hex");if("jose"===i)return(0,f.derToJose)(s,"ES256");throw Error("Invalid signature format")}},{key:"loadSignature",value:function(e){return(0,f.joseToDer)(e,"ES256")}},{key:"verifyHash",value:function(e,r,n){if(!(e&&r&&n))throw new l.MissingParametersError("a signing input hash, der signature, and public key are all required");return t.loadPublicKey(n).verify(e,r)}}]),t}();h.algorithmName="ES256K",h.ec=new o.ec("secp256k1"),h.keyEncoder=new u.default({curveParameters:[1,3,132,0,10],privatePEMOptions:{label:"EC PRIVATE KEY"},publicPEMOptions:{label:"PUBLIC KEY"},curve:h.ec})}).call(this,r(0).Buffer)},function(e,t,r){e.exports=r(162)},function(e,t,r){(function(t,n){var i,o=r(163),a=r(164),s=r(165),u=r(3).Buffer,c=t.crypto&&t.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function h(e,t,r,n,i){return c.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return c.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)}).then(function(e){return u.from(e)})}e.exports=function(e,r,d,p,y,b){"function"==typeof y&&(b=y,y=void 0);var m=f[(y=y||"sha1").toLowerCase()];if(!m||"function"!=typeof t.Promise)return n.nextTick(function(){var t;try{t=s(e,r,d,p,y)}catch(e){return b(e)}b(null,t)});if(o(e,r,d,p),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");u.isBuffer(e)||(e=u.from(e,a)),u.isBuffer(r)||(r=u.from(r,a)),function(e,t){e.then(function(e){n.nextTick(function(){t(null,e)})},function(e){n.nextTick(function(){t(e)})})}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!c||!c.importKey||!c.deriveBits)return Promise.resolve(!1);if(void 0!==l[e])return l[e];var r=h(i=i||u.alloc(8),i,10,128,e).then(function(){return!0}).catch(function(){return!1});return l[e]=r,r}(m).then(function(t){return t?h(e,r,d,p,m):s(e,r,d,p,y)}),b)}}).call(this,r(6),r(16))},function(e,t,r){var n=r(342),i=r(110),o=r(111),a=r(357),s=r(70);function u(e,t,r){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function c(e,t,r){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var i=s(t,!1,r,n);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var i=s(t,!1,r,n);return c(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,r){var n=r(29),i=r(109),o=r(2),a=r(3).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=i.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,n),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},function(e,t,r){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u<s;u++)o<<=1,o|=e>>>n[u]&1;for(u=s;u<n.length;u++)a<<=1,a|=t>>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<o.length;r++)t<<=1,t|=e>>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],o=0;o<t;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},function(e,t,r){"use strict";var n=r(10);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,i,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},function(e,t,r){"use strict";var n=r(10),i=r(2),o=r(109),a=o.utils,s=o.Cipher;function u(){this.tmp=new Array(2),this.keys=null}function c(e){s.call(this,e);var t=new u;this._desState=t,this.deriveKeys(t,e.key)}i(c,s),e.exports=c,c.create=function(e){return new c(e)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=a.readUInt32BE(t,0),i=a.readUInt32BE(t,4);a.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var o=0;o<e.keys.length;o+=2){var s=f[o>>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,e.keys,o)}},c.prototype._update=function(e,t,r,n){var i=this._desState,o=a.readUInt32BE(e,t),s=a.readUInt32BE(e,t+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},c.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},c.prototype._encrypt=function(e,t,r,n,i){for(var o=t,s=r,u=0;u<e.keys.length;u+=2){var c=e.keys[u],f=e.keys[u+1];a.expand(s,e.tmp,0),c^=e.tmp[0],f^=e.tmp[1];var l=a.substitute(c,f),h=s;s=(o^a.permute(l))>>>0,o=h}a.rip(s,o,n,i)},c.prototype._decrypt=function(e,t,r,n,i){for(var o=r,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],f=e.keys[u+1];a.expand(o,e.tmp,0),c^=e.tmp[0],f^=e.tmp[1];var l=a.substitute(c,f),h=o;o=(s^a.permute(l))>>>0,s=h}a.rip(o,s,n,i)}},function(e,t,r){"use strict";var n=r(10),i=r(2),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];t.prototype[a]=o[a]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new a(this.options.iv);this._cbcState=e},o._update=function(e,t,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];o._update.call(this,a,0,r,n);for(s=0;s<this.blockSize;s++)a[s]=r[n+s]}else{o._update.call(this,e,t,r,n);for(s=0;s<this.blockSize;s++)r[n+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}},function(e,t,r){"use strict";var n=r(10),i=r(2),o=r(109),a=o.Cipher,s=o.DES;function u(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),e.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},function(e,t,r){var n=r(111),i=r(169),o=r(3).Buffer,a=r(170),s=r(29),u=r(69),c=r(70);function f(e,t,r){s.call(this),this._cache=new h,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(2)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function d(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new f(s.module,t,r)}f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=o.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=d,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return d(e,i.key,i.iv)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(50);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t,r){var n=r(3).Buffer,i=r(50);function o(e,t,r){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){a=n.concat([a,o(e,t,r)]);break}i=e._cache.length,a=n.concat([a,o(e,t.slice(0,i),r)]),t=t.slice(i)}return a}},function(e,t,r){var n=r(3).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){var n=r(3).Buffer;function i(e,t,r){for(var n,i,a=-1,s=0;++a<8;)n=t&1<<7-a?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)o[i]=e[i]<<1|e[i+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){(function(e){var n=r(50);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,o)}}).call(this,r(0).Buffer)},function(e,t,r){var n=r(3).Buffer,i=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(169),i=r(3).Buffer,o=r(111),a=r(170),s=r(29),u=r(69),c=r(70);function f(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function h(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new f(s.module,t,r)}r(2)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=i.concat([this.cache,e])},l.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return h(e,n.key,n.iv)},t.createDecipheriv=h},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){(function(e){var n=r(171),i=r(359),o=r(360);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(r,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof r?new o(n(r,s),s,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,s,!0)))}}).call(this,r(0).Buffer)},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(5),i=new(r(172)),o=new n(24),a=new n(11),s=new n(10),u=new n(3),c=new n(7),f=r(171),l=r(30);function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function d(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=y;var p={};function y(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=d):this._primeCode=8}function b(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var l,h=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!i.test(e))return h+=1,h+="02"===r||"05"===r?8:4,p[n]=h,h;switch(i.test(e.shrn(1))||(h+=2),r){case"02":e.mod(o).cmp(a)&&(h+=8);break;case"05":(l=e.mod(s)).cmp(u)&&l.cmp(c)&&(h+=8);break;default:h+=4}return p[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),y.prototype.generateKeys=function(){return this._priv||(this._priv=new n(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},y.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length<o.length){var a=new t(o.length-i.length);a.fill(0),i=t.concat([a,i])}return i},y.prototype.getPublicKey=function(e){return b(this._pub,e)},y.prototype.getPrivateKey=function(e){return b(this._priv,e)},y.prototype.getPrime=function(e){return b(this.__prime,e)},y.prototype.getGenerator=function(e){return b(this._gen,e)},y.prototype.setGenerator=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.__gen=e,this._gen=new n(e),this}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){var n=r(24),i=r(86),o=r(2),a=r(362),s=r(376),u=r(162);function c(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){i.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){return new c(e)}function h(e){return new f(e)}Object.keys(u).forEach(function(e){u[e].id=new t(u[e].id,"hex"),u[e.toLowerCase()]=u[e]}),o(c,i.Writable),c.prototype._write=function(e,t,r){this._hash.update(e),r()},c.prototype.update=function(e,r){return"string"==typeof e&&(e=new t(e,r)),this._hash.update(e),this},c.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=a(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},o(f,i.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,r){return"string"==typeof e&&(e=new t(e,r)),this._hash.update(e),this},f.prototype.verify=function(e,r,n){"string"==typeof r&&(r=new t(r,n)),this.end();var i=this._hash.digest();return s(r,i,e,this._signType,this._tag)},e.exports={Sign:l,Verify:h,createSign:l,createVerify:h}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){var n=r(63),i=r(112),o=r(35).ec,a=r(5),s=r(71),u=r(177);function c(e,r,i,o){if((e=new t(e.toArray())).length<r.byteLength()){var a=new t(r.byteLength()-e.length);a.fill(0),e=t.concat([a,e])}var s=i.length,u=function(e,r){e=(e=f(e,r)).mod(r);var n=new t(e.toArray());if(n.length<r.byteLength()){var i=new t(r.byteLength()-n.length);i.fill(0),n=t.concat([i,n])}return n}(i,r),c=new t(s);c.fill(1);var l=new t(s);return l.fill(0),l=n(o,l).update(c).update(new t([0])).update(e).update(u).digest(),c=n(o,l).update(c).digest(),{k:l=n(o,l).update(c).update(new t([1])).update(e).update(u).digest(),v:c=n(o,l).update(c).digest()}}function f(e,t){var r=new a(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function l(e,r,i){var o,a;do{for(o=new t(0);8*o.length<e.bitLength();)r.v=n(i,r.k).update(r.v).digest(),o=t.concat([o,r.v]);a=f(o,e),r.k=n(i,r.k).update(r.v).update(new t([0])).digest(),r.v=n(i,r.k).update(r.v).digest()}while(-1!==a.cmp(e));return a}function h(e,t,r,n){return e.toRed(a.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,r,n,d,p){var y=s(r);if(y.curve){if("ecdsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");return function(e,r){var n=u[r.curve.join(".")];if(!n)throw new Error("unknown curve "+r.curve.join("."));var i=new o(n).keyFromPrivate(r.privateKey).sign(e);return new t(i.toDER())}(e,y)}if("dsa"===y.type){if("dsa"!==d)throw new Error("wrong private key type");return function(e,r,n){for(var i,o=r.params.priv_key,s=r.params.p,u=r.params.q,d=r.params.g,p=new a(0),y=f(e,u).mod(u),b=!1,m=c(o,u,e,n);!1===b;)i=l(u,m,n),p=h(d,i,s,u),0===(b=i.invm(u).imul(y.add(o.mul(p))).mod(u)).cmpn(0)&&(b=!1,p=new a(0));return function(e,r){e=e.toArray(),r=r.toArray(),128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r));var n=[48,e.length+r.length+4,2,e.length];return n=n.concat(e,[2,r.length],r),new t(n)}(p,b)}(e,y,n)}if("rsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong private key type");e=t.concat([p,e]);for(var b=y.modulus.byteLength(),m=[0,1];e.length+m.length+1<b;)m.push(255);m.push(0);for(var g=-1;++g<e.length;)m.push(e[g]);return i(m,y)},e.exports.getKey=c,e.exports.makeKey=l}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(51);t.certificate=r(373);var i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});t.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});t.PublicKey=a;var s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});t.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});t.EncryptedPrivateKey=c;var f=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});t.DSAPrivateKey=f,t.DSAparam=n.define("DSAparam",function(){this.int()});var l=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});t.ECPrivateKey=l;var h=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});t.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},function(e,t,r){var n=r(51),i=r(2);function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){var t;try{t=r(365).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return i(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},o.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n.decoders[e])),this.decoders[e]},o.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},o.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n.encoders[e])),this.encoders[e]},o.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(module,exports){function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(e),function(t){r[t]=e[t]}),forEach(globals,function(t){e[t]&&(r[t]=e[t])});var o=Object_keys(r),a=n.call(r,this.code);return forEach(Object_keys(r),function(t){(t in e||-1===indexOf(o,t))&&(e[t]=r[t])}),forEach(globals,function(t){t in e||defineProp(e,t,r[t])}),document.body.removeChild(t),a},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),function(r){e[r]=t[r]}),r},forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}}),exports.isContext=function(e){return e instanceof Context},exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(e){var t=new Context;return"object"===_typeof(e)&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}},function(e,t,r){var n=r(2);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){var n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){var t,r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(52).Reporter,o=r(52).EncoderBuffer,a=r(52).DecoderBuffer,s=r(10),u=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(u);function f(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=f;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){var e=this._baseState,t={};l.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},f.prototype._wrap=function(){var e=this._baseState;c.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},f.prototype._init=function(e){var t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),s.equal(t.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!==n(e)||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);var n=e[r];t[n]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){f.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),u.forEach(function(e){f.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}}),f.prototype.use=function(e){s(e);var t=this._baseState;return s(null===t.use),t.use=e,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(e){var t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},f.prototype.explicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},f.prototype.implicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},f.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},f.prototype.key=function(e){var t=this._baseState;return s(null===t.key),t.key=e,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(e){var t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},f.prototype.contains=function(e){var t=this._baseState;return s(null===t.use),t.contains=e,this},f.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var n,i=r.default,o=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){var u=null;if(null!==r.explicit?u=r.explicit:null!==r.implicit?u=r.implicit:null!==r.tag&&(u=r.tag),null!==u||r.any){if(o=this._peekTag(e,u,r.any),e.isError(o))return o}else{var c=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(c)}}if(r.obj&&o&&(n=e.enterObject()),o){if(null!==r.explicit){var f=this._decodeTag(e,r.explicit);if(e.isError(f))return f;e=f}var l=e.offset;if(null===r.use&&null===r.choice){if(r.any)c=e.save();var h=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(h))return h;r.any?i=e.raw(c):e=h}if(t&&t.track&&null!==r.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),i=r.any?i:null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(d,t)}}return r.obj&&o&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==o?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},f.prototype._decodeGeneric=function(e,t,r){var n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},f.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(e,t){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some(function(o){var a=e.save(),s=r.choice[o];try{var u=s._decode(e,t);if(e.isError(u))return!1;n={type:o,value:u},i=!0}catch(t){return e.restore(a),!1}return!0},this),i?n:e.error("Choice not matched")},f.prototype._createEncoderBuffer=function(e){return new o(e,this.reporter)},f.prototype._encode=function(e,t,r){var n=this._baseState;if(null===n.default||n.default!==e){var i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},f.prototype._encodeValue=function(e,t,r){var o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new i);var a=null;if(this.reporter=t,o.optional&&void 0===e){if(null===o.default)return;e=o.default}var s=null,u=!1;if(o.any)a=this._createEncoderBuffer(e);else if(o.choice)a=this._encodeChoice(e,t);else if(o.contains)s=this._getUse(o.contains,r)._encode(e,t),u=!0;else if(o.children)s=o.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if("object"!==n(e))return t.error("Child expected, but input is not object");var o=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),o},this).filter(function(e){return e}),s=this._createEncoderBuffer(s);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return t.error("Too many args for : "+o.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var c=this.clone();c._baseState.implicit=null,s=this._createEncoderBuffer(e.map(function(r){var n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)},c))}else null!==o.use?a=this._getUse(o.use,r)._encode(e,t):(s=this._encodePrimitive(o.tag,e),u=!0);if(!o.any&&null===o.choice){var f=null!==o.implicit?o.implicit:o.tag,l=null===o.implicit?"universal":"context";null===f?null===o.use&&t.error("Tag could be omitted only for .use()"):null===o.use&&(a=this._encodeComposite(f,u,l,s))}return null!==o.explicit&&(a=this._encodeComposite(o.explicit,!1,"context",a)),a},f.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},f.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},f.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},f.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},function(e,t,r){var n=r(174);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n._reverse(t.tag)},function(e,t,r){var n=t;n.der=r(175),n.pem=r(370)},function(e,t,r){var n=r(2),i=r(0).Buffer,o=r(175);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,u=-1,c=0;c<r.length;c++){var f=r[c].match(a);if(null!==f&&f[2]===n){if(-1!==s){if("END"!==f[1])break;u=c;break}if("BEGIN"!==f[1])break;s=c}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+n);var l=r.slice(s+1,u).join("");l.replace(/[^a-z0-9\+\/=]+/gi,"");var h=new i(l,"base64");return o.prototype.decode.call(this,h,t)}},function(e,t,r){var n=t;n.der=r(176),n.pem=r(372)},function(e,t,r){var n=r(2),i=r(176);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){"use strict";var n=r(51),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=n.define("RelativeDistinguishedName",function(){this.setof(o)}),c=n.define("RDNSequence",function(){this.seqof(u)}),f=n.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),l=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),h=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(f),this.key("validity").use(l),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});e.exports=p},function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,a=r(70),s=r(110),u=r(3).Buffer;e.exports=function(e,t){var r,c=e.toString(),f=c.match(n);if(f){var l="aes"+f[1],h=u.from(f[2],"hex"),d=u.from(f[3].replace(/[\r\n]/g,""),"base64"),p=a(t,h.slice(0,8),parseInt(f[1],10)).key,y=[],b=s.createDecipheriv(l,p,h);y.push(b.update(d)),y.push(b.final()),r=u.concat(y)}else{var m=c.match(o);r=new u(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},function(e,t,r){(function(t){var n=r(5),i=r(35).ec,o=r(71),a=r(177);function s(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,r,u,c,f){var l=o(u);if("ec"===l.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,r,l)}if("dsa"===l.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,a=r.data.q,u=r.data.g,c=r.data.pub_key,f=o.signature.decode(e,"der"),l=f.s,h=f.r;s(l,a),s(h,a);var d=n.mont(i),p=l.invm(a);return 0===u.toRed(d).redPow(new n(t).mul(p).mod(a)).fromRed().mul(c.toRed(d).redPow(h.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(h)}(e,r,l)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");r=t.concat([f,r]);for(var h=l.modulus.byteLength(),d=[1],p=0;r.length+d.length+2<h;)d.push(255),p++;d.push(0);for(var y=-1;++y<r.length;)d.push(r[y]);d=new t(d);var b=n.mont(l.modulus);e=(e=new n(e).toRed(b)).redPow(new n(l.publicExponent)),e=new t(e.fromRed().toArray());var m=p<8?1:0;for(h=Math.min(e.length,d.length),e.length!==d.length&&(m=1),y=-1;++y<h;)m|=e[y]^d[y];return 0===m}}).call(this,r(0).Buffer)},function(e,t,r){(function(t){var n=r(35),i=r(5);e.exports=function(e){return new a(e)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(e){this.curveType=o[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function s(e,r,n){Array.isArray(e)||(e=e.toArray());var i=new t(e);if(n&&i.length<n){var o=new t(n-i.length);o.fill(0),i=t.concat([o,i])}return r?i.toString(r):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,a.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},a.prototype.computeSecret=function(e,r,n){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},a.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),s(r,e)},a.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},a.prototype.setPublicKey=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.keys._importPublic(e),this},a.prototype.setPrivateKey=function(e,r){r=r||"utf8",t.isBuffer(e)||(e=new t(e,r));var n=new i(e);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this,r(0).Buffer)},function(e,t,r){t.publicEncrypt=r(379),t.privateDecrypt=r(380),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},function(e,t,r){var n=r(71),i=r(30),o=r(24),a=r(178),s=r(179),u=r(5),c=r(180),f=r(112),l=r(3).Buffer;e.exports=function(e,t,r){var h;h=e.padding?e.padding:r?1:4;var d,p=n(e);if(4===h)d=function(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(l.alloc(0)).digest(),f=c.length,h=2*f;if(n>r-h-2)throw new Error("message too long");var d=l.alloc(r-n-h-2),p=r-f-1,y=i(f),b=s(l.concat([c,d,l.alloc(1,1),t],p),a(y,p)),m=s(y,a(b,f));return new u(l.concat([l.alloc(1),m,b],r))}(p,t);else if(1===h)d=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?l.alloc(a-o-3,255):function(e){var t,r=l.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n<e;)a===o.length&&(o=i(2*e),a=0),(t=o[a++])&&(r[n++]=t);return r}(a-o-3);return new u(l.concat([l.from([0,r?1:2]),n,l.alloc(1),t],a))}(p,t,r);else{if(3!==h)throw new Error("unknown padding");if((d=new u(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?f(d,p):c(d,p)}},function(e,t,r){var n=r(71),i=r(178),o=r(179),a=r(5),s=r(112),u=r(24),c=r(180),f=r(3).Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var h,d=n(e),p=d.modulus.byteLength();if(t.length>p||new a(t).cmp(d.modulus)>=0)throw new Error("decryption error");h=r?c(new a(t),d):s(t,d);var y=f.alloc(p-h.length);if(h=f.concat([y,h],p),4===l)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),l=o(s,i(c,a)),h=o(c,i(l,r-a-1));if(function(e,t){e=f.from(e),t=f.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i<n;)r+=e[i]^t[i];return r}(n,h.slice(0,a)))throw new Error("decryption error");var d=a;for(;0===h[d];)d++;if(1!==h[d++])throw new Error("decryption error");return h.slice(d)}(d,h);if(1===l)return function(e,t,r){var n=t.slice(0,2),i=2,o=0;for(;0!==t[i++];)if(i>=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,h,r);if(3===l)return h;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(3),a=r(30),s=o.Buffer,u=o.kMaxLength,c=e.crypto||e.msCrypto,f=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>f||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function h(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>f||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function d(e,t,r,i){if(n.browser){var o=e.buffer,s=new Uint8Array(o,t,r);return c.getRandomValues(s),i?void n.nextTick(function(){i(null,e)}):e}if(!i)return a(r).copy(e,t),e;a(r,function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)})}c&&c.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(r,t.length),h(n,r,t.length),d(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(r,t.length),void 0===n&&(n=t.length-r);return h(n,r,t.length),d(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(6),r(16))},function(e,t,r){"use strict";e.exports=r(383)},function(e,t,r){"use strict";(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(181),o=r(5),a=r(35).ec,s=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).objid().optional(),this.key("publicKey").explicit(1).bitstr().optional())}),u=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("curve").objid()),this.key("pub").bitstr())}),c={secp256k1:{curveParameters:[1,3,132,0,10],privatePEMOptions:{label:"EC PRIVATE KEY"},publicPEMOptions:{label:"PUBLIC KEY"},curve:new a("secp256k1")}};function f(e){"string"==typeof e&&(!function(e,t){if(!e)throw new Error(t||"Assertion failed")}(c.hasOwnProperty(e),"Unknown curve "+e),e=c[e]),this.options=e,this.algorithmID=[1,2,840,10045,2,1]}f.ECPrivateKeyASN=s,f.SubjectPublicKeyInfoASN=u,f.prototype.privateKeyObject=function(e,r){var n={version:new o(1),privateKey:new t(e,"hex"),parameters:this.options.curveParameters};return r&&(n.publicKey={unused:0,data:new t(r,"hex")}),n},f.prototype.publicKeyObject=function(e){return{algorithm:{id:this.algorithmID,curve:this.options.curveParameters},pub:{unused:0,data:new t(e,"hex")}}},f.prototype.encodePrivate=function(e,r,i){if("raw"===r){if("string"===!n(e))throw"private key must be a string";var o,a=(o=this.options.curve.keyFromPrivate(e,"hex")).getPublic("hex");o=this.privateKeyObject(e,a)}else if("der"===r){if("buffer"==typeof e);else{if("string"!=typeof e)throw"private key must be a buffer or a string";e=new t(e,"hex")}o=s.decode(e,"der")}else{if("pem"!==r)throw"invalid private key format";if("string"===!n(e))throw"private key must be a string";o=s.decode(e,"pem",this.options.privatePEMOptions)}if("raw"===i)return o.privateKey.toString("hex");if("der"===i)return s.encode(o,"der").toString("hex");if("pem"===i)return s.encode(o,"pem",this.options.privatePEMOptions);throw"invalid destination format for private key"},f.prototype.encodePublic=function(e,r,i){var o;if("raw"===r){if("string"===!n(e))throw"public key must be a string";o=this.publicKeyObject(e)}else if("der"===r){if("buffer"==typeof e);else{if("string"!=typeof e)throw"public key must be a buffer or a string";e=new t(e,"hex")}o=u.decode(e,"der")}else{if("pem"!==r)throw"invalid public key format";if("string"===!n(e))throw"public key must be a string";o=u.decode(e,"pem",this.options.publicPEMOptions)}if("raw"===i)return o.pub.data.toString("hex");if("der"===i)return u.encode(o,"der").toString("hex");if("pem"===i)return u.encode(o,"pem",this.options.publicPEMOptions);throw"invalid destination format for public key"},e.exports=f}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(182),i=r(184),o=r(2);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){var t=this.name;function r(e){this._initNamed(e,t)}return o(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";var n=r(2),i=r(183);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){"use strict";var n=r(2),i=r(0).Buffer,o=r(185);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,u=-1,c=0;c<r.length;c++){var f=r[c].match(a);if(null!==f&&f[2]===n){if(-1!==s){if("END"!==f[1])break;u=c;break}if("BEGIN"!==f[1])break;s=c}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+n);var l=r.slice(s+1,u).join("");l.replace(/[^a-z0-9+\/=]+/gi,"");var h=new i(l,"base64");return o.prototype.decode.call(this,h,t)}},function(e,t,r){"use strict";var n=t;n.Reporter=r(114).Reporter,n.DecoderBuffer=r(53).DecoderBuffer,n.EncoderBuffer=r(53).EncoderBuffer,n.Node=r(113)},function(e,t,r){"use strict";var n=t;n._reverse=function(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r}),t},n.der=r(115)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=ke(r(116)),i=ke(r(186)),o=ke(r(390)),a=ke(r(391)),s=ke(r(392)),u=ke(r(393)),c=ke(r(394)),f=ke(r(395)),l=ke(r(396)),h=ke(r(397)),d=ke(r(72)),p=ke(r(398)),y=ke(r(118)),b=ke(r(399)),m=Se(r(400)),g=Se(r(401)),v=ke(r(402)),_=ke(r(403)),w=ke(r(404)),S=ke(r(405)),k=ke(r(406)),E=ke(r(189)),x=ke(r(190)),A=ke(r(407)),O=ke(r(408)),P=ke(r(409)),T=ke(r(188)),I=Se(r(410)),j=ke(r(411)),M=ke(r(191)),B=ke(r(412)),N=ke(r(413)),C=ke(r(414)),D=ke(r(415)),U=ke(r(416)),R=ke(r(417)),F=ke(r(418)),L=ke(r(419)),z=ke(r(420)),q=ke(r(187)),H=ke(r(421)),K=ke(r(422)),$=ke(r(423)),V=ke(r(424)),G=ke(r(425)),W=ke(r(426)),X=ke(r(427)),J=ke(r(428)),Z=ke(r(429)),Y=ke(r(430)),Q=Se(r(431)),ee=ke(r(432)),te=ke(r(433)),re=ke(r(434)),ne=ke(r(435)),ie=ke(r(436)),oe=ke(r(437)),ae=ke(r(438)),se=ke(r(439)),ue=ke(r(440)),ce=ke(r(441)),fe=Se(r(442)),le=ke(r(192)),he=ke(r(193)),de=ke(r(443)),pe=ke(r(444)),ye=ke(r(445)),be=ke(r(446)),me=ke(r(447)),ge=ke(r(194)),ve=ke(r(448)),_e=ke(r(449)),we=ke(r(117));function Se(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(e,r):{};n.get||n.set?Object.defineProperty(t,r,n):t[r]=e[r]}return t.default=e,t}function ke(e){return e&&e.__esModule?e:{default:e}}var Ee={version:"10.11.0",toDate:n.default,toFloat:i.default,toInt:o.default,toBoolean:a.default,equals:s.default,contains:u.default,matches:c.default,isEmail:f.default,isURL:l.default,isMACAddress:h.default,isIP:d.default,isIPRange:p.default,isFQDN:y.default,isBoolean:b.default,isAlpha:m.default,isAlphaLocales:m.locales,isAlphanumeric:g.default,isAlphanumericLocales:g.locales,isNumeric:v.default,isPort:_.default,isLowercase:w.default,isUppercase:S.default,isAscii:k.default,isFullWidth:E.default,isHalfWidth:x.default,isVariableWidth:A.default,isMultibyte:O.default,isSurrogatePair:P.default,isInt:T.default,isFloat:I.default,isFloatLocales:I.locales,isDecimal:j.default,isHexadecimal:M.default,isDivisibleBy:B.default,isHexColor:N.default,isISRC:C.default,isMD5:D.default,isHash:U.default,isJWT:R.default,isJSON:F.default,isEmpty:L.default,isLength:z.default,isByteLength:q.default,isUUID:H.default,isMongoId:K.default,isAfter:$.default,isBefore:V.default,isIn:G.default,isCreditCard:W.default,isIdentityCard:X.default,isISIN:J.default,isISBN:Z.default,isISSN:Y.default,isMobilePhone:Q.default,isMobilePhoneLocales:Q.locales,isPostalCode:fe.default,isPostalCodeLocales:fe.locales,isCurrency:ee.default,isISO8601:te.default,isRFC3339:re.default,isISO31661Alpha2:ne.default,isISO31661Alpha3:ie.default,isBase64:oe.default,isDataURI:ae.default,isMagnetURI:se.default,isMimeType:ue.default,isLatLong:ce.default,ltrim:le.default,rtrim:he.default,trim:de.default,escape:pe.default,unescape:ye.default,stripLow:be.default,whitelist:me.default,blacklist:ge.default,isWhitelisted:ve.default,normalizeEmail:_e.default,toString:we.default};t.default=Ee,e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),parseInt(e,t||10)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),t)return"1"===e||"true"===e;return"0"!==e&&"false"!==e&&""!==e};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),e===t};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(e),e.indexOf((0,i.default)(t))>=0};var n=o(r(1)),i=o(r(117));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){(0,i.default)(e),"[object RegExp]"!==Object.prototype.toString.call(t)&&(t=new RegExp(t,r));return t.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),(t=(0,i.default)(t,c)).require_display_name||t.allow_display_name){var r=e.match(f);if(r)e=r[1];else if(t.require_display_name)return!1}var u=e.split("@"),b=u.pop(),m=u.join("@"),g=b.toLowerCase();if(t.domain_specific_validation&&("gmail.com"===g||"googlemail.com"===g)){var v=(m=m.toLowerCase()).split("+")[0];if(!(0,o.default)(v.replace(".",""),{min:6,max:30}))return!1;for(var _=v.split("."),w=0;w<_.length;w++)if(!h.test(_[w]))return!1}if(!(0,o.default)(m,{max:64})||!(0,o.default)(b,{max:254}))return!1;if(!(0,a.default)(b,{require_tld:t.require_tld})){if(!t.allow_ip_domain)return!1;if(!(0,s.default)(b)){if(!b.startsWith("[")||!b.endsWith("]"))return!1;var S=b.substr(1,b.length-2);if(0===S.length||!(0,s.default)(S))return!1}}if('"'===m[0])return m=m.slice(1,m.length-1),t.allow_utf8_local_part?y.test(m):d.test(m);for(var k=t.allow_utf8_local_part?p:l,E=m.split("."),x=0;x<E.length;x++)if(!k.test(E[x]))return!1;return!0};var n=u(r(1)),i=u(r(38)),o=u(r(187)),a=u(r(118)),s=u(r(72));function u(e){return e&&e.__esModule?e:{default:e}}var c={allow_display_name:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0},f=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i,l=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,h=/^[a-z\d]+$/,d=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,p=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,y=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),!e||e.length>=2083||/[\s<>]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;var r,s,l,h,d,p,y,b;if(t=(0,a.default)(t,u),y=e.split("#"),e=y.shift(),y=e.split("?"),e=y.shift(),(y=e.split("://")).length>1){if(r=y.shift().toLowerCase(),t.require_valid_protocol&&-1===t.protocols.indexOf(r))return!1}else{if(t.require_protocol)return!1;if("//"===e.substr(0,2)){if(!t.allow_protocol_relative_urls)return!1;y[0]=e.substr(2)}}if(""===(e=y.join("://")))return!1;if(y=e.split("/"),""===(e=y.shift())&&!t.require_host)return!0;if((y=e.split("@")).length>1){if(t.disallow_auth)return!1;if((s=y.shift()).indexOf(":")>=0&&s.split(":").length>2)return!1}h=y.join("@"),p=null,b=null;var m=h.match(c);m?(l="",b=m[1],p=m[2]||null):(y=h.split(":"),l=y.shift(),y.length&&(p=y.join(":")));if(null!==p&&(d=parseInt(p,10),!/^[0-9]+$/.test(p)||d<=0||d>65535))return!1;if(!((0,o.default)(l)||(0,i.default)(l,t)||b&&(0,o.default)(b,6)))return!1;if(l=l||b,t.host_whitelist&&!f(l,t.host_whitelist))return!1;if(t.host_blacklist&&f(l,t.host_blacklist))return!1;return!0};var n=s(r(1)),i=s(r(118)),o=s(r(72)),a=s(r(38));function s(e){return e&&e.__esModule?e:{default:e}}var u={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1},c=/^\[([^\]]+)\](?::([0-9]+))?$/;function f(e,t){for(var r=0;r<t.length;r++){var n=t[r];if(e===n||(i=n,"[object RegExp]"===Object.prototype.toString.call(i)&&n.test(e)))return!0}var i;return!1}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),t&&t.no_colons)return a.test(e);return o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/,a=/^([0-9a-fA-F]){12}$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,n.default)(e);var t=e.split("/");if(2!==t.length)return!1;if(!a.test(t[1]))return!1;if(t[1].length>1&&t[1].startsWith("0"))return!1;return(0,i.default)(t[0],4)&&t[1]<=32&&t[1]>=0};var n=o(r(1)),i=o(r(72));function o(e){return e&&e.__esModule?e:{default:e}}var a=/^\d{1,2}$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),["true","false","1","0"].indexOf(e)>=0};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";if((0,i.default)(e),t in o.alpha)return o.alpha[t].test(e);throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(1))&&n.__esModule?n:{default:n},o=r(73);var a=Object.keys(o.alpha);t.locales=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";if((0,i.default)(e),t in o.alphanumeric)return o.alphanumeric[t].test(e);throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(1))&&n.__esModule?n:{default:n},o=r(73);var a=Object.keys(o.alphanumeric);t.locales=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),t&&t.no_symbols)return a.test(e);return o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^[+-]?([0-9]*[.])?[0-9]+$/,a=/^[0-9]+$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e,{min:0,max:65535})};var n,i=(n=r(188))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e===e.toLowerCase()};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e===e.toUpperCase()};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^[\x00-\x7F]+$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.fullWidth.test(e)&&a.halfWidth.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n},o=r(189),a=r(190);e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/[^\x00-\x7F]/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e),t=t||{};var r=new RegExp("^(?:[-+])?(?:[0-9]+)?(?:\\".concat(t.locale?o.decimal[t.locale]:".","[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"));if(""===e||"."===e||"-"===e||"+"===e)return!1;var n=parseFloat(e.replace(",","."));return r.test(e)&&(!t.hasOwnProperty("min")||n>=t.min)&&(!t.hasOwnProperty("max")||n<=t.max)&&(!t.hasOwnProperty("lt")||n<t.lt)&&(!t.hasOwnProperty("gt")||n>t.gt)},t.locales=void 0;var n,i=(n=r(1))&&n.__esModule?n:{default:n},o=r(73);var a=Object.keys(o.decimal);t.locales=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),(t=(0,n.default)(t,u)).locale in a.decimal)return!(0,o.default)(c,e.replace(/ /g,""))&&function(e){return new RegExp("^[-+]?([0-9]+)?(\\".concat(a.decimal[e.locale],"[0-9]{").concat(e.decimal_digits,"})").concat(e.force_decimal?"":"?","$"))}(t).test(e);throw new Error("Invalid locale '".concat(t.locale,"'"))};var n=s(r(38)),i=s(r(1)),o=s(r(119)),a=r(73);function s(e){return e&&e.__esModule?e:{default:e}}var u={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},c=["","-","+"];e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(e),(0,i.default)(e)%parseInt(t,10)==0};var n=o(r(1)),i=o(r(186));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^[a-f0-9]{32}$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),new RegExp("^[a-f0-9]{".concat(o[t],"}$")).test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^([A-Za-z0-9\-_~+\/]+[=]{0,2})\.([A-Za-z0-9\-_~+\/]+[=]{0,2})(?:\.([A-Za-z0-9\-_~+\/]+[=]{0,2}))?$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,o.default)(e);try{var t=JSON.parse(e);return!!t&&"object"===a(t)}catch(e){}return!1};var i,o=(i=r(1))&&i.__esModule?i:{default:i};function a(e){return(a="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)(e),0===((t=(0,i.default)(t,a)).ignore_whitespace?e.trim().length:e.length)};var n=o(r(1)),i=o(r(38));function o(e){return e&&e.__esModule?e:{default:e}}var a={ignore_whitespace:!1};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n;(0,o.default)(e),"object"===a(t)?(r=t.min||0,n=t.max):(r=arguments[1],n=arguments[2]);var i=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],s=e.length-i.length;return s>=r&&(void 0===n||s<=n)};var i,o=(i=r(1))&&i.__esModule?i:{default:i};function a(e){return(a="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";(0,i.default)(e);var r=o[t];return r&&r.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.default)(e),(0,i.default)(e)&&24===e.length};var n=o(r(1)),i=o(r(191));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);(0,n.default)(e);var r=(0,i.default)(t),o=(0,i.default)(e);return!!(o&&r&&o>r)};var n=o(r(1)),i=o(r(116));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:String(new Date);(0,n.default)(e);var r=(0,i.default)(t),o=(0,i.default)(e);return!!(o&&r&&o<r)};var n=o(r(1)),i=o(r(116));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r;if((0,i.default)(e),"[object Array]"===Object.prototype.toString.call(t)){var n=[];for(r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=(0,o.default)(t[r]));return n.indexOf(e)>=0}if("object"===s(t))return t.hasOwnProperty(e);if(t&&"function"==typeof t.indexOf)return t.indexOf(e)>=0;return!1};var i=a(r(1)),o=a(r(117));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){return(s="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);var t=e.replace(/[- ]+/g,"");if(!o.test(t))return!1;for(var r,n,a,s=0,u=t.length-1;u>=0;u--)r=t.substring(u,u+1),n=parseInt(r,10),s+=a&&(n*=2)>=10?n%10+1:n,a=!a;return!(s%10!=0||!t)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14})$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if((0,i.default)(e),t in o)return o[t](e);if("any"===t){for(var r in o)if(o.hasOwnProperty(r)){var n=o[r];if(n(e))return!0}return!1}throw new Error("Invalid locale '".concat(t,"'"))};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o={ES:function(e){(0,i.default)(e);var t={X:0,Y:1,Z:2},r=e.trim().toUpperCase();if(!/^[0-9X-Z][0-9]{7}[TRWAGMYFPDXBNJZSQVHLCKE]$/.test(r))return!1;var n=r.slice(0,-1).replace(/[X,Y,Z]/g,function(e){return t[e]});return r.endsWith(["T","R","W","A","G","M","Y","F","P","D","X","B","N","J","Z","S","Q","V","H","L","C","K","E"][n%23])}};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,i.default)(e),!o.test(e))return!1;for(var t,r,n=e.replace(/[A-Z]/g,function(e){return parseInt(e,36)}),a=0,s=!0,u=n.length-2;u>=0;u--)t=n.substring(u,u+1),r=parseInt(t,10),a+=s&&(r*=2)>=10?r+1:r,s=!s;return parseInt(e.substr(e.length-1),10)===(1e4-a)%10};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";(0,i.default)(t);r=String(r);if(!r)return e(t,10)||e(t,13);var n=t.replace(/[\s-]+/g,"");var u=0;var c;if("10"===r){if(!o.test(n))return!1;for(c=0;c<9;c++)u+=(c+1)*n.charAt(c);if("X"===n.charAt(9)?u+=100:u+=10*n.charAt(9),u%11==0)return!!n}else if("13"===r){if(!a.test(n))return!1;for(c=0;c<12;c++)u+=s[c%2]*n.charAt(c);if(n.charAt(12)-(10-u%10)%10==0)return!!n}return!1};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^(?:[0-9]{9}X|[0-9]{10})$/,a=/^(?:[0-9]{13})$/,s=[1,3];e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.default)(e);var r=o;if(r=t.require_hyphen?r.replace("?",""):r,!(r=t.case_sensitive?new RegExp(r):new RegExp(r,"i")).test(e))return!1;for(var n=e.replace("-","").toUpperCase(),a=0,s=0;s<n.length;s++){var u=n[s];a+=("X"===u?10:+u)*(8-s)}return a%11==0};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o="^\\d{4}-?\\d{3}[\\dX]$";e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){if((0,i.default)(e),r&&r.strictMode&&!e.startsWith("+"))return!1;if(Array.isArray(t))return t.some(function(t){if(o.hasOwnProperty(t)){var r=o[t];if(r.test(e))return!0}return!1});if(t in o)return o[t].test(e);if(!t||"any"===t){for(var n in o)if(o.hasOwnProperty(n)){var a=o[n];if(a.test(e))return!0}return!1}throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o={"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-EG":/^((\+?20)|0)?1[012]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)[569]\d{7}$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/\+?(88)?0?1[356789][0-9]{8}\b/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^(\+49)?0?1(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7}$/,"el-GR":/^(\+?30|0)?(69\d{8})$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28)\d{7}$/,"en-HK":/^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-KE":/^(\+?254|0)?[7]\d{8}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PK":/^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[89]\d{7}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"es-ES":/^(\+?34)?(6\d{1}|7[1234])\d{7}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36)(20|30|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"ja-JP":/^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"ms-MY":/^(\+?6?01){1}(([0145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"nl-BE":/^(\+?32|0)4?\d{8}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/(?=^(\+?5{2}\-?|0)[1-9]{2}\-?\d{4}\-?\d{4}$)(^(\+?5{2}\-?|0)[1-9]{2}\-?[6-9]{1}\d{3}\-?\d{4}$)|(^(\+?5{2}\-?|0)[1-9]{2}\-?9[6-9]{1}\d{3}\-?\d{4}$)/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"ro-RO":/^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"vi-VN":/^(\+?84|0)((3([2-9]))|(5([689]))|(7([0|6-9]))|(8([1-5]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/};o["en-CA"]=o["en-US"],o["fr-BE"]=o["nl-BE"],o["zh-HK"]=o["en-HK"];var a=Object.keys(o);t.locales=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),function(e){var t="\\d{".concat(e.digits_after_decimal[0],"}");e.digits_after_decimal.forEach(function(e,r){0!==r&&(t="".concat(t,"|\\d{").concat(e,"}"))});var r="(\\".concat(e.symbol.replace(/\./g,"\\."),")").concat(e.require_symbol?"":"?"),n="[1-9]\\d{0,2}(\\".concat(e.thousands_separator,"\\d{3})*"),i="(".concat(["0","[1-9]\\d*",n].join("|"),")?"),o="(\\".concat(e.decimal_separator,"(").concat(t,"))").concat(e.require_decimal?"":"?"),a=i+(e.allow_decimal||e.require_decimal?o:"");return e.allow_negatives&&!e.parens_for_negatives&&(e.negative_sign_after_digits?a+="-?":e.negative_sign_before_digits&&(a="-?"+a)),e.allow_negative_sign_placeholder?a="( (?!\\-))?".concat(a):e.allow_space_after_symbol?a=" ?".concat(a):e.allow_space_after_digits&&(a+="( (?!$))?"),e.symbol_after_digits?a+=r:a=r+a,e.allow_negatives&&(e.parens_for_negatives?a="(\\(".concat(a,"\\)|").concat(a,")"):e.negative_sign_before_digits||e.negative_sign_after_digits||(a="-?"+a)),new RegExp("^(?!-? )(?=.*\\d)".concat(a,"$"))}(t=(0,n.default)(t,a)).test(e)};var n=o(r(38)),i=o(r(1));function o(e){return e&&e.__esModule?e:{default:e}}var a={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);var r=o.test(e);return t&&r&&t.strict?a(e):r};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,a=function(e){var t=e.match(/^(\d{4})-?(\d{3})([ T]{1}\.*|$)/);if(t){var r=Number(t[1]),n=Number(t[2]);return r%4==0&&r%100!=0?n<=366:n<=365}var i=e.match(/(\d{4})-?(\d{0,2})-?(\d*)/).map(Number),o=i[1],a=i[2],s=i[3],u=a?"0".concat(a).slice(-2):a,c=s?"0".concat(s).slice(-2):s,f=new Date("".concat(o,"-").concat(u||"01","-").concat(c||"01"));return!isNaN(f.getUTCFullYear())&&(!a||!s||f.getUTCFullYear()===o&&f.getUTCMonth()+1===a&&f.getUTCDate()===s)};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),h.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/([01][0-9]|2[0-3])/,a=/[0-5][0-9]/,s=new RegExp("[-+]".concat(o.source,":").concat(a.source)),u=new RegExp("([zZ]|".concat(s.source,")")),c=new RegExp("".concat(o.source,":").concat(a.source,":").concat(/([0-5][0-9]|60)/.source).concat(/(\.[0-9]+)?/.source)),f=new RegExp("".concat(/[0-9]{4}/.source,"-").concat(/(0[1-9]|1[0-2])/.source,"-").concat(/([12]\d|0[1-9]|3[01])/.source)),l=new RegExp("".concat(c.source).concat(u.source)),h=new RegExp("".concat(f.source,"[ tT]").concat(l.source));e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.default)(e),(0,i.default)(a,e.toUpperCase())};var n=o(r(1)),i=o(r(119));function o(e){return e&&e.__esModule?e:{default:e}}var a=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"];e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,n.default)(e),(0,i.default)(a,e.toUpperCase())};var n=o(r(1)),i=o(r(119));function o(e){return e&&e.__esModule?e:{default:e}}var a=["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"];e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);var t=e.length;if(!t||t%4!=0||o.test(e))return!1;var r=e.indexOf("=");return-1===r||r===t-1||r===t-2&&"="===e[t-1]};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/[^A-Z0-9+\/=]/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,i.default)(e);var t=e.split(",");if(t.length<2)return!1;var r=t.shift().trim().split(";"),n=r.shift();if("data:"!==n.substr(0,5))return!1;var u=n.substr(5);if(""!==u&&!o.test(u))return!1;for(var c=0;c<r.length;c++)if(c===r.length-1&&"base64"===r[c].toLowerCase());else if(!a.test(r[c]))return!1;for(var f=0;f<t.length;f++)if(!s.test(t[f]))return!1;return!0};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^[a-z]+\/[a-z0-9\-\+]+$/i,a=/^[a-z\-]+=[a-z0-9\-]+$/i,s=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e.trim())};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32,40}&dn=.+&tr=.+$/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),o.test(e)||a.test(e)||s.test(e)};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i,a=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,s=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,i.default)(e),!e.includes(","))return!1;var t=e.split(",");return o.test(t[0])&&a.test(t[1])};var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,a=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/;e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,i.default)(e),t in u)return u[t].test(e);if("any"===t){for(var r in u)if(u.hasOwnProperty(r)){var n=u[r];if(n.test(e))return!0}return!1}throw new Error("Invalid locale '".concat(t,"'"))},t.locales=void 0;var n,i=(n=r(1))&&n.__esModule?n:{default:n};var o=/^\d{4}$/,a=/^\d{5}$/,s=/^\d{6}$/,u={AD:/^AD\d{3}$/,AT:o,AU:o,BE:o,BG:o,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:o,CZ:/^\d{3}\s?\d{2}$/,DE:a,DK:o,DZ:a,EE:a,ES:a,FI:a,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HU:o,IL:a,IN:s,IS:/^\d{3}$/,IT:a,JP:/^\d{3}\-\d{4}$/,KE:a,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:o,LV:/^LV\-\d{4}$/,MX:a,NL:/^\d{4}\s?[a-z]{2}$/i,NO:o,PL:/^\d{2}\-\d{3}$/,PT:/^\d{4}\-\d{3}?$/,RO:s,RU:s,SA:a,SE:/^\d{3}\s?\d{2}$/,SI:o,SK:/^\d{3}\s?\d{2}$/,TN:o,TW:/^\d{3}(\d{2})?$/,UA:a,US:/^\d{5}(-\d{4})?$/,ZA:o,ZM:a},c=Object.keys(u);t.locales=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,n.default)((0,i.default)(e,t),t)};var n=o(r(193)),i=o(r(192));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\//g,"&#x2F;").replace(/\\/g,"&#x5C;").replace(/`/g,"&#96;")};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e),e.replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#x27;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#x2F;/g,"/").replace(/&#x5C;/g,"\\").replace(/&#96;/g,"`")};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e);var r=t?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return(0,i.default)(e,r)};var n=o(r(1)),i=o(r(194));function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return(0,i.default)(e),e.replace(new RegExp("[^".concat(t,"]+"),"g"),"")};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,i.default)(e);for(var r=e.length-1;r>=0;r--)if(-1===t.indexOf(e[r]))return!1;return!0};var n,i=(n=r(1))&&n.__esModule?n:{default:n};e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){t=(0,i.default)(t,o);var r=e.split("@"),n=r.pop(),l=[r.join("@"),n];if(l[1]=l[1].toLowerCase(),"gmail.com"===l[1]||"googlemail.com"===l[1]){if(t.gmail_remove_subaddress&&(l[0]=l[0].split("+")[0]),t.gmail_remove_dots&&(l[0]=l[0].replace(/\.+/g,f)),!l[0].length)return!1;(t.all_lowercase||t.gmail_lowercase)&&(l[0]=l[0].toLowerCase()),l[1]=t.gmail_convert_googlemaildotcom?"gmail.com":l[1]}else if(a.indexOf(l[1])>=0){if(t.icloud_remove_subaddress&&(l[0]=l[0].split("+")[0]),!l[0].length)return!1;(t.all_lowercase||t.icloud_lowercase)&&(l[0]=l[0].toLowerCase())}else if(s.indexOf(l[1])>=0){if(t.outlookdotcom_remove_subaddress&&(l[0]=l[0].split("+")[0]),!l[0].length)return!1;(t.all_lowercase||t.outlookdotcom_lowercase)&&(l[0]=l[0].toLowerCase())}else if(u.indexOf(l[1])>=0){if(t.yahoo_remove_subaddress){var h=l[0].split("-");l[0]=h.length>1?h.slice(0,-1).join("-"):h[0]}if(!l[0].length)return!1;(t.all_lowercase||t.yahoo_lowercase)&&(l[0]=l[0].toLowerCase())}else c.indexOf(l[1])>=0?((t.all_lowercase||t.yandex_lowercase)&&(l[0]=l[0].toLowerCase()),l[1]="yandex.ru"):t.all_lowercase&&(l[0]=l[0].toLowerCase());return l.join("@")};var n,i=(n=r(38))&&n.__esModule?n:{default:n};var o={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},a=["icloud.com","me.com"],s=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],u=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],c=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];function f(e){return e.length>1?e:""}e.exports=t.default,e.exports.default=t.default},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.derToJose=function(t,r){t=f(t);var i=u(r),o=c((t=n.decode(t,"der")).r,i),a=c(t.s,i);return s=t=(t=e.concat([o,a],o.length+a.length)).toString("base64"),t=s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");var s},t.joseToDer=function(t,r){t=f(t);var n=u(r),a=t.length;if(a!==2*n)throw new TypeError('"'+r+'" signatures must be "'+2*n+'" bytes, saw "'+a+'"');var s=l(t.slice(0,n)),c=l(t.slice(n)),h=2+s.length+1+1+c.length,d=h<128;t=e.alloc((d?2:3)+h);var p=0;t[p++]=32|i,d?t[p++]=h:(t[p++]=129,t[p++]=255&h);return t[p++]=0|o,t[p++]=s.length,s.copy(t,p),p+=s.length,t[p++]=0|o,t[p++]=c.length,c.copy(t,p),t};var n=r(181).define("ECDSASigValue",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),i=16,o=2;function a(e){return(e/8|0)+(e%8==0?0:1)}var s={ES256:a(256),ES384:a(384),ES512:a(512)};function u(e){var t=s[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}function c(t,r){return e.from(t.toString("hex",r),"hex")}function f(t){if(e.isBuffer(t))return e.from(t);if("string"==typeof t)return e.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function l(t){for(var r=0,n=t.length;r<n&&0===t[r];)++r;if(t[r]>=128&&--r<0){var i=t;return(t=e.alloc(1+t.length))[0]=0,i.copy(t,1),t}return 0===r?t:t=t.slice(r)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.TokenVerifier=void 0;var i,o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(106),u=(i=s)&&i.__esModule?i:{default:i},c=r(107),f=r(74);t.TokenVerifier=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t||!r)throw new f.MissingParametersError("a signing algorithm and public key are required");if("string"!=typeof t)throw"signing algorithm parameter must be a string";if(t=t.toUpperCase(),!c.cryptoClients.hasOwnProperty(t))throw"invalid signing algorithm";this.tokenType="JWT",this.cryptoClient=c.cryptoClients[t],this.rawPublicKey=r}return a(e,[{key:"verify",value:function(e){return"string"==typeof e?this.verifyCompact(e):"object"===(void 0===e?"undefined":o(e))&&this.verifyExpanded(e)}},{key:"verifyCompact",value:function(e){var t=e.split("."),r=t[0]+"."+t[1],n=this.cryptoClient.createHash(r),i=this.cryptoClient.loadSignature(t[2]);return this.cryptoClient.verifyHash(n,i,this.rawPublicKey)}},{key:"verifyExpanded",value:function(e){var t=this,r=[e.header.join("."),u.default.encode(e.payload)].join("."),n=this.cryptoClient.createHash(r),i=!0;return e.signature.map(function(e){var r=t.cryptoClient.loadSignature(e);t.cryptoClient.verifyHash(n,r,t.rawPublicKey)||(i=!1)}),i}}]),e}()},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)};t.decodeToken=function(e){if("string"==typeof e){var t=e.split("."),r=JSON.parse(s.default.decode(t[0])),n=JSON.parse(s.default.decode(t[1])),o=t[2];return{header:r,payload:n,signature:o}}if("object"===(void 0===e?"undefined":i(e))){var a=e.payload;"{"!==e.payload[0]&&(a=s.default.decode(a));var u=[];return e.header.map(function(e){var t=JSON.parse(s.default.decode(e));u.push(t)}),{header:u,payload:JSON.parse(a),signature:e.signature}}};var o,a=r(106),s=(o=a)&&o.__esModule?o:{default:o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(454),i=r(44),o=r(19);class a{constructor(e){if(e){const t=new n.SessionData(e);this.setSessionData(t)}}getSessionData(){throw new Error("Abstract class")}setSessionData(e){throw new Error("Abstract class")}deleteSessionData(){throw new Error("Abstract class")}}t.SessionDataStore=a;t.InstanceDataStore=class extends a{constructor(e){super(e),this.sessionData||this.setSessionData(new n.SessionData({}))}getSessionData(){if(!this.sessionData)throw new o.NoSessionDataError("No session data was found.");return Promise.resolve(this.sessionData)}setSessionData(e){return this.sessionData=e,Promise.resolve(!0)}deleteSessionData(){return this.sessionData=null,Promise.resolve(!0)}};t.LocalStorageStore=class extends a{constructor(e){if(super(e),e&&e.storeOptions&&e.storeOptions.localStorageKey&&"string"==typeof e.storeOptions.localStorageKey?this.key=e.storeOptions.localStorageKey:this.key=i.LOCALSTORAGE_SESSION_KEY,!localStorage.getItem(this.key)){const e=new n.SessionData({});this.setSessionData(e)}}getSessionData(){const e=localStorage.getItem(this.key);if(!e)throw new o.NoSessionDataError("No session data was found in localStorage");const t=JSON.parse(e),r=n.SessionData.fromJSON(t);return Promise.resolve(r)}setSessionData(e){return localStorage.setItem(this.key,e.toString()),Promise.resolve(!0)}deleteSessionData(){return localStorage.removeItem(this.key),Promise.resolve(!0)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(19),i="1.0.0";class o{constructor(e){this.version=i,this.appPrivateKey=e.appPrivateKey,this.identityAddress=e.identityAddress,this.username=e.username,this.coreNode=e.coreNode,this.hubUrl=e.hubUrl,this.userData=e.userData,this.transitKey=e.transitKey}getGaiaHubConfig(){return this.userData&&this.userData.gaiaHubConfig}setGaiaHubConfig(e){this.userData.gaiaHubConfig=e}static fromJSON(e){if(e.version!==i)throw new n.InvalidStateError(`JSON data version ${e.version} not supported by SessionData`);const t={appPrivateKey:e.appPrivateKey,identityAddress:e.identityAddress,username:e.username,coreNode:e.coreNode,hubUrl:e.hubUrl,userData:e.userData,transitKey:e.transitKey};return new o(t)}toString(){return JSON.stringify(this)}}t.SessionData=o},function(e,t,r){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%".concat(e.charCodeAt(0).toString(16).toUpperCase())})}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=new RegExp("%[a-f0-9]{2}","gi"),o=new RegExp("(%[a-f0-9]{2})+","gi");function a(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],a(r),a(n))}function s(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(i),r=1;r<t.length;r++)t=(e=a(t,r).join("")).match(i);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+n(e)+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=o.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=s(r[0]);n!==r[0]&&(t[r[0]]=n)}r=o.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),a=0;a<i.length;a++){var u=i[a];e=e.replace(new RegExp(u,"g"),t[u])}return e}(e)}}},function(e,t,r){"use strict";e.exports=function(e,t){if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];var r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9),i=r(20);t.launchCustomProtocol=function(e,t,r){const o=Math.random().toString(36).substr(2,9),a=`echo-reply-${o}`,{localStorage:s,document:u,setTimeout:c,clearTimeout:f,addEventListener:l,removeEventListener:h}=n.getGlobalObjects(["localStorage","document","setTimeout","clearTimeout","addEventListener","removeEventListener"],{throwIfUnavailable:!0,usageDesc:"detectProtocolLaunch"});s.setItem(a,Date.now().toString());const d=()=>{try{s.removeItem(a);for(let e=0;e<s.length;e++){const t=s.key(e);if(t&&t.startsWith("echo-reply-")){const e=s.getItem(t);("success"===e||Date.now()-parseInt(e,10)>36e5)&&s.removeItem(t)}}}catch(e){i.Logger.error("Exception cleaning up echo-reply entries in localStorage"),i.Logger.error(e)}};let p=0;const y=()=>{p&&(f(p),p=0)},b=(e=1e3)=>{y(),p=c(()=>{if(p){let e;y(),"success"===s.getItem(a)?(i.Logger.info("Protocol echo reply detected."),e=t):(i.Logger.info("Protocol handler not detected."),e=r),r=()=>{},t=()=>{},d(),c(()=>e(),100)}},e)};b();const m=u.createElement("input");m.type="text",m.style.cssText="all: initial; position: fixed; top: 0; height: 0; width: 0; opacity: 0;";const g=()=>{let e=!1;m.addEventListener("focus",()=>{e=!0},{once:!0,capture:!0}),c(()=>{p&&!e&&(i.Logger.info("Detected possible browser prompt for opening the protocol handler app."),f(p),m.addEventListener("focus",()=>{p&&(i.Logger.info("Possible browser prompt closed, restarting auth redirect timeout."),b())},{once:!0,capture:!0}))},100)};m.addEventListener("blur",g,{once:!0,capture:!0}),c(()=>m.removeEventListener("blur",g),200),u.body.appendChild(m),m.focus();const v=()=>{u.hidden&&p&&(i.Logger.info("Detected immediate page visibility change (protocol handler probably working)."),b(3e3))};u.addEventListener("visibilitychange",v,{once:!0,capture:!0}),c(()=>u.removeEventListener("visibilitychange",v),500),l("storage",function e(n){if(n.key===a&&"success"===s.getItem(a)){y(),m.removeEventListener("blur",g),i.Logger.info("Protocol echo reply detected from localStorage event."),h("storage",e);const n=t;t=()=>{},r=()=>{},d(),c(()=>n(),100)}},!1),i.Logger.info("Attempting protocol launch via iframe injection.");const _=`${n.BLOCKSTACK_HANDLER}:${e}&echo=${o}`,w=u.createElement("iframe");w.style.cssText="all: initial; display: none; position: fixed; top: 0; height: 0; width: 0; opacity: 0;",w.src=_,u.body.appendChild(w)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getZoneFileTemplate=function(){return"{$origin}\n{$ttl}\n\n; SOA Record\n{name} {ttl} IN SOA {mname}{rname}(\n{serial} ;serial\n{refresh} ;refresh\n{retry} ;retry\n{expire} ;expire\n{minimum} ;minimum ttl\n)\n\n; NS Records\n{ns}\n\n; MX Records\n{mx}\n\n; A Records\n{a}\n\n; AAAA Records\n{aaaa}\n\n; CNAME Records\n{cname}\n\n; PTR Records\n{ptr}\n\n; TXT Records\n{txt}\n\n; SRV Records\n{srv}\n\n; SPF Records\n{spf}\n\n; URI Records\n{uri}\n"}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.ZoneFile=void 0;var o=r(203),a=r(204),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"object"===n(t)?this.jsonZoneFile=JSON.parse(JSON.stringify(t)):"string"==typeof t&&(this.jsonZoneFile=(0,a.parseZoneFile)(t))}var t,r,s;return t=e,(r=[{key:"toJSON",value:function(){return this.jsonZoneFile}},{key:"toString",value:function(){return(0,o.makeZoneFile)(this.toJSON())}}])&&i(t.prototype,r),s&&i(t,s),e}();t.ZoneFile=s},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){var t={};if(t.async=r(462),"object"!==n(t.async))throw new Error("Module async is required (https://github.com/caolan/async)");var i=t.async;function o(e,t){if(!t||"object"!==n(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e}function a(){var e={},t=Array.prototype.slice.call(arguments),r=null,n=null;return t.forEach(function(t){if(t&&t.constructor===Object)for(r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]]}),e}function s(){this.custom={},this.extend=function(e){return o(this.custom,e)},this.reset=function(){this.custom={}},this.remove=function(e){c.array(e)||(e=[e]),e.forEach(function(e){delete this.custom[e]},this)}}function u(e,t){var r=["@"];if(this._schema=e,this._custom={},null!=t)for(var n in t)t.hasOwnProperty(n)&&(this._custom["$"+n]=t[n]);this._getDepth=function(){return r.length},this._dumpStack=function(){return r.map(function(e){return e.replace(/^\[/g,"")}).join(".").replace(/\.\u001b\u001c\u001d\u001e/g,"[")},this._deeperObject=function(e){return r.push(/^[a-z$_][a-z0-9$_]*$/i.test(e)?e:'["'+e+'"]'),this},this._deeperArray=function(e){return r.push("["+e+"]"),this},this._back=function(){return r.pop(),this}}var c={function:function(e){return"function"==typeof e},string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},integer:function(e){return"number"==typeof e&&e%1==0},NaN:function(e){return"number"==typeof e&&isNaN(e)},boolean:function(e){return"boolean"==typeof e},null:function(e){return null===e},date:function(e){return null!=e&&e instanceof Date},object:function(e){return null!=e&&e.constructor===Object},array:function(e){return null!=e&&e.constructor===Array},any:function(e){return!0}};function f(e,t){return"function"==typeof e?t instanceof e:c[e=e in c?e:"any"](t)}function l(e,t){for(var r=[],n=e.indexOf(t);-1!==n;)r.push(n),n=e.indexOf(t,n+1);return r}var h={void:/^$/,url:/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)?(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,"date-time":/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?(Z?|(-|\+)\d{2}:\d{2})$/,date:/^\d{4}-\d{2}-\d{2}$/,coolDateTime:/^\d{4}(-|\/)\d{2}(-|\/)\d{2}(T| )\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/,time:/^\d{2}\:\d{2}\:\d{2}$/,color:/^#([0-9a-f])+$/i,email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,numeric:/^[0-9]+$/,integer:/^\-?[0-9]+$/,decimal:/^\-?[0-9]*\.?[0-9]+$/,alpha:/^[a-z]+$/i,alphaNumeric:/^[a-z0-9]+$/i,alphaDash:/^[a-z0-9_-]+$/i,javascript:/^[a-z_\$][a-z0-9_\$]*$/i,upperString:/^[A-Z ]*$/,lowerString:/^[a-z ]*$/},d={optional:function(e,t){!0!==("boolean"==typeof e.optional?e.optional:"true"===e.optional)&&void 0===t&&this.report("is missing and not optional",null,"optional")},type:function(e,t){if(void 0!==t&&("string"==typeof e.type||e.type instanceof Array||"function"==typeof e.type)){var r=c.array(e.type)?e.type:[e.type];r.some(function(e){return f(e,t)})||(r=r.map(function(e){return"function"==typeof e?"and instance of "+e.name:e}),this.report("must be "+r.join(" or ")+", but is "+function(e){for(var t in c)if(f(t,e))return"any"!==t?t:"an instance of "+e.constructor.name}(t),null,"type"))}},uniqueness:function(e,t){if("string"==typeof e.uniqueness&&(e.uniqueness="true"===e.uniqueness),"boolean"==typeof e.uniqueness&&!1!==e.uniqueness&&(c.array(t)||"string"==typeof t))for(var r=[],n=0;n<t.length;n++)if(!(r.indexOf(t[n])>=0)){var i=l(t,t[n]);i.length>1&&(r.push(t[n]),this.report("has value ["+t[n]+"] more than once at indexes ["+i.join(", ")+"]",null,"uniqueness"))}},pattern:function(e,t){var r=e.pattern;if("string"==typeof t){var n=!1;c.array(r)||(r=[r]),r.forEach(function(e){"string"==typeof e&&e in h&&(e=h[e]),e instanceof RegExp&&e.test(t)&&(n=!0)}),n||this.report("must match ["+r.join(" or ")+'], but is equal to "'+t+'"',null,"pattern")}},validDate:function(e,t){"true"===String(e.validDate)&&t instanceof Date&&isNaN(t.getTime())&&this.report("must be a valid date",null,"validDate")},minLength:function(e,t){if("string"==typeof t||c.array(t)){var r=Number(e.minLength);isNaN(r)||t.length<r&&this.report("must be longer than "+r+" elements, but it has "+t.length,null,"minLength")}},maxLength:function(e,t){if("string"==typeof t||c.array(t)){var r=Number(e.maxLength);isNaN(r)||t.length>r&&this.report("must be shorter than "+r+" elements, but it has "+t.length,null,"maxLength")}},exactLength:function(e,t){if("string"==typeof t||c.array(t)){var r=Number(e.exactLength);isNaN(r)||t.length!==r&&this.report("must have exactly "+r+" elements, but it have "+t.length,null,"exactLength")}},lt:function(e,t){var r=Number(e.lt);"number"!=typeof t||isNaN(r)||t>=r&&this.report("must be less than "+r+', but is equal to "'+t+'"',null,"lt")},lte:function(e,t){var r=Number(e.lte);"number"!=typeof t||isNaN(r)||t>r&&this.report("must be less than or equal to "+r+', but is equal to "'+t+'"',null,"lte")},gt:function(e,t){var r=Number(e.gt);"number"!=typeof t||isNaN(r)||t<=r&&this.report("must be greater than "+r+', but is equal to "'+t+'"',null,"gt")},gte:function(e,t){var r=Number(e.gte);"number"!=typeof t||isNaN(r)||t<r&&this.report("must be greater than or equal to "+r+', but is equal to "'+t+'"',null,"gte")},eq:function(e,t){if("number"==typeof t||"string"==typeof t||"boolean"==typeof t){var r=e.eq;if("number"==typeof r||"string"==typeof r||"boolean"==typeof r||c.array(r))if(c.array(r)){for(var n=0;n<r.length;n++)if(t===r[n])return;this.report("must be equal to ["+r.map(function(e){return'"'+e+'"'}).join(" or ")+'], but is equal to "'+t+'"',null,"eq")}else t!==r&&this.report('must be equal to "'+r+'", but is equal to "'+t+'"',null,"eq")}},ne:function(e,t){if("number"==typeof t||"string"==typeof t){var r=e.ne;if("number"==typeof r||"string"==typeof r||c.array(r))if(c.array(r)){for(var n=0;n<r.length;n++)if(t===r[n])return void this.report('must not be equal to "'+r[n]+'"',null,"ne")}else t===r&&this.report('must not be equal to "'+r+'"',null,"ne")}},someKeys:function(e,t){var r=e.someKeys;c.object(t)&&(r.some(function(e){return e in t})||this.report("must have at least key "+r.map(function(e){return'"'+e+'"'}).join(" or "),null,"someKeys"))},strict:function(e,t){if("string"==typeof e.strict&&(e.strict="true"===e.strict),!0===e.strict&&c.object(t)&&c.object(e.properties)){if(void 0===e.properties["*"]){var r=Object.keys(t).filter(function(t){return void 0===e.properties[t]});if(r.length>0){var n="should not contains "+(r.length>1?"properties":"property")+" ["+r.map(function(e){return'"'+e+'"'}).join(", ")+"]";this.report(n,null,"strict")}}}},exec:function(e,t,r){var n=this;if("function"==typeof r)return this.asyncExec(e,t,r);(c.array(e.exec)?e.exec:[e.exec]).forEach(function(r){"function"==typeof r&&r.call(n,e,t)})},properties:function(e,t,r){if("function"==typeof r)return this.asyncProperties(e,t,r);if(e.properties instanceof Object&&t instanceof Object){var n,i=e.properties;if(null!=i["*"])for(n in t)n in i||(this._deeperObject(n),this._validate(i["*"],t[n]),this._back());for(n in i)"*"!==n&&(this._deeperObject(n),this._validate(i[n],t[n]),this._back())}},items:function(e,t,r){if("function"==typeof r)return this.asyncItems(e,t,r);if(e.items instanceof Object&&t instanceof Object){var n,i,o=e.items;if(c.array(o)&&c.array(t))for(n=0,i=o.length;n<i;n++)this._deeperArray(n),this._validate(o[n],t[n]),this._back();else for(var a in t)t.hasOwnProperty(a)&&(this._deeperArray(a),this._validate(o,t[a]),this._back())}}},p={asyncExec:function(e,t,r){var n=this;i.eachSeries(c.array(e.exec)?e.exec:[e.exec],function(r,o){if("function"==typeof r){if(r.length>2)return r.call(n,e,t,o);r.call(n,e,t)}i.nextTick(o)},r)},asyncProperties:function(e,t,r){if(!(e.properties instanceof Object&&c.object(t)))return r();var n=this,o=e.properties;i.series([function(e){if(null==o["*"])return e();i.eachSeries(Object.keys(t),function(e,r){if(e in o)return i.nextTick(r);n._deeperObject(e),n._asyncValidate(o["*"],t[e],function(e){n._back(),r(e)})},e)},function(e){i.eachSeries(Object.keys(o),function(e,r){if("*"===e)return i.nextTick(r);n._deeperObject(e),n._asyncValidate(o[e],t[e],function(e){n._back(),r(e)})},e)}],r)},asyncItems:function(e,t,r){if(!(e.items instanceof Object&&t instanceof Object))return r();var n=this,o=e.items;c.array(o)&&c.array(t)?i.timesSeries(o.length,function(e,r){n._deeperArray(e),n._asyncValidate(o[e],t[e],function(e,t){n._back(),r(e,t)}),n._back()},r):i.eachSeries(Object.keys(t),function(e,r){n._deeperArray(e),n._asyncValidate(o,t[e],function(e,t){n._back(),r(e,t)})},r)}};function y(e,t){u.prototype.constructor.call(this,e,a(y.custom,t));var r=[];this._basicFields=Object.keys(d),this._customFields=Object.keys(this._custom),this.origin=null,this.report=function(e,t,n){var i={code:t||this.userCode||null,reason:n||"unknown",message:this.userError||e||"is invalid",property:this.userAlias?this.userAlias+" ("+this._dumpStack()+")":this._dumpStack()};return r.push(i),this},this.result=function(){return{error:r,valid:0===r.length,format:function(){return!0===this.valid?"Candidate is valid":this.error.map(function(e){return"Property "+e.property+": "+e.message}).join("\n")}}}}o(y.prototype,d),o(y.prototype,p),o(y,new s),y.prototype.validate=function(e,t){if(this.origin=e,"function"==typeof t){var r=this;return i.nextTick(function(){r._asyncValidate(r._schema,e,function(e){r.origin=null,t(e,r.result())})})}return this._validate(this._schema,e).result()},y.prototype._validate=function(e,t,r){return this.userCode=e.code||null,this.userError=e.error||null,this.userAlias=e.alias||null,this._basicFields.forEach(function(r){(r in e||"optional"===r)&&"function"==typeof this[r]&&this[r](e,t)},this),this._customFields.forEach(function(r){r in e&&"function"==typeof this._custom[r]&&this._custom[r].call(this,e,t)},this),this},y.prototype._asyncValidate=function(e,t,r){var n=this;this.userCode=e.code||null,this.userError=e.error||null,this.userAlias=e.alias||null,i.series([function(r){i.eachSeries(Object.keys(d),function(r,o){i.nextTick(function(){if((r in e||"optional"===r)&&"function"==typeof n[r]){if(n[r].length>2)return n[r](e,t,o);n[r](e,t)}o()})},r)},function(r){i.eachSeries(Object.keys(n._custom),function(r,o){i.nextTick(function(){if(r in e&&"function"==typeof n._custom[r]){if(n._custom[r].length>2)return n._custom[r].call(n,e,t,o);n._custom[r].call(n,e,t)}o()})},r)}],r)};var b={number:function(e,t){var r;if("number"==typeof e)return e;if(""===e)return void 0!==t.def?t.def:null;if("string"==typeof e){if("number"==typeof(r=parseFloat(e.replace(/,/g,".").replace(/ /g,""))))return r}else if(e instanceof Date)return+e;return null},integer:function(e,t){var r;if("number"==typeof e&&e%1==0)return e;if(""===e)return void 0!==t.def?t.def:null;if("string"==typeof e){if("number"==typeof(r=parseInt(e.replace(/ /g,""),10)))return r}else{if("number"==typeof e)return parseInt(e,10);if("boolean"==typeof e)return e?1:0;if(e instanceof Date)return+e}return null},string:function(e,t){return"boolean"==typeof e||"number"==typeof e||e instanceof Date?e.toString():c.array(e)?t.items||t.properties?e:e.join(String(t.joinWith||",")):e instanceof Object?t.items||t.properties?e:JSON.stringify(e):"string"==typeof e&&e.length?e:null},date:function(e,t){if(e instanceof Date)return e;var r=new Date(e);return isNaN(r.getTime())?null:r},boolean:function(e,t){return void 0===e?null:("string"!=typeof e||"false"!==e.toLowerCase())&&!!e},object:function(e,t){if("string"!=typeof e||c.object(e))return e;try{return JSON.parse(e)}catch(e){return null}},array:function(e,t){if(c.array(e))return e;if(void 0===e)return null;if("string"==typeof e){if("["===e.substring(0,1)&&"]"===e.slice(-1))try{return JSON.parse(e)}catch(e){return null}return e.split(String(t.splitWith||","))}return c.array(e)?null:[e]}},m={upper:function(e){return e.toUpperCase()},lower:function(e){return e.toLowerCase()},title:function(e){return e.replace(/\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},capitalize:function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()},ucfirst:function(e){return e.charAt(0).toUpperCase()+e.substr(1)},trim:function(e){return e.trim()}},g={strict:function(e,t){if("string"==typeof e.strict&&(e.strict="true"===e.strict),!0!==e.strict)return t;if(!c.object(e.properties))return t;if(!c.object(t))return t;return Object.keys(t).forEach(function(r){r in e.properties||delete t[r]}),t},optional:function(e,t){return!0===("boolean"==typeof e.optional?e.optional:"false"!==e.optional)?t:void 0!==t?t:(this.report(),e.def===Date?new Date:e.def)},type:function(e,t){if("string"!=typeof e.type||"function"!=typeof b[e.type])return t;var r,n="boolean"!=typeof e.optional||e.optional;return"function"==typeof b[e.type]?(null===(r=b[e.type](t,e))&&!n||!r&&isNaN(r)||null===r&&"string"===e.type)&&(r=e.def):n||(r=e.def),(null!=r||void 0!==e.def&&e.def===r)&&r!==t?(this.report(),r):t},rules:function(e,t){var r=e.rules;if("string"!=typeof t||"string"!=typeof r&&!c.array(r))return t;var n=!1;return(c.array(r)?r:[r]).forEach(function(e){"function"==typeof m[e]&&(t=m[e](t),n=!0)}),n&&this.report(),t},min:function(e,t){var r=Number(t);if(isNaN(r))return t;var n=Number(e.min);return isNaN(n)?t:r<n?(this.report(),n):t},max:function(e,t){var r=Number(t);if(isNaN(r))return t;var n=Number(e.max);return isNaN(n)?t:r>n?(this.report(),n):t},minLength:function(e,t){var r=Number(e.minLength);if("string"!=typeof t||isNaN(r)||r<0)return t;var n="",i=r-t.length;if(i>0){for(var o=0;o<i;o++)n+="-";return this.report(),t+n}return t},maxLength:function(e,t){var r=Number(e.maxLength);return"string"!=typeof t||isNaN(r)||r<0?t:t.length>r?(this.report(),t.slice(0,r)):t},properties:function(e,t,r){if("function"==typeof r)return this.asyncProperties(e,t,r);if(!t||"object"!==n(t))return t;var i,o,a=e.properties;if(void 0!==a["*"])for(o in t)o in a||(this._deeperObject(o),void 0!==(i=this._sanitize(e.properties["*"],t[o]))&&(t[o]=i),this._back());for(o in e.properties)"*"!==o&&(this._deeperObject(o),void 0!==(i=this._sanitize(e.properties[o],t[o]))&&(t[o]=i),this._back());return t},items:function(e,t,r){if("function"==typeof r)return this.asyncItems(e,t,r);if(!(e.items instanceof Object&&t instanceof Object))return t;var n;if(c.array(e.items)&&c.array(t)){var i=e.items.length<t.length?e.items.length:t.length;for(n=0;n<i;n++)this._deeperArray(n),t[n]=this._sanitize(e.items[n],t[n]),this._back()}else for(n in t)t.hasOwnProperty(n)&&(this._deeperArray(n),t[n]=this._sanitize(e.items,t[n]),this._back());return t},exec:function(e,t,r){return"function"==typeof r?this.asyncExec(e,t,r):((c.array(e.exec)?e.exec:[e.exec]).forEach(function(r){"function"==typeof r&&(t=r.call(this,e,t))},this),t)}},v={asyncExec:function(e,t,r){var n=this,o=c.array(e.exec)?e.exec:[e.exec];i.eachSeries(o,function(r,i){if("function"==typeof r){if(r.length>2)return r.call(n,e,t,function(e,r){if(e)return i(e);t=r,i()});t=r.call(n,e,t)}i()},function(e){r(e,t)})},asyncProperties:function(e,t,r){if(!t||"object"!==n(t))return r(null,t);var o=this,a=e.properties;i.series([function(e){if(null==a["*"])return e();var r=a["*"];i.eachSeries(Object.keys(t),function(e,n){if(e in a)return n();o._deeperObject(e),o._asyncSanitize(r,t[e],function(r,i){void 0!==i&&(t[e]=i),o._back(),n()})},e)},function(e){i.eachSeries(Object.keys(a),function(e,r){if("*"===e)return r();o._deeperObject(e),o._asyncSanitize(a[e],t[e],function(n,i){if(n)return r(n);void 0!==i&&(t[e]=i),o._back(),r()})},e)}],function(e){return r(e,t)})},asyncItems:function(e,t,r){if(!(e.items instanceof Object&&t instanceof Object))return r(null,t);var n=this,o=e.items;if(c.array(o)&&c.array(t)){var a=o.length<t.length?o.length:t.length;i.timesSeries(a,function(e,r){n._deeperArray(e),n._asyncSanitize(o[e],t[e],function(i,o){if(i)return r(i);t[e]=o,n._back(),r()})},function(e){r(e,t)})}else i.eachSeries(Object.keys(t),function(e,r){n._deeperArray(e),n._asyncSanitize(o,t[e],function(i,o){if(i)return r();t[e]=o,n._back(),r()})},function(e){r(e,t)});return t}};function _(e,t){u.prototype.constructor.call(this,e,a(_.custom,t));var r=[];this._basicFields=Object.keys(g),this._customFields=Object.keys(this._custom),this.origin=null,this.report=function(e){var t={message:e||"was sanitized",property:this.userAlias?this.userAlias+" ("+this._dumpStack()+")":this._dumpStack()};r.some(function(e){return e.property===t.property})||r.push(t)},this.result=function(e){return{data:e,reporting:r,format:function(){return this.reporting.map(function(e){return"Property "+e.property+" "+e.message}).join("\n")}}}}o(_.prototype,g),o(_.prototype,v),o(_,new s),_.prototype.sanitize=function(e,t){if(this.origin=e,"function"==typeof t){var r=this;return this._asyncSanitize(this._schema,e,function(e,n){r.origin=null,t(e,r.result(n))})}var n=this._sanitize(this._schema,e);return this.origin=null,this.result(n)},_.prototype._sanitize=function(e,t){return this.userAlias=e.alias||null,this._basicFields.forEach(function(r){(r in e||"optional"===r)&&"function"==typeof this[r]&&(t=this[r](e,t))},this),this._customFields.forEach(function(r){r in e&&"function"==typeof this._custom[r]&&(t=this._custom[r].call(this,e,t))},this),t},_.prototype._asyncSanitize=function(e,t,r){var n=this;this.userAlias=e.alias||null,i.waterfall([function(r){i.reduce(n._basicFields,t,function(t,r,o){i.nextTick(function(){if((r in e||"optional"===r)&&"function"==typeof n[r]){if(n[r].length>2)return n[r](e,t,o);t=n[r](e,t)}o(null,t)})},r)},function(t,r){i.reduce(n._customFields,t,function(t,r,o){i.nextTick(function(){if(r in e&&"function"==typeof n._custom[r]){if(n._custom[r].length>2)return n._custom[r].call(n,e,t,o);t=n._custom[r].call(n,e,t)}o(null,t)})},r)}],r)};var w=-2147483648,S=2147483647,k={int:function(e,t){return e+(0|Math.random()*(t-e+1))},float:function(e,t){return Math.random()*(t-e)+e},bool:function(){return Math.random()>.5},char:function(e,t){return String.fromCharCode(this.int(e,t))},fromList:function(e){return e[this.int(0,e.length-1)]}},E={"date-time":function(){return(new Date).toISOString()},date:function(){return(new Date).toISOString().replace(/T.*$/,"")},time:function(){return(new Date).toLocaleTimeString({},{hour12:!1})},color:function(e,t){var r="#";e<1&&(e=1);for(var n=0,i=k.int(e,t);n<i;n++)r+=k.fromList("0123456789abcdefABCDEF");return r},numeric:function(){return""+k.int(0,S)},integer:function(){return!0===k.bool()?"-"+this.numeric():this.numeric()},decimal:function(){return this.integer()+"."+this.numeric()},alpha:function(e,t){var r="";e<1&&(e=1);for(var n=0,i=k.int(e,t);n<i;n++)r+=k.fromList("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");return r},alphaNumeric:function(e,t){var r="";e<1&&(e=1);for(var n=0,i=k.int(e,t);n<i;n++)r+=k.fromList("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");return r},alphaDash:function(e,t){var r="";e<1&&(e=1);for(var n=0,i=k.int(e,t);n<i;n++)r+=k.fromList("_-abcdefghijklmnopqrstuvwxyz_-ABCDEFGHIJKLMNOPQRSTUVWXYZ_-0123456789_-");return r},javascript:function(e,t){for(var r=k.fromList("_$abcdefghijklmnopqrstuvwxyz_$ABCDEFGHIJKLMNOPQRSTUVWXYZ_$"),n=0,i=k.int(e,t-1);n<i;n++)r+=k.fromList("_$abcdefghijklmnopqrstuvwxyz_$ABCDEFGHIJKLMNOPQRSTUVWXYZ_$0123456789_$");return r}};function x(e){var t=w,r=S;return null!=e.gte?t=e.gte:null!=e.gt&&(t=e.gt+1),null!=e.lte?r=e.lte:null!=e.lt&&(r=e.lt-1),{min:t,max:r}}var A={string:function(e){if(null!=e.eq)return e.eq;var t="",r=null!=e.minLength?e.minLength:0,n=null!=e.maxLength?e.maxLength:32;if("string"==typeof e.pattern&&"function"==typeof E[e.pattern])return E[e.pattern](r,n);for(var i=null!=e.exactLength?e.exactLength:k.int(r,n),o=0;o<i;o++)t+=k.char(32,126);return t},number:function(e){if(null!=e.eq)return e.eq;var t=x(e),r=k.float(t.min,t.max);if(null!=e.ne)for(var n=c.array(e.ne)?e.ne:[e.ne];-1!==n.indexOf(r);)r=k.float(t.min,t.max);return r},integer:function(e){if(null!=e.eq)return e.eq;var t=x(e),r=k.int(t.min,t.max);if(null!=e.ne)for(var n=c.array(e.ne)?e.ne:[e.ne];-1!==n.indexOf(r);)r=k.int(t.min,t.max);return r},boolean:function(e){return null!=e.eq?e.eq:k.bool()},null:function(e){return null},date:function(e){return null!=e.eq?e.eq:new Date},object:function(e){var t={},r=e.properties||{};for(var n in r)if(r.hasOwnProperty(n)){if(!0===r[n].optional&&!0===k.bool())continue;if("*"!==n)t[n]=this.generate(r[n]);else for(var i="__random_key_",o=i+0,a=k.int(1,9),s=1;s<=a;s++)o in r||(t[o]=this.generate(r[n])),o=i+s}return t},array:function(e){var t,r,n,i,o=e.items||{},a=null!=e.minLength?e.minLength:0,s=null!=e.maxLength?e.maxLength:16;if(c.array(o))for(n=o.length,null!=e.exactLength?n=e.exactLength:n<a?n=a:n>s&&(n=s),r=new Array(n),t=null,i=0;i<n;i++)t=o[i].type||"any",c.array(t)&&(t=t[k.int(0,t.length-1)]),r[i]=this[t](o[i]);else for(n=null!=e.exactLength?e.exactLength:k.int(a,s),r=new Array(n),t=o.type||"any",c.array(t)&&(t=t[k.int(0,t.length-1)]),i=0;i<n;i++)r[i]=this[t](o);return r},any:function(e){var t=Object.keys(A);return this[t[k.int(0,t.length-2)]](e)}};function O(){}o(O.prototype,A);var P=null;O.instance=function(){return P instanceof O||(P=new O),P},O.prototype.generate=function(e){var t=e.type||"any";return c.array(t)&&(t=t[k.int(0,t.length-1)]),this[t](e)};var T={};e.exports?e.exports=T:window.SchemaInspector=T,T.newSanitization=function(e,t){return new _(e,t)},T.newValidation=function(e,t){return new y(e,t)},T.Validation=y,T.Sanitization=_,T.sanitize=function(e,t,r,n){return 3===arguments.length&&"function"==typeof r&&(n=r,r=null),new _(e,r).sanitize(t,n)},T.validate=function(e,t,r,n){return 3===arguments.length&&"function"==typeof r&&(n=r,r=null),new y(e,r).validate(t,n)},T.generate=function(e,t){if("number"==typeof t){for(var r=new Array(t),n=0;n<t;n++)r[n]=O.instance().generate(e);return r}return O.instance().generate(e)}}()},function(e,t,r){(function(e,r,n,i){var o;function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}
/*!
* async
* https://github.com/caolan/async
*
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/
/*!
* async
* https://github.com/caolan/async
*
* Copyright 2010-2014 Caolan McMahon
* Released under the MIT license
*/
!function(){var s,u={};function c(){}function f(e){return e}function l(e){return!!e}function h(e){return!e}var d="object"===("undefined"==typeof self?"undefined":a(self))&&self.self===self&&self||"object"===(void 0===e?"undefined":a(e))&&e.global===e&&e||this;function p(e){return function(){if(null===e)throw new Error("Callback was already called.");e.apply(this,arguments),e=null}}function y(e){return function(){null!==e&&(e.apply(this,arguments),e=null)}}null!=d&&(s=d.async),u.noConflict=function(){return d.async=s,u};var b=Object.prototype.toString,m=Array.isArray||function(e){return"[object Array]"===b.call(e)};function g(e){return m(e)||"number"==typeof e.length&&e.length>=0&&e.length%1==0}function v(e,t){for(var r=-1,n=e.length;++r<n;)t(e[r],r,e)}function _(e,t){for(var r=-1,n=e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function w(e){return _(Array(e),function(e,t){return t})}function S(e,t,r){return v(e,function(e,n,i){r=t(r,e,n,i)}),r}function k(e,t){v(x(e),function(r){t(e[r],r)})}function E(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1}var x=Object.keys||function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t};function A(e){var t,r,n=-1;return g(e)?(t=e.length,function(){return++n<t?n:null}):(r=x(e),t=r.length,function(){return++n<t?r[n]:null})}function O(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n)}}}function P(e){return function(t,r,n){return e(t,n)}}var T="function"==typeof r&&r,I=T?function(e){T(e)}:function(e){setTimeout(e,0)};function j(e){return function(t,r,n){n=y(n||c);var i=A(t=t||[]);if(e<=0)return n(null);var o=!1,a=0,s=!1;!function u(){if(o&&a<=0)return n(null);for(;a<e&&!s;){var c=i();if(null===c)return o=!0,void(a<=0&&n(null));a+=1,r(t[c],c,p(function(e){a-=1,e?(n(e),s=!0):u()}))}}()}}function M(e){return function(t,r,n){return e(u.eachOf,t,r,n)}}function B(e){return function(t,r,n,i){return e(j(r),t,n,i)}}function N(e){return function(t,r,n){return e(u.eachOfSeries,t,r,n)}}function C(e,t,r,n){n=y(n||c);var i=g(t=t||[])?[]:{};e(t,function(e,t,n){r(e,function(e,r){i[t]=r,n(e)})},function(e){n(e,i)})}function D(e,t,r,n){var i=[];e(t,function(e,t,n){r(e,function(r){r&&i.push({index:t,value:e}),n()})},function(){n(_(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})}function U(e,t,r,n){D(e,t,function(e,t){r(e,function(e){t(!e)})},n)}function R(e,t,r){return function(n,i,o,a){function s(){a&&a(r(!1,void 0))}function u(e,n,i){if(!a)return i();o(e,function(n){a&&t(n)&&(a(r(!0,e)),a=o=!1),i()})}arguments.length>3?e(n,i,u,s):(a=o,o=i,e(n,u,s))}}function F(e,t){return t}function L(e,t,r){r=r||c;var n=g(t)?[]:{};e(t,function(e,t,r){e(O(function(e,i){i.length<=1&&(i=i[0]),n[t]=i,r(e)}))},function(e){r(e,n)})}function z(e,t,r,n){var i=[];e(t,function(e,t,n){r(e,function(e,t){i=i.concat(t||[]),n(e)})},function(e){n(e,i)})}function q(e,t,r){if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");function n(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");if(e.started=!0,m(t)||(t=[t]),0===t.length&&e.idle())return u.setImmediate(function(){e.drain()});v(t,function(t){var i={data:t,callback:n||c};r?e.tasks.unshift(i):e.tasks.push(i),e.tasks.length===e.concurrency&&e.saturated()}),u.setImmediate(e.process)}function i(e,t){return function(){o-=1;var r=!1,n=arguments;v(t,function(e){v(a,function(t,n){t!==e||r||(a.splice(n,1),r=!0)}),e.callback.apply(e,n)}),e.tasks.length+o===0&&e.drain(),e.process()}}var o=0,a=[],s={tasks:[],concurrency:t,payload:r,saturated:c,empty:c,drain:c,started:!1,paused:!1,push:function(e,t){n(s,e,!1,t)},kill:function(){s.drain=c,s.tasks=[]},unshift:function(e,t){n(s,e,!0,t)},process:function(){for(;!s.paused&&o<s.concurrency&&s.tasks.length;){var t=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),r=_(t,function(e){return e.data});0===s.tasks.length&&s.empty(),o+=1,a.push(t[0]);var n=p(i(s,t));e(r,n)}},length:function(){return s.tasks.length},running:function(){return o},workersList:function(){return a},idle:function(){return s.tasks.length+o===0},pause:function(){s.paused=!0},resume:function(){if(!1!==s.paused){s.paused=!1;for(var e=Math.min(s.concurrency,s.tasks.length),t=1;t<=e;t++)u.setImmediate(s.process)}}};return s}function H(e){return O(function(t,r){t.apply(null,r.concat([O(function(t,r){"object"===("undefined"==typeof console?"undefined":a(console))&&(t?console.error&&console.error(t):console[e]&&v(r,function(t){console[e](t)}))})]))})}function K(e){return function(t,r,n){e(w(t),r,n)}}function $(e){return O(function(t,r){var n=O(function(r){var n=this,i=r.pop();return e(t,function(e,t,i){e.apply(n,r.concat([i]))},i)});return r.length?n.apply(this,r):n})}function V(e){return O(function(t){var r=t.pop();t.push(function(){var e=arguments;n?u.setImmediate(function(){r.apply(null,e)}):r.apply(null,e)});var n=!0;e.apply(this,t),n=!1})}"object"===(void 0===n?"undefined":a(n))&&"function"==typeof n.nextTick?u.nextTick=n.nextTick:u.nextTick=I,u.setImmediate=T?I:u.nextTick,u.forEach=u.each=function(e,t,r){return u.eachOf(e,P(t),r)},u.forEachSeries=u.eachSeries=function(e,t,r){return u.eachOfSeries(e,P(t),r)},u.forEachLimit=u.eachLimit=function(e,t,r,n){return j(t)(e,P(r),n)},u.forEachOf=u.eachOf=function(e,t,r){r=y(r||c);for(var n,i=A(e=e||[]),o=0;null!=(n=i());)o+=1,t(e[n],n,p(a));function a(e){o--,e?r(e):null===n&&o<=0&&r(null)}0===o&&r(null)},u.forEachOfSeries=u.eachOfSeries=function(e,t,r){r=y(r||c);var n=A(e=e||[]),i=n();!function o(){var a=!0;if(null===i)return r(null);t(e[i],i,p(function(e){if(e)r(e);else{if(null===(i=n()))return r(null);a?u.setImmediate(o):o()}})),a=!1}()},u.forEachOfLimit=u.eachOfLimit=function(e,t,r,n){j(t)(e,r,n)},u.map=M(C),u.mapSeries=N(C),u.mapLimit=B(C),u.inject=u.foldl=u.reduce=function(e,t,r,n){u.eachOfSeries(e,function(e,n,i){r(t,e,function(e,r){t=r,i(e)})},function(e){n(e,t)})},u.foldr=u.reduceRight=function(e,t,r,n){var i=_(e,f).reverse();u.reduce(i,t,r,n)},u.transform=function(e,t,r,n){3===arguments.length&&(n=r,r=t,t=m(e)?[]:{}),u.eachOf(e,function(e,n,i){r(t,e,n,i)},function(e){n(e,t)})},u.select=u.filter=M(D),u.selectLimit=u.filterLimit=B(D),u.selectSeries=u.filterSeries=N(D),u.reject=M(U),u.rejectLimit=B(U),u.rejectSeries=N(U),u.any=u.some=R(u.eachOf,l,f),u.someLimit=R(u.eachOfLimit,l,f),u.all=u.every=R(u.eachOf,h,h),u.everyLimit=R(u.eachOfLimit,h,h),u.detect=R(u.eachOf,f,F),u.detectSeries=R(u.eachOfSeries,f,F),u.detectLimit=R(u.eachOfLimit,f,F),u.sortBy=function(e,t,r){function n(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0}u.map(e,function(e,r){t(e,function(t,n){t?r(t):r(null,{value:e,criteria:n})})},function(e,t){if(e)return r(e);r(null,_(t.sort(n),function(e){return e.value}))})},u.auto=function(e,t,r){"function"==typeof arguments[1]&&(r=t,t=null),r=y(r||c);var n=x(e),i=n.length;if(!i)return r(null);t||(t=i);var o={},a=0,s=!1,f=[];function l(e){f.unshift(e)}function h(e){var t=E(f,e);t>=0&&f.splice(t,1)}function d(){i--,v(f.slice(0),function(e){e()})}l(function(){i||r(null,o)}),v(n,function(n){if(!s){for(var i,c=m(e[n])?e[n]:[e[n]],f=O(function(e,t){if(a--,t.length<=1&&(t=t[0]),e){var i={};k(o,function(e,t){i[t]=e}),i[n]=t,s=!0,r(e,i)}else o[n]=t,u.setImmediate(d)}),p=c.slice(0,c.length-1),y=p.length;y--;){if(!(i=e[p[y]]))throw new Error("Has nonexistent dependency in "+p.join(", "));if(m(i)&&E(i,n)>=0)throw new Error("Has cyclic dependencies")}b()?(a++,c[c.length-1](f,o)):l(function e(){b()&&(a++,h(e),c[c.length-1](f,o))})}function b(){return a<t&&S(p,function(e,t){return e&&o.hasOwnProperty(t)},!0)&&!o.hasOwnProperty(n)}})},u.retry=function(e,t,r){var n=5,i=0,o=[],s={times:n,interval:i};function c(e,t){if("number"==typeof t)e.times=parseInt(t,10)||n;else{if("object"!==a(t))throw new Error("Unsupported argument type for 'times': "+a(t));e.times=parseInt(t.times,10)||n,e.interval=parseInt(t.interval,10)||i}}var f=arguments.length;if(f<1||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");function l(e,t){function r(e,r){return function(n){e(function(e,t){n(!e||r,{err:e,result:t})},t)}}function n(e){return function(t){setTimeout(function(){t(null)},e)}}for(;s.times;){var i=!(s.times-=1);o.push(r(s.task,i)),!i&&s.interval>0&&o.push(n(s.interval))}u.series(o,function(t,r){r=r[r.length-1],(e||s.callback)(r.err,r.result)})}return f<=2&&"function"==typeof e&&(r=t,t=e),"function"!=typeof e&&c(s,e),s.callback=r,s.task=t,s.callback?l():l},u.waterfall=function(e,t){if(t=y(t||c),!m(e)){var r=new Error("First argument to waterfall must be an array of functions");return t(r)}if(!e.length)return t();!function e(r){return O(function(n,i){if(n)t.apply(null,[n].concat(i));else{var o=r.next();o?i.push(e(o)):i.push(t),V(r).apply(null,i)}})}(u.iterator(e))()},u.parallel=function(e,t){L(u.eachOf,e,t)},u.parallelLimit=function(e,t,r){L(j(t),e,r)},u.series=function(e,t){L(u.eachOfSeries,e,t)},u.iterator=function(e){return function t(r){function n(){return e.length&&e[r].apply(null,arguments),n.next()}return n.next=function(){return r<e.length-1?t(r+1):null},n}(0)},u.apply=O(function(e,t){return O(function(r){return e.apply(null,t.concat(r))})}),u.concat=M(z),u.concatSeries=N(z),u.whilst=function(e,t,r){if(r=r||c,e()){var n=O(function(i,o){i?r(i):e.apply(this,o)?t(n):r.apply(null,[null].concat(o))});t(n)}else r(null)},u.doWhilst=function(e,t,r){var n=0;return u.whilst(function(){return++n<=1||t.apply(this,arguments)},e,r)},u.until=function(e,t,r){return u.whilst(function(){return!e.apply(this,arguments)},t,r)},u.doUntil=function(e,t,r){return u.doWhilst(e,function(){return!t.apply(this,arguments)},r)},u.during=function(e,t,r){r=r||c;var n=O(function(t,n){t?r(t):(n.push(i),e.apply(this,n))}),i=function(e,i){e?r(e):i?t(n):r(null)};e(i)},u.doDuring=function(e,t,r){var n=0;u.during(function(e){n++<1?e(null,!0):t.apply(this,arguments)},e,r)},u.queue=function(e,t){return q(function(t,r){e(t[0],r)},t,1)},u.priorityQueue=function(e,t){function r(e,t){return e.priority-t.priority}var n=u.queue(e,t);return n.push=function(e,t,i){!function(e,t,n,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");if(e.started=!0,m(t)||(t=[t]),0===t.length)return u.setImmediate(function(){e.drain()});v(t,function(t){var o={data:t,priority:n,callback:"function"==typeof i?i:c};e.tasks.splice(function(e,t,r){for(var n=-1,i=e.length-1;n<i;){var o=n+(i-n+1>>>1);r(t,e[o])>=0?n=o:i=o-1}return n}(e.tasks,o,r)+1,0,o),e.tasks.length===e.concurrency&&e.saturated(),u.setImmediate(e.process)})}(n,e,t,i)},delete n.unshift,n},u.cargo=function(e,t){return q(e,1,t)},u.log=H("log"),u.dir=H("dir"),u.memoize=function(e,t){var r={},n={},i=Object.prototype.hasOwnProperty;t=t||f;var o=O(function(o){var a=o.pop(),s=t.apply(null,o);i.call(r,s)?u.setImmediate(function(){a.apply(null,r[s])}):i.call(n,s)?n[s].push(a):(n[s]=[a],e.apply(null,o.concat([O(function(e){r[s]=e;var t=n[s];delete n[s];for(var i=0,o=t.length;i<o;i++)t[i].apply(null,e)})])))});return o.memo=r,o.unmemoized=e,o},u.unmemoize=function(e){return function(){return(e.unmemoized||e).apply(null,arguments)}},u.times=K(u.map),u.timesSeries=K(u.mapSeries),u.timesLimit=function(e,t,r,n){return u.mapLimit(w(e),t,r,n)},u.seq=function(){var e=arguments;return O(function(t){var r=this,n=t[t.length-1];"function"==typeof n?t.pop():n=c,u.reduce(e,t,function(e,t,n){t.apply(r,e.concat([O(function(e,t){n(e,t)})]))},function(e,t){n.apply(r,[e].concat(t))})})},u.compose=function(){return u.seq.apply(null,Array.prototype.reverse.call(arguments))},u.applyEach=$(u.eachOf),u.applyEachSeries=$(u.eachOfSeries),u.forever=function(e,t){var r=p(t||c),n=V(e);!function e(t){if(t)return r(t);n(e)}()},u.ensureAsync=V,u.constant=O(function(e){var t=[null].concat(e);return function(e){return e.apply(this,t)}}),u.wrapSync=u.asyncify=function(e){return O(function(t){var r,n,i,o=t.pop();try{r=e.apply(this,t)}catch(e){return o(e)}("function"===(i=a(n=r))||"object"===i&&n)&&"function"==typeof r.then?r.then(function(e){o(null,e)}).catch(function(e){o(e.message?e:new Error(e))}):o(null,r)})},"object"===a(i)&&i.exports?i.exports=u:void 0===(o=function(){return u}.apply(t,[]))||(i.exports=o)}()}).call(this,r(6),r(90).setImmediate,r(16),r(22)(e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(464),i=r(508),o=r(509),a=r(510),s=r(511),u=r(512);t.profileServices={facebook:n.Facebook,github:i.Github,twitter:o.Twitter,instagram:a.Instagram,hackerNews:s.HackerNews,linkedIn:u.LinkedIn}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(54)),o=r(42);t.Facebook=class extends o.Service{static getProofUrl(e){return this.normalizeUrl(e)}static normalizeUrl(e){let t=e.proof_url.toLowerCase();if((t=super.prefixScheme(t)).startsWith("https://facebook.com")){let r=t.split("https://facebook.com");const n=(r=(t=`https://www.facebook.com${r[1]}`).split("https://www.facebook.com/")[1].split("/posts/"))[1];t=`https://www.facebook.com/${e.identifier}/posts/${n}`}else{if(!t.match(/(?:http[s]*:\/\/){0,1}(?:[a-zA-Z0-9-]+\.)+facebook\.com/))throw new Error(`Proof url ${e.proof_url} is not valid for service ${e.service}`);{const r=t.split("facebook.com/")[1].split("/posts/")[1];t=`https://www.facebook.com/${e.identifier}/posts/${r}`}}return t}static getProofStatement(e){const t=i.default.load(e)('meta[name="description"]').attr("content");return void 0!==t?t.trim():""}}},function(e){e.exports=JSON.parse('{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}')},function(e,t,r){var n=r(211),i=e.exports=Object.create(n),o={tagName:"name"};Object.keys(o).forEach(function(e){var t=o[e];Object.defineProperty(i,e,{get:function(){return this[t]||null},set:function(e){return this[t]=e,e}})})},function(e,t,r){var n=r(210),i=r(212);function o(e,t){this.init(e,t)}function a(e,t){return i.getElementsByTagName(e,t,!0)}function s(e,t){return i.getElementsByTagName(e,t,!0,1)[0]}function u(e,t,r){return i.getText(i.getElementsByTagName(e,t,r,1)).trim()}function c(e,t,r,n,i){var o=u(r,n,i);o&&(e[t]=o)}r(2)(o,n),o.prototype.init=n;var f=function(e){return"rss"===e||"feed"===e||"rdf:RDF"===e};o.prototype.onend=function(){var e,t,r={},i=s(f,this.dom);i&&("feed"===i.name?(t=i.children,r.type="atom",c(r,"id","id",t),c(r,"title","title",t),(e=s("link",t))&&(e=e.attribs)&&(e=e.href)&&(r.link=e),c(r,"description","subtitle",t),(e=u("updated",t))&&(r.updated=new Date(e)),c(r,"author","email",t,!0),r.items=a("entry",t).map(function(e){var t,r={};return c(r,"id","id",e=e.children),c(r,"title","title",e),(t=s("link",e))&&(t=t.attribs)&&(t=t.href)&&(r.link=t),(t=u("summary",e)||u("content",e))&&(r.description=t),(t=u("updated",e))&&(r.pubDate=new Date(t)),r})):(t=s("channel",i.children).children,r.type=i.name.substr(0,3),r.id="",c(r,"title","title",t),c(r,"link","link",t),c(r,"description","description",t),(e=u("lastBuildDate",t))&&(r.updated=new Date(e)),c(r,"author","managingEditor",t,!0),r.items=a("item",i.children).map(function(e){var t,r={};return c(r,"id","guid",e=e.children),c(r,"title","title",e),c(r,"link","link",e),c(r,"description","description",e),(t=u("pubDate",e))&&(r.pubDate=new Date(t)),r}))),this.dom=r,n.prototype._handleCallback.call(this,i?null:Error("couldn't find root of feed"))},e.exports=o},function(e,t,r){var n=r(28),i=r(81),o=n.isTag;e.exports={getInnerHTML:function(e,t){return e.children?e.children.map(function(e){return i(e,t)}).join(""):""},getOuterHTML:i,getText:function e(t){if(Array.isArray(t))return t.map(e).join("");if(o(t))return"br"===t.name?"\n":e(t.children);if(t.type===n.CDATA)return e(t.children);if(t.type===n.Text)return t.data;return""}}},function(e,t,r){var n=r(470),i=r(471);t.decode=function(e,t){return(!t||t<=0?i.XML:i.HTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?i.XML:i.HTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?n.XML:n.HTML)(e)},t.encodeXML=n.XML,t.encodeHTML4=t.encodeHTML5=t.encodeHTML=n.HTML,t.decodeXML=t.decodeXMLStrict=i.XML,t.decodeHTML4=t.decodeHTML5=t.decodeHTML=i.HTML,t.decodeHTML4Strict=t.decodeHTML5Strict=t.decodeHTMLStrict=i.HTMLStrict,t.escape=n.escape},function(e,t,r){var n=s(r(124)),i=u(n);t.XML=d(n,i);var o=s(r(123)),a=u(o);function s(e){return Object.keys(e).sort().reduce(function(t,r){return t[e[r]]="&"+r+";",t},{})}function u(e){var t=[],r=[];return Object.keys(e).forEach(function(e){1===e.length?t.push("\\"+e):r.push(e)}),r.unshift("["+t.join("")+"]"),new RegExp(r.join("|"),"g")}t.HTML=d(o,a);var c=/[^\0-\x7F]/g,f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;function l(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"}function h(e){return"&#x"+(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536).toString(16).toUpperCase()+";"}function d(e,t){function r(t){return e[t]}return function(e){return e.replace(t,r).replace(f,h).replace(c,l)}}var p=u(n);t.escape=function(e){return e.replace(p,l).replace(f,h).replace(c,l)}},function(e,t,r){var n=r(123),i=r(209),o=r(124),a=r(208),s=c(o),u=c(n);function c(e){var t=Object.keys(e).join("|"),r=h(e),n=new RegExp("&(?:"+(t+="|#[xX][\\da-fA-F]+|#\\d+")+");","g");return function(e){return String(e).replace(n,r)}}var f=function(){for(var e=Object.keys(i).sort(l),t=Object.keys(n).sort(l),r=0,o=0;r<t.length;r++)e[o]===t[r]?(t[r]+=";?",o++):t[r]+=";";var a=new RegExp("&(?:"+t.join("|")+"|#[xX][\\da-fA-F]+;?|#\\d+;?)","g"),s=h(n);function u(e){return";"!==e.substr(-1)&&(e+=";"),s(e)}return function(e){return String(e).replace(a,u)}}();function l(e,t){return e<t?1:-1}function h(e){return function(t){return"#"===t.charAt(1)?"X"===t.charAt(2)||"x"===t.charAt(2)?a(parseInt(t.substr(3),16)):a(parseInt(t.substr(2),10)):e[t.slice(1,-1)]}}e.exports={XML:s,HTML:f,HTMLStrict:u}},function(e,t){var r=t.getChildren=function(e){return e.children},n=t.getParent=function(e){return e.parent};t.getSiblings=function(e){var t=n(e);return t?r(t):[e]},t.getAttributeValue=function(e,t){return e.attribs&&e.attribs[t]},t.hasAttrib=function(e,t){return!!e.attribs&&hasOwnProperty.call(e.attribs,t)},t.getName=function(e){return e.name}},function(e,t){t.removeElement=function(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children;t.splice(t.lastIndexOf(e),1)}},t.replaceElement=function(e,t){var r=t.prev=e.prev;r&&(r.next=t);var n=t.next=e.next;n&&(n.prev=t);var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t}},t.appendChild=function(e,t){if(t.parent=e,1!==e.children.push(t)){var r=e.children[e.children.length-2];r.next=t,t.prev=r,t.next=null}},t.append=function(e,t){var r=e.parent,n=e.next;if(t.next=n,t.prev=e,e.next=t,t.parent=r,n){if(n.prev=t,r){var i=r.children;i.splice(i.lastIndexOf(n),0,t)}}else r&&r.children.push(t)},t.prepend=function(e,t){var r=e.parent;if(r){var n=r.children;n.splice(n.lastIndexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}},function(e,t,r){var n=r(28).isTag;function i(e,t,r,n){for(var o,a=[],s=0,u=t.length;s<u&&!(e(t[s])&&(a.push(t[s]),--n<=0))&&(o=t[s].children,!(r&&o&&o.length>0&&(o=i(e,o,r,n),a=a.concat(o),(n-=o.length)<=0)));s++);return a}e.exports={filter:function(e,t,r,n){Array.isArray(t)||(t=[t]);"number"==typeof n&&isFinite(n)||(n=1/0);return i(e,t,!1!==r,n)},find:i,findOneChild:function(e,t){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return t[r];return null},findOne:function e(t,r){var i=null;for(var o=0,a=r.length;o<a&&!i;o++)n(r[o])&&(t(r[o])?i=r[o]:r[o].children.length>0&&(i=e(t,r[o].children)));return i},existsOne:function e(t,r){for(var i=0,o=r.length;i<o;i++)if(n(r[i])&&(t(r[i])||r[i].children.length>0&&e(t,r[i].children)))return!0;return!1},findAll:function(e,t){var r=[],i=t.slice();for(;i.length;){var o=i.shift();n(o)&&(o.children&&o.children.length>0&&i.unshift.apply(i,o.children),e(o)&&r.push(o))}return r}}},function(e,t,r){var n=r(28),i=t.isTag=n.isTag;t.testElement=function(e,t){for(var r in e)if(e.hasOwnProperty(r)){if("tag_name"===r){if(!i(t)||!e.tag_name(t.name))return!1}else if("tag_type"===r){if(!e.tag_type(t.type))return!1}else if("tag_contains"===r){if(i(t)||!e.tag_contains(t.data))return!1}else if(!t.attribs||!e[r](t.attribs[r]))return!1}else;return!0};var o={tag_name:function(e){return"function"==typeof e?function(t){return i(t)&&e(t.name)}:"*"===e?i:function(t){return i(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return!i(t)&&e(t.data)}:function(t){return!i(t)&&t.data===e}}};function a(e,t){return"function"==typeof t?function(r){return r.attribs&&t(r.attribs[e])}:function(r){return r.attribs&&r.attribs[e]===t}}function s(e,t){return function(r){return e(r)||t(r)}}t.getElements=function(e,t,r,n){var i=Object.keys(e).map(function(t){var r=e[t];return t in o?o[t](r):a(t,r)});return 0===i.length?[]:this.filter(i.reduce(s),t,r,n)},t.getElementById=function(e,t,r){return Array.isArray(t)||(t=[t]),this.findOne(a("id",e),t,!1!==r)},t.getElementsByTagName=function(e,t,r,n){return this.filter(o.tag_name(e),t,r,n)},t.getElementsByTagType=function(e,t,r,n){return this.filter(o.tag_type(e),t,r,n)}},function(e,t){t.removeSubsets=function(e){for(var t,r,n,i=e.length;--i>-1;){for(t=r=e[i],e[i]=null,n=!0;r;){if(e.indexOf(r)>-1){n=!1,e.splice(i,1);break}r=r.parent}n&&(e[i]=t)}return e};var r=1,n=2,i=4,o=8,a=16,s=t.compareDocumentPosition=function(e,t){var s,u,c,f,l,h,d=[],p=[];if(e===t)return 0;for(s=e;s;)d.unshift(s),s=s.parent;for(s=t;s;)p.unshift(s),s=s.parent;for(h=0;d[h]===p[h];)h++;return 0===h?r:(c=(u=d[h-1]).children,f=d[h],l=p[h],c.indexOf(f)>c.indexOf(l)?u===t?i|a:i:u===e?n|o:n)};t.uniqueSort=function(e){var t,r,o=e.length;for(e=e.slice();--o>-1;)t=e[o],(r=e.indexOf(t))>-1&&r<o&&e.splice(o,1);return e.sort(function(e,t){var r=s(e,t);return r&n?-1:r&i?1:0}),e}},function(e,t,r){e.exports=i;var n=r(213);function i(e){n.call(this,new o(this),e)}function o(e){this.scope=e}r(2)(i,n),i.prototype.readable=!0;var a=r(55).EVENTS;Object.keys(a).forEach(function(e){if(0===a[e])o.prototype["on"+e]=function(){this.scope.emit(e)};else if(1===a[e])o.prototype["on"+e]=function(t){this.scope.emit(e,t)};else{if(2!==a[e])throw Error("wrong number of arguments!");o.prototype["on"+e]=function(t,r){this.scope.emit(e,t,r)}}})},function(e,t){},function(e,t,r){function n(e){this._cbs=e||{}}e.exports=n;var i=r(55).EVENTS;Object.keys(i).forEach(function(e){if(0===i[e])e="on"+e,n.prototype[e]=function(){this._cbs[e]&&this._cbs[e]()};else if(1===i[e])e="on"+e,n.prototype[e]=function(t){this._cbs[e]&&this._cbs[e](t)};else{if(2!==i[e])throw Error("wrong number of arguments");e="on"+e,n.prototype[e]=function(t,r){this._cbs[e]&&this._cbs[e](t,r)}}})},function(e,t,r){function n(e){this._cbs=e||{},this.events=[]}e.exports=n;var i=r(55).EVENTS;Object.keys(i).forEach(function(e){if(0===i[e])e="on"+e,n.prototype[e]=function(){this.events.push([e]),this._cbs[e]&&this._cbs[e]()};else if(1===i[e])e="on"+e,n.prototype[e]=function(t){this.events.push([e,t]),this._cbs[e]&&this._cbs[e](t)};else{if(2!==i[e])throw Error("wrong number of arguments");e="on"+e,n.prototype[e]=function(t,r){this.events.push([e,t,r]),this._cbs[e]&&this._cbs[e](t,r)}}}),n.prototype.onreset=function(){this.events=[],this._cbs.onreset&&this._cbs.onreset()},n.prototype.restart=function(){this._cbs.onreset&&this._cbs.onreset();for(var e=0,t=this.events.length;e<t;e++)if(this._cbs[this.events[e][0]]){var r=this.events[e].length;1===r?this._cbs[this.events[e][0]]():2===r?this._cbs[this.events[e][0]](this.events[e][1]):this._cbs[this.events[e][0]](this.events[e][1],this.events[e][2])}}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(126),o=r(56),a=o.isTag,s=o.domEach,u=Object.prototype.hasOwnProperty,c=o.camelCase,f=o.cssCase,l=/\s+/,h={forEach:r(82),extend:r(214),some:r(496)},d={null:null,true:!0,false:!1},p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,b=function(e,t){if(e&&a(e))return e.attribs||(e.attribs={}),t?u.call(e.attribs,t)?p.test(t)?t:e.attribs[t]:"option"===e.name&&"value"===t?i.text(e.children):"input"!==e.name||"radio"!==e.attribs.type&&"checkbox"!==e.attribs.type||"value"!==t?void 0:"on":e.attribs},m=function(e,t,r){null===r?w(e,t):e.attribs[t]=r+""};t.attr=function(e,t){return"object"===n(e)||void 0!==t?s(this,"function"==typeof t?function(r,n){m(n,e,t.call(n,r,n.attribs[e]))}:function(r,i){a(i)&&("object"===n(e)?h.forEach(e,function(e,t){m(i,t,e)}):m(i,e,t))}):b(this[0],e)};var g=function(e,t){if(e&&a(e))return e.hasOwnProperty(t)?e[t]:p.test(t)?void 0!==b(e,t):b(e,t)},v=function(e,t,r){e[t]=p.test(t)?!!r:r};t.prop=function(e,t){var r,i=0;if("string"==typeof e&&void 0===t){switch(e){case"style":r=this.css(),h.forEach(r,function(e,t){r[i++]=t}),r.length=i;break;case"tagName":case"nodeName":r=this[0].name.toUpperCase();break;default:r=g(this[0],e)}return r}if("object"===n(e)||void 0!==t)return s(this,"function"==typeof t?function(r,n){v(n,e,t.call(n,r,g(n,e)))}:function(r,i){a(i)&&("object"===n(e)?h.forEach(e,function(e,t){v(i,t,e)}):v(i,e,t))})};var _=function(e,t){var r,n,i,o,a,s,l,h=1===arguments.length;for(h?i=(r=Object.keys(e.attribs).filter(function(e){return"data-"===e.slice(0,"data-".length)})).map(function(e){return c(e.slice("data-".length))}):(r=["data-"+f(t)],i=[t]),s=0,l=r.length;s<l;++s)if(n=r[s],o=i[s],u.call(e.attribs,n)){if(a=e.attribs[n],u.call(d,a))a=d[a];else if(a===String(Number(a)))a=Number(a);else if(y.test(a))try{a=JSON.parse(a)}catch(e){}e.data[o]=a}return h?e.data:a};t.data=function(e,t){var r=this[0];if(r&&a(r))return r.data||(r.data={}),e?"object"===n(e)||void 0!==t?(s(this,function(r,i){!function(e,t,r){if(e.data||(e.data={}),"object"===n(t))return h.extend(e.data,t);"string"==typeof t&&void 0!==r?e.data[t]=r:"object"===n(t)&&h.extend(e.data,t)}(i,e,t)}),this):u.call(r.data,e)?r.data[e]:_(r,e):_(r)},t.val=function(e){var t=0===arguments.length,r=this[0];if(r)switch(r.name){case"textarea":return this.text(e);case"input":switch(this.attr("type")){case"radio":return t?this.attr("value"):(this.attr("value",e),this);default:return this.attr("value",e)}return;case"select":var i,o=this.find("option:selected");if(void 0===o)return;if(!t){if(!this.attr().hasOwnProperty("multiple")&&"object"==n(e))return this;"object"!=n(e)&&(e=[e]),this.find("option").removeAttr("selected");for(var a=0;a<e.length;a++)this.find('option[value="'+e[a]+'"]').attr("selected","");return this}return i=o.attr("value"),this.attr().hasOwnProperty("multiple")&&(i=[],s(o,function(e,t){i.push(b(t,"value"))})),i;case"option":return t?this.attr("value"):(this.attr("value",e),this)}};var w=function(e,t){e.attribs&&u.call(e.attribs,t)&&delete e.attribs[t]};t.removeAttr=function(e){return s(this,function(t,r){w(r,e)}),this},t.hasClass=function(e){return h.some(this,function(t){var r,n=t.attribs,i=n&&n.class,o=-1;if(i)for(;(o=i.indexOf(e,o+1))>-1;)if(r=o+e.length,(0===o||l.test(i[o-1]))&&(r===i.length||l.test(i[r])))return!0})},t.addClass=function(e){if("function"==typeof e)return s(this,function(r,n){var i=n.attribs.class||"";t.addClass.call([n],e.call(n,r,i))});if(!e||"string"!=typeof e)return this;for(var r=e.split(l),n=this.length,i=0;i<n;i++)if(a(this[i])){var o,u,c=b(this[i],"class");if(c){u=" "+c+" ",o=r.length;for(var f=0;f<o;f++){var h=r[f]+" ";u.indexOf(" "+h)<0&&(u+=h)}m(this[i],"class",u.trim())}else m(this[i],"class",r.join(" ").trim())}return this};var S=function(e){return e?e.trim().split(l):[]};t.removeClass=function(e){var r,n,i;return"function"==typeof e?s(this,function(r,n){t.removeClass.call([n],e.call(n,r,n.attribs.class||""))}):(r=S(e),n=r.length,i=0===arguments.length,s(this,function(e,t){if(a(t))if(i)t.attribs.class="";else{for(var o,s,u=S(t.attribs.class),c=0;c<n;c++)(o=u.indexOf(r[c]))>=0&&(u.splice(o,1),s=!0,c--);s&&(t.attribs.class=u.join(" "))}}))},t.toggleClass=function(e,r){if("function"==typeof e)return s(this,function(n,i){t.toggleClass.call([i],e.call(i,n,i.attribs.class||"",r),r)});if(!e||"string"!=typeof e)return this;for(var n,i,o=e.split(l),u=o.length,c="boolean"==typeof r?r?1:-1:0,f=this.length,h=0;h<f;h++)if(a(this[h])){n=S(this[h].attribs.class);for(var d=0;d<u;d++)i=n.indexOf(o[d]),c>=0&&i<0?n.push(o[d]):c<=0&&i>=0&&n.splice(i,1);this[h].attribs.class=n.join(" ")}return this},t.is=function(e){return!!e&&this.filter(e).length>0}},function(e,t,r){var n=r(28),i=r(81),o=n.isTag;e.exports={getInnerHTML:function(e,t){return e.children?e.children.map(function(e){return i(e,t)}).join(""):""},getOuterHTML:i,getText:function e(t){if(Array.isArray(t))return t.map(e).join("");if(o(t)||t.type===n.CDATA)return e(t.children);if(t.type===n.Text)return t.data;return""}}},function(e,t){var r=t.getChildren=function(e){return e.children},n=t.getParent=function(e){return e.parent};t.getSiblings=function(e){var t=n(e);return t?r(t):[e]},t.getAttributeValue=function(e,t){return e.attribs&&e.attribs[t]},t.hasAttrib=function(e,t){return!!e.attribs&&hasOwnProperty.call(e.attribs,t)},t.getName=function(e){return e.name}},function(e,t){t.removeElement=function(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children;t.splice(t.lastIndexOf(e),1)}},t.replaceElement=function(e,t){var r=t.prev=e.prev;r&&(r.next=t);var n=t.next=e.next;n&&(n.prev=t);var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t}},t.appendChild=function(e,t){if(t.parent=e,1!==e.children.push(t)){var r=e.children[e.children.length-2];r.next=t,t.prev=r,t.next=null}},t.append=function(e,t){var r=e.parent,n=e.next;if(t.next=n,t.prev=e,e.next=t,t.parent=r,n){if(n.prev=t,r){var i=r.children;i.splice(i.lastIndexOf(n),0,t)}}else r&&r.children.push(t)},t.prepend=function(e,t){var r=e.parent;if(r){var n=r.children;n.splice(n.lastIndexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=r,t.prev=e.prev,t.next=e,e.prev=t}},function(e,t,r){var n=r(28).isTag;function i(e,t,r,n){for(var o,a=[],s=0,u=t.length;s<u&&!(e(t[s])&&(a.push(t[s]),--n<=0))&&(o=t[s].children,!(r&&o&&o.length>0&&(o=i(e,o,r,n),a=a.concat(o),(n-=o.length)<=0)));s++);return a}e.exports={filter:function(e,t,r,n){Array.isArray(t)||(t=[t]);"number"==typeof n&&isFinite(n)||(n=1/0);return i(e,t,!1!==r,n)},find:i,findOneChild:function(e,t){for(var r=0,n=t.length;r<n;r++)if(e(t[r]))return t[r];return null},findOne:function e(t,r){var i=null;for(var o=0,a=r.length;o<a&&!i;o++)n(r[o])&&(t(r[o])?i=r[o]:r[o].children.length>0&&(i=e(t,r[o].children)));return i},existsOne:function e(t,r){for(var i=0,o=r.length;i<o;i++)if(n(r[i])&&(t(r[i])||r[i].children.length>0&&e(t,r[i].children)))return!0;return!1},findAll:function e(t,r){var i=[];for(var o=0,a=r.length;o<a;o++)n(r[o])&&(t(r[o])&&i.push(r[o]),r[o].children.length>0&&(i=i.concat(e(t,r[o].children))));return i}}},function(e,t,r){var n=r(28),i=t.isTag=n.isTag;t.testElement=function(e,t){for(var r in e)if(e.hasOwnProperty(r)){if("tag_name"===r){if(!i(t)||!e.tag_name(t.name))return!1}else if("tag_type"===r){if(!e.tag_type(t.type))return!1}else if("tag_contains"===r){if(i(t)||!e.tag_contains(t.data))return!1}else if(!t.attribs||!e[r](t.attribs[r]))return!1}else;return!0};var o={tag_name:function(e){return"function"==typeof e?function(t){return i(t)&&e(t.name)}:"*"===e?i:function(t){return i(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return!i(t)&&e(t.data)}:function(t){return!i(t)&&t.data===e}}};function a(e,t){return"function"==typeof t?function(r){return r.attribs&&t(r.attribs[e])}:function(r){return r.attribs&&r.attribs[e]===t}}function s(e,t){return function(r){return e(r)||t(r)}}t.getElements=function(e,t,r,n){var i=Object.keys(e).map(function(t){var r=e[t];return t in o?o[t](r):a(t,r)});return 0===i.length?[]:this.filter(i.reduce(s),t,r,n)},t.getElementById=function(e,t,r){return Array.isArray(t)||(t=[t]),this.findOne(a("id",e),t,!1!==r)},t.getElementsByTagName=function(e,t,r,n){return this.filter(o.tag_name(e),t,r,n)},t.getElementsByTagType=function(e,t,r,n){return this.filter(o.tag_type(e),t,r,n)}},function(e,t){t.removeSubsets=function(e){for(var t,r,n,i=e.length;--i>-1;){for(t=r=e[i],e[i]=null,n=!0;r;){if(e.indexOf(r)>-1){n=!1,e.splice(i,1);break}r=r.parent}n&&(e[i]=t)}return e};var r=1,n=2,i=4,o=8,a=16,s=t.compareDocumentPosition=function(e,t){var s,u,c,f,l,h,d=[],p=[];if(e===t)return 0;for(s=e;s;)d.unshift(s),s=s.parent;for(s=t;s;)p.unshift(s),s=s.parent;for(h=0;d[h]===p[h];)h++;return 0===h?r:(c=(u=d[h-1]).children,f=d[h],l=p[h],c.indexOf(f)>c.indexOf(l)?u===t?i|a:i:u===e?n|o:n)};t.uniqueSort=function(e){var t,r,o=e.length;for(e=e.slice();--o>-1;)t=e[o],(r=e.indexOf(t))>-1&&r<o&&e.splice(o,1);return e.sort(function(e,t){var r=s(e,t);return r&n?-1:r&i?1:0}),e}},function(e,t,r){var n=r(489),i=r(490);e.exports=function(e){return i(n(e))},e.exports.parse=n,e.exports.compile=i},function(e,t){e.exports=function(e){if("even"===(e=e.trim().toLowerCase()))return[2,0];if("odd"===e)return[2,1];var t,n=e.match(r);if(!n)throw new SyntaxError("n-th rule couldn't be parsed ('"+e+"')");return n[1]?(t=parseInt(n[1],10),isNaN(t)&&(t="-"===n[1].charAt(0)?-1:1)):t=0,[t,n[3]?parseInt((n[2]||"")+n[3],10):0]};var r=/^([+\-]?\d*n)?\s*(?:([+\-]?)\s*(\d+))?$/},function(e,t,r){e.exports=function(e){var t=e[0],r=e[1]-1;if(r<0&&t<=0)return o;if(-1===t)return function(e){return e<=r};if(0===t)return function(e){return e===r};if(1===t)return r<0?i:function(e){return e>=r};var n=r%t;n<0&&(n+=t);if(t>1)return function(e){return e>=r&&e%t===n};return t*=-1,function(e){return e<=r&&e%t===n}};var n=r(58),i=n.trueFunc,o=n.falseFunc},function(e,t,r){e.exports=function(e,t,r){return h(d(e,t,r))},e.exports.compileUnsafe=d,e.exports.compileToken=v;var n=r(492),i=r(57),o=i.isTag,a=r(493),s=r(494),u=r(58),c=u.trueFunc,f=u.falseFunc,l=r(218);function h(e){return function(t){return o(t)&&e(t)}}function d(e,t,r){return v(n(e,t),t,r)}function p(e){return"pseudo"===e.type&&("scope"===e.name||Array.isArray(e.data)&&e.data.some(function(e){return e.some(p)}))}var y={type:"descendant"},b={type:"pseudo",name:"scope"},m={},g=i.getParent;function v(e,t,r){(e=e.filter(function(e){return e.length>0})).forEach(s);var n=Array.isArray(r);return(r=t&&t.context||r)&&!n&&(r=[r]),function(e,t){var r=!!t&&!!t.length&&t.every(function(e){return e===m||!!g(e)});e.forEach(function(e){if(e.length>0&&_(e[0])&&"descendant"!==e[0].type);else{if(!r||p(e))return;e.unshift(y)}e.unshift(b)})}(e,r),e.map(function(e){return function(e,t,r,n){var i=n&&"scope"===e[0].name&&"descendant"===e[1].type;return e.reduce(function(e,n,o){return e===f?e:a[n.type](e,n,t,r,i&&1===o)},t&&t.rootFunc||c)}(e,t,r,n)}).reduce(w,f)}function _(e){return l[e.type]<0}function w(e,t){return t===f||e===c?e:e===f||t===c?t:function(r){return e(r)||t(r)}}var S=r(127).filters,k=i.existsOne,E=(o=i.isTag,i.getChildren);function x(e){return e.some(_)}S.not=function(e,t,r,n){var i={xmlMode:!(!r||!r.xmlMode),strict:!(!r||!r.strict)};if(i.strict&&(t.length>1||t.some(x)))throw new SyntaxError("complex selectors in :not aren't allowed in strict mode");var o=v(t,i,n);return o===f?e:o===c?f:function(t){return!o(t)&&e(t)}},S.has=function(e,t,r){var n={xmlMode:!(!r||!r.xmlMode),strict:!(!r||!r.strict)},i=t.some(x)?[m]:null,a=v(t,n,i);return a===f?f:a===c?function(t){return E(t).some(o)&&e(t)}:(a=h(a),i?function(t){return e(t)&&(i[0]=t,k(a,E(t)))}:function(t){return e(t)&&k(a,E(t))})},S.matches=function(e,t,r,n){return v(t,{xmlMode:!(!r||!r.xmlMode),strict:!(!r||!r.strict),rootFunc:e},n)}},function(e,t,r){"use strict";e.exports=function(e,t){var r=[];if(""!==(e=function e(t,r,i){var h,b,m,g,v=[],_=!1;function w(){var e=r.match(n)[0];return r=r.substr(e.length),d(e)}function S(e){for(;p(r.charAt(e));)e++;r=r.substr(e)}function k(e){for(var t=0;"\\"===r.charAt(--e);)t++;return 1==(1&t)}for(S(0);""!==r;)if(p(b=r.charAt(0)))_=!0,S(1);else if(b in s)v.push({type:s[b]}),_=!1,S(1);else if(","===b){if(0===v.length)throw new SyntaxError("empty sub-selector");t.push(v),v=[],_=!1,S(1)}else if(_&&(v.length>0&&v.push({type:"descendant"}),_=!1),"*"===b)r=r.substr(1),v.push({type:"universal"});else if(b in u)r=r.substr(1),v.push({type:"attribute",name:u[b][0],action:u[b][1],value:w(),ignoreCase:!1});else if("["===b){if(r=r.substr(1),!(h=r.match(o)))throw new SyntaxError("Malformed attribute selector: "+r);r=r.substr(h[0].length),m=d(h[1]),i&&("lowerCaseAttributeNames"in i?!i.lowerCaseAttributeNames:i.xmlMode)||(m=m.toLowerCase()),v.push({type:"attribute",name:m,action:a[h[2]],value:d(h[4]||h[5]||""),ignoreCase:!!h[6]})}else if(":"===b){if(":"===r.charAt(1)){r=r.substr(2),v.push({type:"pseudo-element",name:w().toLowerCase()});continue}if(r=r.substr(1),m=w().toLowerCase(),h=null,"("===r.charAt(0))if(m in c){var E=(g=r.charAt(1))in l;if(r=r.substr(E+1),r=e(h=[],r,i),E){if(r.charAt(0)!==g)throw new SyntaxError("unmatched quotes in :"+m);r=r.substr(1)}if(")"!==r.charAt(0))throw new SyntaxError("missing closing parenthesis in :"+m+" "+r);r=r.substr(1)}else{for(var x=1,A=1;A>0&&x<r.length;x++)"("!==r.charAt(x)||k(x)?")"!==r.charAt(x)||k(x)||A--:A++;if(A)throw new SyntaxError("parenthesis not matched");h=r.substr(1,x-2),r=r.substr(x),m in f&&((g=h.charAt(0))===h.slice(-1)&&g in l&&(h=h.slice(1,-1)),h=d(h))}v.push({type:"pseudo",name:m,data:h})}else{if(!n.test(r))return v.length&&"descendant"===v[v.length-1].type&&v.pop(),y(t,v),r;m=w(),i&&("lowerCaseTags"in i?!i.lowerCaseTags:i.xmlMode)||(m=m.toLowerCase()),v.push({type:"tag",name:m})}return y(t,v),r}(r,e+"",t)))throw new SyntaxError("Unmatched selector: "+e);return r};var n=/^(?:\\.|[\w\-\u00b0-\uFFFF])+/,i=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,o=/^\s*((?:\\.|[\w\u00b0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF\-])*)|)|)\s*(i)?\]/,a={__proto__:null,undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},s={__proto__:null,">":"child","<":"parent","~":"sibling","+":"adjacent"},u={__proto__:null,"#":["id","equals"],".":["class","element"]},c={__proto__:null,has:!0,not:!0,matches:!0},f={__proto__:null,contains:!0,icontains:!0},l={__proto__:null,'"':!0,"'":!0};function h(e,t,r){var n="0x"+t-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)}function d(e){return e.replace(i,h)}function p(e){return" "===e||"\n"===e||"\t"===e||"\f"===e||"\r"===e}function y(e,t){if(e.length>0&&0===t.length)throw new SyntaxError("empty sub-selector");e.push(t)}},function(e,t,r){var n=r(57),i=n.isTag,o=n.getParent,a=n.getChildren,s=n.getSiblings,u=n.getName;e.exports={__proto__:null,attribute:r(217).compile,pseudo:r(127).compile,tag:function(e,t){var r=t.name;return function(t){return u(t)===r&&e(t)}},descendant:function(e,t,r,n,i){return function(t){if(i&&e(t))return!0;for(var r=!1;!r&&(t=o(t));)r=e(t);return r}},parent:function(e,t,r){if(r&&r.strict)throw SyntaxError("Parent selector isn't part of CSS3");return function(e){return a(e).some(n)};function n(t){return i(t)&&e(t)}},child:function(e){return function(t){var r=o(t);return!!r&&e(r)}},sibling:function(e){return function(t){for(var r=s(t),n=0;n<r.length;n++)if(i(r[n])){if(r[n]===t)break;if(e(r[n]))return!0}return!1}},adjacent:function(e){return function(t){for(var r,n=s(t),o=0;o<n.length;o++)if(i(n[o])){if(n[o]===t)break;r=n[o]}return!!r&&e(r)}},universal:function(e){return e}}},function(e,t,r){e.exports=function(e){for(var t=e.map(o),r=1;r<e.length;r++){var n=t[r];if(!(n<0))for(var i=r-1;i>=0&&n<t[i];i--){var a=e[i+1];e[i+1]=e[i],e[i]=a,t[i+1]=t[i],t[i]=n}}};var n=r(218),i={__proto__:null,exists:10,equals:8,not:7,start:6,end:6,any:5,hyphen:4,element:4};function o(e){var t=n[e.type];if(t===n.attribute)(t=i[e.action])===i.equals&&"id"===e.name&&(t=9),e.ignoreCase&&(t>>=1);else if(t===n.pseudo)if(e.data)if("has"===e.name||"contains"===e.name)t=0;else if("matches"===e.name||"not"===e.name){t=0;for(var r=0;r<e.data.length;r++)if(1===e.data[r].length){var a=o(e.data[r][0]);if(0===a){t=0;break}a>t&&(t=a)}e.data.length>1&&t>0&&(t-=1)}else t=1;else t=3;return t}},function(e,t,r){(function(e,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=200,o="__lodash_hash_undefined__",a=800,s=16,u=9007199254740991,c="[object Arguments]",f="[object AsyncFunction]",l="[object Function]",h="[object GeneratorFunction]",d="[object Null]",p="[object Object]",y="[object Proxy]",b="[object Undefined]",m=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,v={};v["[object Float32Array]"]=v["[object Float64Array]"]=v["[object Int8Array]"]=v["[object Int16Array]"]=v["[object Int32Array]"]=v["[object Uint8Array]"]=v["[object Uint8ClampedArray]"]=v["[object Uint16Array]"]=v["[object Uint32Array]"]=!0,v[c]=v["[object Array]"]=v["[object ArrayBuffer]"]=v["[object Boolean]"]=v["[object DataView]"]=v["[object Date]"]=v["[object Error]"]=v[l]=v["[object Map]"]=v["[object Number]"]=v[p]=v["[object RegExp]"]=v["[object Set]"]=v["[object String]"]=v["[object WeakMap]"]=!1;var _="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e,w="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,S=_||w||Function("return this")(),k="object"==n(t)&&t&&!t.nodeType&&t,E=k&&"object"==n(r)&&r&&!r.nodeType&&r,x=E&&E.exports===k,A=x&&_.process,O=function(){try{var e=E&&E.require&&E.require("util").types;return e||A&&A.binding&&A.binding("util")}catch(e){}}(),P=O&&O.isTypedArray;function T(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var I,j,M,B=Array.prototype,N=Function.prototype,C=Object.prototype,D=S["__core-js_shared__"],U=N.toString,R=C.hasOwnProperty,F=(I=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"",L=C.toString,z=U.call(Object),q=RegExp("^"+U.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=x?S.Buffer:void 0,K=S.Symbol,$=S.Uint8Array,V=H?H.allocUnsafe:void 0,G=(j=Object.getPrototypeOf,M=Object,function(e){return j(M(e))}),W=Object.create,X=C.propertyIsEnumerable,J=B.splice,Z=K?K.toStringTag:void 0,Y=function(){try{var e=ke(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Q=H?H.isBuffer:void 0,ee=Math.max,te=Date.now,re=ke(S,"Map"),ne=ke(Object,"create"),ie=function(){function e(){}return function(t){if(!Ce(t))return{};if(W)return W(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function se(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ue(e){var t=this.__data__=new ae(e);this.size=t.size}function ce(e,t){var r=Ie(e),n=!r&&Te(e),i=!r&&!n&&Me(e),o=!r&&!n&&!i&&Ue(e),a=r||n||i||o,s=a?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=s.length;for(var c in e)!t&&!R.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ee(c,u))||s.push(c);return s}function fe(e,t,r){(void 0===r||Pe(e[t],r))&&(void 0!==r||t in e)||de(e,t,r)}function le(e,t,r){var n=e[t];R.call(e,t)&&Pe(n,r)&&(void 0!==r||t in e)||de(e,t,r)}function he(e,t){for(var r=e.length;r--;)if(Pe(e[r][0],t))return r;return-1}function de(e,t,r){"__proto__"==t&&Y?Y(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}oe.prototype.clear=function(){this.__data__=ne?ne(null):{},this.size=0},oe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},oe.prototype.get=function(e){var t=this.__data__;if(ne){var r=t[e];return r===o?void 0:r}return R.call(t,e)?t[e]:void 0},oe.prototype.has=function(e){var t=this.__data__;return ne?void 0!==t[e]:R.call(t,e)},oe.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ne&&void 0===t?o:t,this},ae.prototype.clear=function(){this.__data__=[],this.size=0},ae.prototype.delete=function(e){var t=this.__data__,r=he(t,e);return!(r<0||(r==t.length-1?t.pop():J.call(t,r,1),--this.size,0))},ae.prototype.get=function(e){var t=this.__data__,r=he(t,e);return r<0?void 0:t[r][1]},ae.prototype.has=function(e){return he(this.__data__,e)>-1},ae.prototype.set=function(e,t){var r=this.__data__,n=he(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},se.prototype.clear=function(){this.size=0,this.__data__={hash:new oe,map:new(re||ae),string:new oe}},se.prototype.delete=function(e){var t=Se(this,e).delete(e);return this.size-=t?1:0,t},se.prototype.get=function(e){return Se(this,e).get(e)},se.prototype.has=function(e){return Se(this,e).has(e)},se.prototype.set=function(e,t){var r=Se(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ue.prototype.clear=function(){this.__data__=new ae,this.size=0},ue.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ue.prototype.get=function(e){return this.__data__.get(e)},ue.prototype.has=function(e){return this.__data__.has(e)},ue.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ae){var n=r.__data__;if(!re||n.length<i-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new se(n)}return r.set(e,t),this.size=r.size,this};var pe,ye=function(e,t,r){for(var n=-1,i=Object(e),o=r(e),a=o.length;a--;){var s=o[pe?a:++n];if(!1===t(i[s],s,i))break}return e};function be(e){return null==e?void 0===e?b:d:Z&&Z in Object(e)?function(e){var t=R.call(e,Z),r=e[Z];try{e[Z]=void 0;var n=!0}catch(e){}var i=L.call(e);n&&(t?e[Z]=r:delete e[Z]);return i}(e):function(e){return L.call(e)}(e)}function me(e){return De(e)&&be(e)==c}function ge(e){return!(!Ce(e)||function(e){return!!F&&F in e}(e))&&(Be(e)?q:m).test(function(e){if(null!=e){try{return U.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ve(e){if(!Ce(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=xe(e),r=[];for(var n in e)("constructor"!=n||!t&&R.call(e,n))&&r.push(n);return r}function _e(e,t,r,n,i){e!==t&&ye(t,function(o,a){if(i||(i=new ue),Ce(o))!function(e,t,r,n,i,o,a){var s=Ae(e,r),u=Ae(t,r),c=a.get(u);if(c)return void fe(e,r,c);var f=o?o(s,u,r+"",e,t,a):void 0,l=void 0===f;if(l){var h=Ie(u),d=!h&&Me(u),y=!h&&!d&&Ue(u);f=u,h||d||y?Ie(s)?f=s:De(_=s)&&je(_)?f=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(s):d?(l=!1,f=function(e,t){if(t)return e.slice();var r=e.length,n=V?V(r):new e.constructor(r);return e.copy(n),n}(u,!0)):y?(l=!1,b=u,m=!0?(g=b.buffer,v=new g.constructor(g.byteLength),new $(v).set(new $(g)),v):b.buffer,f=new b.constructor(m,b.byteOffset,b.length)):f=[]:function(e){if(!De(e)||be(e)!=p)return!1;var t=G(e);if(null===t)return!0;var r=R.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&U.call(r)==z}(u)||Te(u)?(f=s,Te(s)?f=function(e){return function(e,t,r,n){var i=!r;r||(r={});var o=-1,a=t.length;for(;++o<a;){var s=t[o],u=n?n(r[s],e[s],s,r,e):void 0;void 0===u&&(u=e[s]),i?de(r,s,u):le(r,s,u)}return r}(e,Re(e))}(s):Ce(s)&&!Be(s)||(f=function(e){return"function"!=typeof e.constructor||xe(e)?{}:ie(G(e))}(u))):l=!1}var b,m,g,v;var _;l&&(a.set(u,f),i(f,u,n,o,a),a.delete(u));fe(e,r,f)}(e,t,a,r,_e,n,i);else{var s=n?n(Ae(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),fe(e,a,s)}},Re)}function we(e,t){return Oe(function(e,t,r){return t=ee(void 0===t?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=ee(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),T(e,this,s)}}(e,t,ze),e+"")}function Se(e,t){var r,i,o=e.__data__;return("string"==(i=n(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function ke(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ge(r)?r:void 0}function Ee(e,t){var r=n(e);return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&g.test(e))&&e>-1&&e%1==0&&e<t}function xe(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function Ae(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Oe=function(e){var t=0,r=0;return function(){var n=te(),i=s-(n-r);if(r=n,i>0){if(++t>=a)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Y?function(e,t){return Y(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:ze);function Pe(e,t){return e===t||e!=e&&t!=t}var Te=me(function(){return arguments}())?me:function(e){return De(e)&&R.call(e,"callee")&&!X.call(e,"callee")},Ie=Array.isArray;function je(e){return null!=e&&Ne(e.length)&&!Be(e)}var Me=Q||function(){return!1};function Be(e){if(!Ce(e))return!1;var t=be(e);return t==l||t==h||t==f||t==y}function Ne(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function Ce(e){var t=n(e);return null!=e&&("object"==t||"function"==t)}function De(e){return null!=e&&"object"==n(e)}var Ue=P?function(e){return function(t){return e(t)}}(P):function(e){return De(e)&&Ne(e.length)&&!!v[be(e)]};function Re(e){return je(e)?ce(e,!0):ve(e)}var Fe,Le=(Fe=function(e,t,r){_e(e,t,r)},we(function(e,t){var r=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=Fe.length>3&&"function"==typeof o?(i--,o):void 0,a&&function(e,t,r){if(!Ce(r))return!1;var i=n(t);return!!("number"==i?je(r)&&Ee(t,r.length):"string"==i&&t in r)&&Pe(r[t],e)}(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=t[r];s&&Fe(e,s,r,o)}return e}));function ze(e){return e}r.exports=Le}).call(this,r(6),r(22)(e))},function(e,t,r){(function(e,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=200,o="Expected a function",a="__lodash_hash_undefined__",s=1,u=2,c=1/0,f=9007199254740991,l="[object Arguments]",h="[object Array]",d="[object Boolean]",p="[object Date]",y="[object Error]",b="[object Function]",m="[object GeneratorFunction]",g="[object Map]",v="[object Number]",_="[object Object]",w="[object RegExp]",S="[object Set]",k="[object String]",E="[object Symbol]",x="[object ArrayBuffer]",A="[object DataView]",O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,P=/^\w*$/,T=/^\./,I=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/\\(\\)?/g,M=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,N={};N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N[l]=N[h]=N[x]=N[d]=N[A]=N[p]=N[y]=N[b]=N[g]=N[v]=N[_]=N[w]=N[S]=N[k]=N["[object WeakMap]"]=!1;var C="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e,D="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,U=C||D||Function("return this")(),R="object"==n(t)&&t&&!t.nodeType&&t,F=R&&"object"==n(r)&&r&&!r.nodeType&&r,L=F&&F.exports===R&&C.process,z=function(){try{return L&&L.binding("util")}catch(e){}}(),q=z&&z.isTypedArray;function H(e,t){for(var r=-1,n=e?e.length:0;++r<n;)if(t(e[r],r,e))return!0;return!1}function K(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function $(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function V(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var G,W,X,J=Array.prototype,Z=Function.prototype,Y=Object.prototype,Q=U["__core-js_shared__"],ee=(G=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",te=Z.toString,re=Y.hasOwnProperty,ne=Y.toString,ie=RegExp("^"+te.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oe=U.Symbol,ae=U.Uint8Array,se=Y.propertyIsEnumerable,ue=J.splice,ce=(W=Object.keys,X=Object,function(e){return W(X(e))}),fe=$e(U,"DataView"),le=$e(U,"Map"),he=$e(U,"Promise"),de=$e(U,"Set"),pe=$e(U,"WeakMap"),ye=$e(Object,"create"),be=Qe(fe),me=Qe(le),ge=Qe(he),ve=Qe(de),_e=Qe(pe),we=oe?oe.prototype:void 0,Se=we?we.valueOf:void 0,ke=we?we.toString:void 0;function Ee(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function xe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ae(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Oe(e){var t=-1,r=e?e.length:0;for(this.__data__=new Ae;++t<r;)this.add(e[t])}function Pe(e){this.__data__=new xe(e)}function Te(e,t){var r=nt(e)||rt(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,i=!!n;for(var o in e)!t&&!re.call(e,o)||i&&("length"==o||Ge(o,n))||r.push(o);return r}function Ie(e,t){for(var r=e.length;r--;)if(tt(e[r][0],t))return r;return-1}Ee.prototype.clear=function(){this.__data__=ye?ye(null):{}},Ee.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Ee.prototype.get=function(e){var t=this.__data__;if(ye){var r=t[e];return r===a?void 0:r}return re.call(t,e)?t[e]:void 0},Ee.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:re.call(t,e)},Ee.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?a:t,this},xe.prototype.clear=function(){this.__data__=[]},xe.prototype.delete=function(e){var t=this.__data__,r=Ie(t,e);return!(r<0||(r==t.length-1?t.pop():ue.call(t,r,1),0))},xe.prototype.get=function(e){var t=this.__data__,r=Ie(t,e);return r<0?void 0:t[r][1]},xe.prototype.has=function(e){return Ie(this.__data__,e)>-1},xe.prototype.set=function(e,t){var r=this.__data__,n=Ie(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Ae.prototype.clear=function(){this.__data__={hash:new Ee,map:new(le||xe),string:new Ee}},Ae.prototype.delete=function(e){return Ke(this,e).delete(e)},Ae.prototype.get=function(e){return Ke(this,e).get(e)},Ae.prototype.has=function(e){return Ke(this,e).has(e)},Ae.prototype.set=function(e,t){return Ke(this,e).set(e,t),this},Oe.prototype.add=Oe.prototype.push=function(e){return this.__data__.set(e,a),this},Oe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.clear=function(){this.__data__=new xe},Pe.prototype.delete=function(e){return this.__data__.delete(e)},Pe.prototype.get=function(e){return this.__data__.get(e)},Pe.prototype.has=function(e){return this.__data__.has(e)},Pe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xe){var n=r.__data__;if(!le||n.length<i-1)return n.push([e,t]),this;r=this.__data__=new Ae(n)}return r.set(e,t),this};var je,Me,Be=(je=function(e,t){return e&&Ne(e,t,lt)},function(e,t){if(null==e)return e;if(!it(e))return je(e,t);for(var r=e.length,n=Me?r:-1,i=Object(e);(Me?n--:++n<r)&&!1!==t(i[n],n,i););return e}),Ne=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===r(o[u],u,o))break}return t}}();function Ce(e,t){for(var r=0,n=(t=We(t,e)?[t]:qe(t)).length;null!=e&&r<n;)e=e[Ye(t[r++])];return r&&r==n?e:void 0}function De(e,t){return null!=e&&t in Object(e)}function Ue(e,t,r,n,i){return e===t||(null==e||null==t||!st(e)&&!ut(t)?e!=e&&t!=t:function(e,t,r,n,i,o){var a=nt(e),c=nt(t),f=h,b=h;a||(f=(f=Ve(e))==l?_:f);c||(b=(b=Ve(t))==l?_:b);var m=f==_&&!K(e),O=b==_&&!K(t),P=f==b;if(P&&!m)return o||(o=new Pe),a||ft(e)?He(e,t,r,n,i,o):function(e,t,r,n,i,o,a){switch(r){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!n(new ae(e),new ae(t)));case d:case p:case v:return tt(+e,+t);case y:return e.name==t.name&&e.message==t.message;case w:case k:return e==t+"";case g:var c=$;case S:var f=o&u;if(c||(c=V),e.size!=t.size&&!f)return!1;var l=a.get(e);if(l)return l==t;o|=s,a.set(e,t);var h=He(c(e),c(t),n,i,o,a);return a.delete(e),h;case E:if(Se)return Se.call(e)==Se.call(t)}return!1}(e,t,f,r,n,i,o);if(!(i&u)){var T=m&&re.call(e,"__wrapped__"),I=O&&re.call(t,"__wrapped__");if(T||I){var j=T?e.value():e,M=I?t.value():t;return o||(o=new Pe),r(j,M,n,i,o)}}if(!P)return!1;return o||(o=new Pe),function(e,t,r,n,i,o){var a=i&u,s=lt(e),c=s.length,f=lt(t).length;if(c!=f&&!a)return!1;for(var l=c;l--;){var h=s[l];if(!(a?h in t:re.call(t,h)))return!1}var d=o.get(e);if(d&&o.get(t))return d==t;var p=!0;o.set(e,t),o.set(t,e);for(var y=a;++l<c;){h=s[l];var b=e[h],m=t[h];if(n)var g=a?n(m,b,h,t,e,o):n(b,m,h,e,t,o);if(!(void 0===g?b===m||r(b,m,n,i,o):g)){p=!1;break}y||(y="constructor"==h)}if(p&&!y){var v=e.constructor,_=t.constructor;v!=_&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof _&&_ instanceof _)&&(p=!1)}return o.delete(e),o.delete(t),p}(e,t,r,n,i,o)}(e,t,Ue,r,n,i))}function Re(e){return!(!st(e)||function(e){return!!ee&&ee in e}(e))&&(ot(e)||K(e)?ie:M).test(Qe(e))}function Fe(e){return"function"==typeof e?e:null==e?ht:"object"==n(e)?nt(e)?function(e,t){if(We(e)&&Xe(t))return Je(Ye(e),t);return function(r){var n=function(e,t,r){var n=null==e?void 0:Ce(e,t);return void 0===n?r:n}(r,e);return void 0===n&&n===t?function(e,t){return null!=e&&function(e,t,r){t=We(t,e)?[t]:qe(t);var n,i=-1,o=t.length;for(;++i<o;){var a=Ye(t[i]);if(!(n=null!=e&&r(e,a)))break;e=e[a]}if(n)return n;return!!(o=e?e.length:0)&&at(o)&&Ge(a,o)&&(nt(e)||rt(e))}(e,t,De)}(r,e):Ue(t,n,void 0,s|u)}}(e[0],e[1]):function(e){var t=function(e){var t=lt(e),r=t.length;for(;r--;){var n=t[r],i=e[n];t[r]=[n,i,Xe(i)]}return t}(e);if(1==t.length&&t[0][2])return Je(t[0][0],t[0][1]);return function(r){return r===e||function(e,t,r,n){var i=r.length,o=i,a=!n;if(null==e)return!o;for(e=Object(e);i--;){var c=r[i];if(a&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<o;){var f=(c=r[i])[0],l=e[f],h=c[1];if(a&&c[2]){if(void 0===l&&!(f in e))return!1}else{var d=new Pe;if(n)var p=n(l,h,f,e,t,d);if(!(void 0===p?Ue(h,l,n,s|u,d):p))return!1}}return!0}(r,e,t)}}(e):We(t=e)?(r=Ye(t),function(e){return null==e?void 0:e[r]}):function(e){return function(t){return Ce(t,e)}}(t);var t,r}function Le(e){if(r=(t=e)&&t.constructor,n="function"==typeof r&&r.prototype||Y,t!==n)return ce(e);var t,r,n,i=[];for(var o in Object(e))re.call(e,o)&&"constructor"!=o&&i.push(o);return i}function ze(e,t){var r;return Be(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function qe(e){return nt(e)?e:Ze(e)}function He(e,t,r,n,i,o){var a=i&u,c=e.length,f=t.length;if(c!=f&&!(a&&f>c))return!1;var l=o.get(e);if(l&&o.get(t))return l==t;var h=-1,d=!0,p=i&s?new Oe:void 0;for(o.set(e,t),o.set(t,e);++h<c;){var y=e[h],b=t[h];if(n)var m=a?n(b,y,h,t,e,o):n(y,b,h,e,t,o);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!H(t,function(e,t){if(!p.has(t)&&(y===e||r(y,e,n,i,o)))return p.add(t)})){d=!1;break}}else if(y!==b&&!r(y,b,n,i,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function Ke(e,t){var r,i,o=e.__data__;return("string"==(i=n(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function $e(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return Re(r)?r:void 0}var Ve=function(e){return ne.call(e)};function Ge(e,t){return!!(t=null==t?f:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function We(e,t){if(nt(e))return!1;var r=n(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ct(e))||(P.test(e)||!O.test(e)||null!=t&&e in Object(t))}function Xe(e){return e==e&&!st(e)}function Je(e,t){return function(r){return null!=r&&(r[e]===t&&(void 0!==t||e in Object(r)))}}(fe&&Ve(new fe(new ArrayBuffer(1)))!=A||le&&Ve(new le)!=g||he&&"[object Promise]"!=Ve(he.resolve())||de&&Ve(new de)!=S||pe&&"[object WeakMap]"!=Ve(new pe))&&(Ve=function(e){var t=ne.call(e),r=t==_?e.constructor:void 0,n=r?Qe(r):void 0;if(n)switch(n){case be:return A;case me:return g;case ge:return"[object Promise]";case ve:return S;case _e:return"[object WeakMap]"}return t});var Ze=et(function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(ct(e))return ke?ke.call(e):"";var t=e+"";return"0"==t&&1/e==-c?"-0":t}(t);var r=[];return T.test(e)&&r.push(""),e.replace(I,function(e,t,n,i){r.push(n?i.replace(j,"$1"):t||e)}),r});function Ye(e){if("string"==typeof e||ct(e))return e;var t=e+"";return"0"==t&&1/e==-c?"-0":t}function Qe(e){if(null!=e){try{return te.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function et(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(o);var r=function r(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a),a};return r.cache=new(et.Cache||Ae),r}function tt(e,t){return e===t||e!=e&&t!=t}function rt(e){return function(e){return ut(e)&&it(e)}(e)&&re.call(e,"callee")&&(!se.call(e,"callee")||ne.call(e)==l)}et.Cache=Ae;var nt=Array.isArray;function it(e){return null!=e&&at(e.length)&&!ot(e)}function ot(e){var t=st(e)?ne.call(e):"";return t==b||t==m}function at(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function st(e){var t=n(e);return!!e&&("object"==t||"function"==t)}function ut(e){return!!e&&"object"==n(e)}function ct(e){return"symbol"==n(e)||ut(e)&&ne.call(e)==E}var ft=q?function(e){return function(t){return e(t)}}(q):function(e){return ut(e)&&at(e.length)&&!!N[ne.call(e)]};function lt(e){return it(e)?Te(e):Le(e)}function ht(e){return e}r.exports=function(e,t,r){var i=nt(e)?H:ze;return r&&function(e,t,r){if(!st(r))return!1;var i=n(t);return!!("number"==i?it(r)&&Ge(t,r.length):"string"==i&&t in r)&&tt(r[t],e)}(e,t,r)&&(t=void 0),i(e,Fe(t))}}).call(this,r(6),r(22)(e))},function(e,t,r){var n=r(216),i=r(56),o=i.domEach,a=r(55).DomUtils.uniqueSort,s=i.isTag,u={bind:r(125),forEach:r(82),reject:r(498),filter:r(499),reduce:r(500)};t.find=function(e){var t,r=u.reduce(this,function(e,t){return e.concat(u.filter(t.children,s))},[]),i=this.constructor.contains;if(e&&"string"!=typeof e)return t=e.cheerio?e.get():[e],this._make(t.filter(function(e){var t,r;for(t=0,r=this.length;t<r;++t)if(i(this[t],e))return!0},this));var o={__proto__:this.options,context:this.toArray()};return this._make(n(e,r,o))},t.parent=function(e){var r=[];return o(this,function(e,t){var n=t.parent;n&&r.indexOf(n)<0&&r.push(n)}),arguments.length&&(r=t.filter.call(r,e,this)),this._make(r)},t.parents=function(e){var t=[];return this.get().reverse().forEach(function(r){f(this,r.parent,e,1/0).forEach(function(e){-1===t.indexOf(e)&&t.push(e)})},this),this._make(t)},t.parentsUntil=function(e,t){var r,i,o=[];return"string"==typeof e?r=n(e,this.parents().toArray(),this.options)[0]:e&&e.cheerio?i=e.toArray():e&&(r=e),this.toArray().reverse().forEach(function(e){for(;(e=e.parent)&&(r&&e!==r||i&&-1===i.indexOf(e)||!r&&!i);)s(e)&&-1===o.indexOf(e)&&o.push(e)},this),this._make(t?n(t,o,this.options):o)},t.closest=function(e){var t=[];return e?(o(this,function(r,n){var i=f(this,n,e,1)[0];i&&t.indexOf(i)<0&&t.push(i)}.bind(this)),this._make(t)):this._make(t)},t.next=function(e){if(!this[0])return this;var r=[];return u.forEach(this,function(e){for(;e=e.next;)if(s(e))return void r.push(e)}),e?t.filter.call(r,e,this):this._make(r)},t.nextAll=function(e){if(!this[0])return this;var r=[];return u.forEach(this,function(e){for(;e=e.next;)s(e)&&-1===r.indexOf(e)&&r.push(e)}),e?t.filter.call(r,e,this):this._make(r)},t.nextUntil=function(e,r){if(!this[0])return this;var i,o,a=[];return"string"==typeof e?i=n(e,this.nextAll().get(),this.options)[0]:e&&e.cheerio?o=e.get():e&&(i=e),u.forEach(this,function(e){for(;(e=e.next)&&(i&&e!==i||o&&-1===o.indexOf(e)||!i&&!o);)s(e)&&-1===a.indexOf(e)&&a.push(e)}),r?t.filter.call(a,r,this):this._make(a)},t.prev=function(e){if(!this[0])return this;var r=[];return u.forEach(this,function(e){for(;e=e.prev;)if(s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment